Disabled feedback in production
This commit is contained in:
parent
719ea435d4
commit
151c792fc6
2 changed files with 13 additions and 9 deletions
|
|
@ -82,8 +82,8 @@ class Feedback extends Component {
|
||||||
className="form-control"
|
className="form-control"
|
||||||
ref={email => (this.email = email)}
|
ref={email => (this.email = email)}
|
||||||
placeholder={this.t('Tu correo')}
|
placeholder={this.t('Tu correo')}
|
||||||
disabled={this.props.authenticated}
|
disabled={this.props.emailVerified}
|
||||||
defaultValue={this.props.authenticated ? Meteor.user().emails[0].address : ''}
|
defaultValue={this.props.emailVerified ? this.props.emailAddress : ''}
|
||||||
type="email"
|
type="email"
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
@ -117,9 +117,10 @@ class Feedback extends Component {
|
||||||
|
|
||||||
Feedback.propTypes = {
|
Feedback.propTypes = {
|
||||||
t: PropTypes.func.isRequired,
|
t: PropTypes.func.isRequired,
|
||||||
authenticated: PropTypes.bool.isRequired
|
emailAddress: PropTypes.string,
|
||||||
|
emailVerified: PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
export default translate([], { wait: true })(withTracker(props => ({
|
||||||
export default translate([], { wait: true })(withTracker(() => ({
|
emailAddress: props.emailAddress,
|
||||||
authenticated: !!Meteor.userId()
|
emailVerified: props.emailVerified
|
||||||
}))(Feedback));
|
}))(Feedback));
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,8 @@ const App = props => (
|
||||||
</Switch>
|
</Switch>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Footer />
|
<Footer />
|
||||||
{ !isHome() && <Feedback /> }
|
{ Meteor.isDevelopment && !props.isHome && <Feedback {...props} /> }
|
||||||
<Reconnect />
|
<Reconnect {...props} />
|
||||||
{props.i18nReady.get() &&
|
{props.i18nReady.get() &&
|
||||||
<Blaze template="cookieConsent" />
|
<Blaze template="cookieConsent" />
|
||||||
}
|
}
|
||||||
|
|
@ -162,7 +162,8 @@ App.propTypes = {
|
||||||
i18nReady: PropTypes.object.isRequired,
|
i18nReady: PropTypes.object.isRequired,
|
||||||
userId: PropTypes.string,
|
userId: PropTypes.string,
|
||||||
emailAddress: PropTypes.string,
|
emailAddress: PropTypes.string,
|
||||||
emailVerified: PropTypes.bool.isRequired
|
emailVerified: PropTypes.bool.isRequired,
|
||||||
|
isHome: PropTypes.bool.isRequired
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUserName = name => ({
|
const getUserName = name => ({
|
||||||
|
|
@ -178,6 +179,7 @@ export default withTracker(() => {
|
||||||
const name = user && user.profile && user.profile.name && getUserName(user.profile.name);
|
const name = user && user.profile && user.profile.name && getUserName(user.profile.name);
|
||||||
const emailAddress = user && user.emails && user.emails[0].address;
|
const emailAddress = user && user.emails && user.emails[0].address;
|
||||||
// console.log(`i18n ready?: ${i18nReady.get()}`);
|
// console.log(`i18n ready?: ${i18nReady.get()}`);
|
||||||
|
console.log(`isHome?: ${isHome()}`);
|
||||||
return {
|
return {
|
||||||
loading,
|
loading,
|
||||||
loggingIn,
|
loggingIn,
|
||||||
|
|
@ -187,6 +189,7 @@ export default withTracker(() => {
|
||||||
roles: !loading && Roles.getRolesForUser(userId),
|
roles: !loading && Roles.getRolesForUser(userId),
|
||||||
userId,
|
userId,
|
||||||
emailAddress,
|
emailAddress,
|
||||||
|
isHome: isHome(),
|
||||||
emailVerified: user && user.emails ? user && user.emails && user.emails[0].verified : true
|
emailVerified: user && user.emails ? user && user.emails && user.emails[0].verified : true
|
||||||
};
|
};
|
||||||
})(App);
|
})(App);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue