From 0e801a4e70f3d9c8e3cf929aa2f7ac201ca87b52 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Wed, 28 Oct 2015 15:04:17 -0400 Subject: Add tutorial intro screens for new users. --- .../components/tutorial/tutorial_intro_screens.jsx | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 web/react/components/tutorial/tutorial_intro_screens.jsx (limited to 'web/react/components/tutorial/tutorial_intro_screens.jsx') diff --git a/web/react/components/tutorial/tutorial_intro_screens.jsx b/web/react/components/tutorial/tutorial_intro_screens.jsx new file mode 100644 index 000000000..d7568e4cd --- /dev/null +++ b/web/react/components/tutorial/tutorial_intro_screens.jsx @@ -0,0 +1,150 @@ +// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +const UserStore = require('../../stores/user_store.jsx'); +const ChannelStore = require('../../stores/channel_store.jsx'); +const TeamStore = require('../../stores/team_store.jsx'); +const PreferenceStore = require('../../stores/preference_store.jsx'); +const Utils = require('../../utils/utils.jsx'); +const AsyncClient = require('../../utils/async_client.jsx'); + +const Constants = require('../../utils/constants.jsx'); +const Preferences = Constants.Preferences; + +export default class TutorialIntroScreens extends React.Component { + constructor(props) { + super(props); + + this.handleNext = this.handleNext.bind(this); + this.createScreen = this.createScreen.bind(this); + + this.state = {screen: 0}; + } + handleNext() { + if (this.state.screen < 2) { + this.setState({screen: this.state.screen + 1}); + return; + } + + Utils.switchChannel(ChannelStore.getByName(Constants.DEFAULT_CHANNEL)); + + const preference = PreferenceStore.setPreference(Preferences.TUTORIAL_INTRO_COMPLETE, UserStore.getCurrentId(), 'true'); + AsyncClient.savePreferences([preference]); + } + createScreen() { + switch (this.state.screen) { + case 0: + return this.createScreenOne(); + case 1: + return this.createScreenTwo(); + case 2: + return this.createScreenThree(); + } + } + createScreenOne() { + return ( +
+

{'Welcome to:'}

+

{'Mattermost'}

+
+ {'Your team communications all in one place,'} +
+ {'instantly searchable and available anywhere.'} +

+ {'Keep your team connected to help them'} +
+ {'achieve what matters most.'} +

+ {'[ x ][ ][ ]'} +
+ ); + } + createScreenTwo() { + return ( +
+

{'How Mattermost works:'}

+
+ {'Communication happens in public discussion channels,'} +
+ {'private groups and direct messages.'} +

+ {'Everything is archived and searchable from'} +
+ {'any web-enabled laptop, tablet or phone.'} +

+ {'[ ][ x ][ ]'} +
+ ); + } + createScreenThree() { + const team = TeamStore.getCurrent(); + let inviteModalLink; + if (team.type === Constants.INVITE_TEAM) { + inviteModalLink = ( + + {'Invite teammates'} + + ); + } else { + inviteModalLink = ( + + ); + } + + return ( +
+

{'You’re all set'}

+
+ {inviteModalLink} + {' when you’re ready.'} +

+ {'Need anything, just email us at '} +
+ {'feedback@mattermost.com.'} + +

+ {'Click “Next” to enter Town Square. This is the first channel'} +
+ {'teammates see when they sign up - use it for posting updates'} +
+ {'everyone needs to know.'} +

+ {'[ ][ ][ x ]'} +
+ ); + } + render() { + const screen = this.createScreen(); + + return ( +
+ {screen} +

+ +
+ ); + } +} -- cgit v1.2.3-1-g7c22