2018-04-30 13:31:29 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
2018-03-27 09:49:57 -04:00
|
|
|
import {connect} from 'react-redux';
|
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
|
|
|
|
2018-10-08 11:24:07 -04:00
|
|
|
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
|
|
|
|
|
import {getInt} from 'mattermost-redux/selectors/entities/preferences';
|
2019-02-06 17:20:07 +06:00
|
|
|
import {savePreferences} from 'mattermost-redux/actions/preferences';
|
2018-10-08 11:24:07 -04:00
|
|
|
|
2018-03-27 09:49:57 -04:00
|
|
|
import {closeMenu as closeRhsMenu} from 'actions/views/rhs';
|
2018-10-08 11:24:07 -04:00
|
|
|
import {Preferences} from 'utils/constants.jsx';
|
2018-03-27 09:49:57 -04:00
|
|
|
|
|
|
|
|
import TutorialTip from './tutorial_tip.jsx';
|
|
|
|
|
|
2018-10-08 11:24:07 -04:00
|
|
|
function mapStateToProps(state) {
|
|
|
|
|
const currentUserId = getCurrentUserId(state);
|
|
|
|
|
return {
|
|
|
|
|
currentUserId,
|
|
|
|
|
step: getInt(state, Preferences.TUTORIAL_STEP, currentUserId, 0),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-27 09:49:57 -04:00
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
|
return {
|
|
|
|
|
actions: bindActionCreators({
|
|
|
|
|
closeRhsMenu,
|
2019-02-06 17:20:07 +06:00
|
|
|
savePreferences,
|
2018-03-27 09:49:57 -04:00
|
|
|
}, dispatch),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2018-10-08 11:24:07 -04:00
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(TutorialTip);
|