More i18n work
This commit is contained in:
parent
3ef6f3c80b
commit
2ad4972115
16 changed files with 286 additions and 90 deletions
|
|
@ -28,6 +28,7 @@ import Footer from '../../components/Footer/Footer';
|
|||
import Terms from '../../pages/Terms/Terms';
|
||||
import Privacy from '../../pages/Privacy/Privacy';
|
||||
import License from '../../pages/License/License';
|
||||
import ReSendEmail from '../../components/ReSendEmail/ReSendEmail';
|
||||
// i18n
|
||||
import { I18nextProvider } from 'react-i18next';
|
||||
import i18n from '/imports/startup/client/i18n';
|
||||
|
|
@ -36,24 +37,12 @@ import i18n from '/imports/startup/client/i18n';
|
|||
|
||||
import './App.scss';
|
||||
|
||||
const handleResendVerificationEmail = (emailAddress) => {
|
||||
Meteor.call('users.sendVerificationEmail', (error) => {
|
||||
if (error) {
|
||||
Bert.alert(error.reason, 'danger');
|
||||
} else {
|
||||
Bert.alert(`Check ${emailAddress} for a verification link!`, 'success');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
const App = props => (
|
||||
<I18nextProvider i18n={i18n}>
|
||||
<Router>
|
||||
{!props.loading ? <div className="App">
|
||||
<Navigation {...props} />
|
||||
{props.userId && !props.emailVerified ? <Alert className="verify-email text-center"><p>Hey friend! Can you <strong>verify your email address</strong> ({props.emailAddress}) for us? <Button bsStyle="link" onClick={() => handleResendVerificationEmail(props.emailAddress)} href="#">Re-send verification email</Button></p></Alert> : ''}
|
||||
<ReSendEmail {...props} />
|
||||
<Grid> {/* bsClass="previously-container-but-disabled" > */}
|
||||
<Switch>
|
||||
<Route exact name="index" path="/" component={Index} />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue