2016-03-24 20:04:40 -04:00
|
|
|
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See License.txt for license information.
|
|
|
|
|
|
|
|
|
|
import TutorialIntroScreens from './tutorial_intro_screens.jsx';
|
|
|
|
|
|
2016-04-01 09:11:27 -04:00
|
|
|
import ChannelStore from 'stores/channel_store.jsx';
|
|
|
|
|
import Constants from 'utils/constants.jsx';
|
|
|
|
|
|
2016-04-22 14:52:44 -04:00
|
|
|
import $ from 'jquery';
|
2016-04-01 09:11:27 -04:00
|
|
|
import React from 'react';
|
|
|
|
|
|
2016-03-24 20:04:40 -04:00
|
|
|
export default class TutorialView extends React.Component {
|
2016-04-01 09:11:27 -04:00
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
|
|
this.handleChannelChange = this.handleChannelChange.bind(this);
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
|
townSquare: ChannelStore.getByName(Constants.DEFAULT_CHANNEL)
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
ChannelStore.addChangeListener(this.handleChannelChange);
|
2016-04-22 14:52:44 -04:00
|
|
|
|
|
|
|
|
$('body').addClass('app__body');
|
2016-04-01 09:11:27 -04:00
|
|
|
}
|
|
|
|
|
componentWillUnmount() {
|
|
|
|
|
ChannelStore.removeChangeListener(this.handleChannelChange);
|
2016-04-22 14:52:44 -04:00
|
|
|
|
|
|
|
|
$('body').removeClass('app__body');
|
2016-04-01 09:11:27 -04:00
|
|
|
}
|
|
|
|
|
handleChannelChange() {
|
|
|
|
|
this.setState({
|
|
|
|
|
townSquare: ChannelStore.getByName(Constants.DEFAULT_CHANNEL)
|
|
|
|
|
});
|
|
|
|
|
}
|
2016-03-24 20:04:40 -04:00
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div
|
|
|
|
|
id='app-content'
|
|
|
|
|
className='app__content'
|
|
|
|
|
>
|
2016-04-01 09:11:27 -04:00
|
|
|
<TutorialIntroScreens
|
|
|
|
|
townSquare={this.state.townSquare}
|
|
|
|
|
/>
|
2016-03-24 20:04:40 -04:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|