From 6b77a054c25acb0437a58107c4592ad66c830993 Mon Sep 17 00:00:00 2001 From: Saturnino Abril Date: Fri, 30 Jun 2017 23:29:14 +0800 Subject: remove font setting and default to Open Sans (#6643) --- .../user_settings/user_settings_display.jsx | 98 +--------------------- 1 file changed, 2 insertions(+), 96 deletions(-) (limited to 'webapp/components/user_settings') diff --git a/webapp/components/user_settings/user_settings_display.jsx b/webapp/components/user_settings/user_settings_display.jsx index a2132f3f7..aef82f229 100644 --- a/webapp/components/user_settings/user_settings_display.jsx +++ b/webapp/components/user_settings/user_settings_display.jsx @@ -21,7 +21,6 @@ import {FormattedMessage} from 'react-intl'; function getDisplayStateFromStores() { return { militaryTime: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'use_military_time', 'false'), - selectedFont: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', Constants.DEFAULT_FONT), channelDisplayMode: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.CHANNEL_DISPLAY_MODE, Preferences.CHANNEL_DISPLAY_MODE_DEFAULT), messageDisplay: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.MESSAGE_DISPLAY, Preferences.MESSAGE_DISPLAY_DEFAULT), collapseDisplay: PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, Preferences.COLLAPSE_DISPLAY, Preferences.COLLAPSE_DISPLAY_DEFAULT) @@ -37,7 +36,6 @@ export default class UserSettingsDisplay extends React.Component { this.handleSubmit = this.handleSubmit.bind(this); this.handleClockRadio = this.handleClockRadio.bind(this); - this.handleFont = this.handleFont.bind(this); this.updateSection = this.updateSection.bind(this); this.updateState = this.updateState.bind(this); this.createCollapseSection = this.createCollapseSection.bind(this); @@ -45,10 +43,6 @@ export default class UserSettingsDisplay extends React.Component { this.state = getDisplayStateFromStores(); } - componentWillUnmount() { - Utils.applyFont(PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', Constants.DEFAULT_FONT)); - } - handleSubmit() { const userId = UserStore.getCurrentId(); @@ -58,12 +52,7 @@ export default class UserSettingsDisplay extends React.Component { name: 'use_military_time', value: this.state.militaryTime }; - const fontPreference = { - user_id: userId, - category: Preferences.CATEGORY_DISPLAY_SETTINGS, - name: 'selected_font', - value: this.state.selectedFont - }; + const channelDisplayModePreference = { user_id: userId, category: Preferences.CATEGORY_DISPLAY_SETTINGS, @@ -83,7 +72,7 @@ export default class UserSettingsDisplay extends React.Component { value: this.state.collapseDisplay }; - savePreferences([timePreference, fontPreference, channelDisplayModePreference, messageDisplayPreference, collapseDisplayPreference], + savePreferences([timePreference, channelDisplayModePreference, messageDisplayPreference, collapseDisplayPreference], () => { this.updateSection(''); } @@ -102,11 +91,6 @@ export default class UserSettingsDisplay extends React.Component { this.setState({messageDisplay}); } - handleFont(selectedFont) { - Utils.applyFont(selectedFont); - this.setState({selectedFont}); - } - handleCollapseRadio(collapseDisplay) { this.setState({collapseDisplay}); } @@ -122,7 +106,6 @@ export default class UserSettingsDisplay extends React.Component { updateState() { const newState = getDisplayStateFromStores(); if (!Utils.areObjectsEqual(newState, this.state)) { - this.handleFont(newState.selectedFont); this.setState(newState); } } @@ -240,7 +223,6 @@ export default class UserSettingsDisplay extends React.Component { const serverError = this.state.serverError || null; let clockSection; let channelDisplayModeSection; - let fontSection; let languagesSection; let messageDisplaySection; @@ -573,80 +555,6 @@ export default class UserSettingsDisplay extends React.Component { ); } - if (this.props.activeSection === 'font') { - const options = []; - Object.keys(Constants.FONTS).forEach((fontName, idx) => { - const className = Constants.FONTS[fontName]; - options.push( - - ); - }); - - const inputs = [ -
-
- -
-
-
- -
-
- ]; - - fontSection = ( - - } - inputs={inputs} - submit={this.handleSubmit} - server_error={serverError} - updateSection={(e) => { - this.updateSection(''); - e.preventDefault(); - }} - /> - ); - } else { - fontSection = ( - - } - describe={this.state.selectedFont} - updateSection={() => { - this.props.updateSection('font'); - }} - /> - ); - } - const userLocale = this.props.user.locale; if (this.props.activeSection === 'languages') { if (!I18n.isLanguageAvailable(userLocale)) { @@ -730,8 +638,6 @@ export default class UserSettingsDisplay extends React.Component { setEnforceFocus={this.props.setEnforceFocus} />
- {fontSection} -
{clockSection}
{collapseSection} -- cgit v1.2.3-1-g7c22