|
|
@ -191,16 +191,15 @@ class OnboardingModal extends React.PureComponent {
|
|
|
|
this.setState({ currentIndex: i });
|
|
|
|
this.setState({ currentIndex: i });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleNext = (e) => {
|
|
|
|
handleNext = () => {
|
|
|
|
const maxNum = Number(e.currentTarget.getAttribute('data-length'));
|
|
|
|
this.setState(({ currentIndex }) => ({
|
|
|
|
e.preventDefault();
|
|
|
|
currentIndex: currentIndex + 1,
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (this.state.currentIndex < maxNum - 1) {
|
|
|
|
handleClose = () => {
|
|
|
|
this.setState({ currentIndex: this.state.currentIndex + 1 });
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.props.onClose();
|
|
|
|
this.props.onClose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render () {
|
|
|
|
const { me, admin, domain, intl } = this.props;
|
|
|
|
const { me, admin, domain, intl } = this.props;
|
|
|
@ -216,13 +215,21 @@ class OnboardingModal extends React.PureComponent {
|
|
|
|
const { currentIndex } = this.state;
|
|
|
|
const { currentIndex } = this.state;
|
|
|
|
const hasMore = currentIndex < pages.length - 1;
|
|
|
|
const hasMore = currentIndex < pages.length - 1;
|
|
|
|
|
|
|
|
|
|
|
|
let nextOrDoneBtn;
|
|
|
|
const nextOrDoneBtn = hasMore ? (
|
|
|
|
|
|
|
|
<button
|
|
|
|
if(hasMore) {
|
|
|
|
onClick={this.handleNext}
|
|
|
|
nextOrDoneBtn = <a href='#' data-length={pages.length} onClick={this.handleNext} className='onboarding-modal__nav onboarding-modal__next'><FormattedMessage id='onboarding.next' defaultMessage='Next' /></a>;
|
|
|
|
className='onboarding-modal__nav onboarding-modal__next'
|
|
|
|
} else {
|
|
|
|
>
|
|
|
|
nextOrDoneBtn = <a href='#' data-length={pages.length} onClick={this.handleNext} className='onboarding-modal__nav onboarding-modal__done'><FormattedMessage id='onboarding.done' defaultMessage='Done' /></a>;
|
|
|
|
<FormattedMessage id='onboarding.next' defaultMessage='Next' />
|
|
|
|
}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
) : (
|
|
|
|
|
|
|
|
<button
|
|
|
|
|
|
|
|
onClick={this.handleClose}
|
|
|
|
|
|
|
|
className='onboarding-modal__nav onboarding-modal__done'
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<FormattedMessage id='onboarding.done' defaultMessage='Done' />
|
|
|
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
const styles = pages.map((page, i) => ({
|
|
|
|
const styles = pages.map((page, i) => ({
|
|
|
|
key: `page-${i}`,
|
|
|
|
key: `page-${i}`,
|
|
|
@ -243,7 +250,12 @@ class OnboardingModal extends React.PureComponent {
|
|
|
|
|
|
|
|
|
|
|
|
<div className='onboarding-modal__paginator'>
|
|
|
|
<div className='onboarding-modal__paginator'>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<a href='#' className='onboarding-modal__skip' onClick={this.handleSkip}><FormattedMessage id='onboarding.skip' defaultMessage='Skip' /></a>
|
|
|
|
<button
|
|
|
|
|
|
|
|
onClick={this.handleSkip}
|
|
|
|
|
|
|
|
className='onboarding-modal__nav onboarding-modal__skip'
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<FormattedMessage id='onboarding.skip' defaultMessage='Skip' />
|
|
|
|
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className='onboarding-modal__dots'>
|
|
|
|
<div className='onboarding-modal__dots'>
|
|
|
|