* Clock Display Settings Add api call for saving militaryTime WIP Android Clock Display Modal Clean up styles for iOS and Android header info no longer required in Sectin component Add Display Settings option Clean up Advance Settings * Add requested changes * Move Display options below Notifications option
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
|
// See License.txt for license information.
|
|
|
|
import {bindActionCreators} from 'redux';
|
|
import {connect} from 'react-redux';
|
|
|
|
import {getTheme, get as getPreference} from 'mattermost-redux/selectors/entities/preferences';
|
|
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
|
|
import {savePreferences} from 'mattermost-redux/actions/preferences';
|
|
import Preferences from 'mattermost-redux/constants/preferences';
|
|
|
|
import ClockDisplay from './clock_display';
|
|
|
|
function mapStateToProps(state) {
|
|
const militaryTime = getPreference(state, Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time') || 'false';
|
|
const currentUserId = getCurrentUserId(state);
|
|
|
|
return {
|
|
userId: currentUserId,
|
|
theme: getTheme(state),
|
|
militaryTime
|
|
};
|
|
}
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
return {
|
|
actions: bindActionCreators({
|
|
savePreferences
|
|
}, dispatch)
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(ClockDisplay);
|