Этот коммит содержится в:
JoramWilander
2015-11-02 15:10:46 -05:00
родитель 95da412571
Коммит 35b11e0e61
5 изменённых файлов: 47 добавлений и 18 удалений

Просмотреть файл

@@ -1,17 +1,47 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
var CreatePost = require('../components/create_post.jsx'); const TutorialIntroScreens = require('./tutorial/tutorial_intro_screens.jsx');
var PostsViewContainer = require('../components/posts_view_container.jsx'); const CreatePost = require('./create_post.jsx');
var ChannelHeader = require('../components/channel_header.jsx'); const PostsViewContainer = require('./posts_view_container.jsx');
var Navbar = require('../components/navbar.jsx'); const ChannelHeader = require('./channel_header.jsx');
var FileUploadOverlay = require('../components/file_upload_overlay.jsx'); const Navbar = require('./navbar.jsx');
const FileUploadOverlay = require('./file_upload_overlay.jsx');
const PreferenceStore = require('../stores/preference_store.jsx');
const UserStore = require('../stores/user_store.jsx');
const Constants = require('../utils/constants.jsx');
const TutorialSteps = Constants.TutorialSteps;
const Preferences = Constants.Preferences;
export default class CenterPanel extends React.Component { export default class CenterPanel extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.onPreferenceChange = this.onPreferenceChange.bind(this);
const tutorialPref = PreferenceStore.getPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), {value: '0'});
this.state = {showTutorialScreens: parseInt(tutorialPref.value, 10) === TutorialSteps.INTRO_SCREENS};
}
componentDidMount() {
PreferenceStore.addChangeListener(this.onPreferenceChange);
}
componentWillUnmount() {
PreferenceStore.removeChangeListener(this.onPreferenceChange);
}
onPreferenceChange() {
const tutorialPref = PreferenceStore.getPreference(Preferences.TUTORIAL_STEP, UserStore.getCurrentId(), {value: '0'});
this.setState({showTutorialScreens: parseInt(tutorialPref.value, 10) <= TutorialSteps.INTRO_SCREENS});
} }
render() { render() {
let postsContainer
if (this.state.showTutorialScreens) {
postsContainer = <TutorialIntroScreens />;
} else {
postsContainer = <PostsViewContainer />;
}
return ( return (
<div className='inner__wrap channel__wrap'> <div className='inner__wrap channel__wrap'>
<div className='row header'> <div className='row header'>
@@ -32,7 +62,7 @@ export default class CenterPanel extends React.Component {
<ChannelHeader /> <ChannelHeader />
</div> </div>
<div id='post-list'> <div id='post-list'>
<PostsViewContainer /> {postsContainer}
</div> </div>
<div <div
className='post-create__container' className='post-create__container'

Просмотреть файл

@@ -1,10 +1,10 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
var CenterPanel = require('../components/center_panel.jsx'); const CenterPanel = require('../components/center_panel.jsx');
var Sidebar = require('../components/sidebar.jsx'); const Sidebar = require('../components/sidebar.jsx');
var SidebarRight = require('../components/sidebar_right.jsx'); const SidebarRight = require('../components/sidebar_right.jsx');
var SidebarRightMenu = require('../components/sidebar_right_menu.jsx'); const SidebarRightMenu = require('../components/sidebar_right_menu.jsx');
export default class ChannelView extends React.Component { export default class ChannelView extends React.Component {
constructor(props) { constructor(props) {

Просмотреть файл

@@ -2,15 +2,18 @@
// See License.txt for license information. // See License.txt for license information.
const PostsView = require('./posts_view.jsx'); const PostsView = require('./posts_view.jsx');
const LoadingScreen = require('./loading_screen.jsx');
const ChannelStore = require('../stores/channel_store.jsx'); const ChannelStore = require('../stores/channel_store.jsx');
const PostStore = require('../stores/post_store.jsx'); const PostStore = require('../stores/post_store.jsx');
const Constants = require('../utils/constants.jsx');
const ActionTypes = Constants.ActionTypes;
const Utils = require('../utils/utils.jsx'); const Utils = require('../utils/utils.jsx');
const Client = require('../utils/client.jsx'); const Client = require('../utils/client.jsx');
const AppDispatcher = require('../dispatcher/app_dispatcher.jsx'); const AppDispatcher = require('../dispatcher/app_dispatcher.jsx');
const AsyncClient = require('../utils/async_client.jsx'); const AsyncClient = require('../utils/async_client.jsx');
const LoadingScreen = require('./loading_screen.jsx');
const Constants = require('../utils/constants.jsx');
const ActionTypes = Constants.ActionTypes;
import {createChannelIntroMessage} from '../utils/channel_intro_mssages.jsx'; import {createChannelIntroMessage} from '../utils/channel_intro_mssages.jsx';

Просмотреть файл

@@ -57,7 +57,7 @@ export default class SidebarHeader extends React.Component {
<strong>{'Invite New Members'}</strong> <strong>{'Invite New Members'}</strong>
{', access your '} {', access your '}
<strong>{'Account Settings'}</strong> <strong>{'Account Settings'}</strong>
{', and set your '}<strong>{'Theme Color'}</strong>{'.'} {' and set your '}<strong>{'Theme Color'}</strong>{'.'}
</p> </p>
<p> <p>
{'Team administrators can also access their '}<strong>{'Team Settings'}</strong>{' from this menu.'} {'Team administrators can also access their '}<strong>{'Team Settings'}</strong>{' from this menu.'}

Просмотреть файл

@@ -20,10 +20,6 @@ export default class TutorialIntroScreens extends React.Component {
this.state = {currentScreen: 0}; this.state = {currentScreen: 0};
} }
componentDidMount() {
const height = $(window).outerHeight() - 120;
$('.tutorial-steps__container').css('height', `${height}px`);
}
handleNext() { handleNext() {
if (this.state.currentScreen < 2) { if (this.state.currentScreen < 2) {
this.setState({currentScreen: this.state.currentScreen + 1}); this.setState({currentScreen: this.state.currentScreen + 1});