// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import UserStore from '../../stores/user_store.jsx'; import ChannelStore from '../../stores/channel_store.jsx'; import TeamStore from '../../stores/team_store.jsx'; import PreferenceStore from '../../stores/preference_store.jsx'; import * as Utils from '../../utils/utils.jsx'; import * as AsyncClient from '../../utils/async_client.jsx'; import Constants from '../../utils/constants.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'mm-intl'; const Preferences = Constants.Preferences; const NUM_SCREENS = 3; export default class TutorialIntroScreens extends React.Component { constructor(props) { super(props); this.handleNext = this.handleNext.bind(this); this.createScreen = this.createScreen.bind(this); this.createCircles = this.createCircles.bind(this); this.state = {currentScreen: 0}; } handleNext() { if (this.state.currentScreen < 2) { this.setState({currentScreen: this.state.currentScreen + 1}); return; } Utils.switchChannel(ChannelStore.getByName(Constants.DEFAULT_CHANNEL)); let preference = PreferenceStore.getPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), {value: '0'}); const newValue = (parseInt(preference.value, 10) + 1).toString(); preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), newValue); AsyncClient.savePreferences([preference]); } componentDidMount() { $('.tutorials__scroll').perfectScrollbar(); } skipTutorial(e) { e.preventDefault(); const preference = PreferenceStore.setPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), '999'); AsyncClient.savePreferences([preference]); } createScreen() { switch (this.state.currentScreen) { case 0: return this.createScreenOne(); case 1: return this.createScreenTwo(); case 2: return this.createScreenThree(); } } createScreenOne() { const circles = this.createCircles(); return (
{inviteModalLink}