From b77ae9b0eaf3914ac3159f214dfd58d06d436836 Mon Sep 17 00:00:00 2001 From: ByronEricPerez Date: Tue, 28 Jun 2022 16:41:44 -0300 Subject: [PATCH] rename background setting to be disable backgroud; add default value for background setting. --- static/app-strings.json | 1 - ui/component/settingAppearance/index.js | 2 +- ui/component/settingAppearance/view.jsx | 8 ++++---- ui/component/wallpaper/index.js | 2 +- ui/component/wallpaper/view.jsx | 6 +++--- ui/constants/settings.js | 2 +- ui/redux/reducers/settings.js | 1 + 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/static/app-strings.json b/static/app-strings.json index 7fa95843d..61bdbd0bd 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -2313,7 +2313,6 @@ "Top content in %language%": "Top content in %language%", "Apply": "Apply", "24-hour clock": "24-hour clock", - "background": "background", "Disable background": "Disable background", "--end--": "--end--" } diff --git a/ui/component/settingAppearance/index.js b/ui/component/settingAppearance/index.js index 40b79f685..7b3f9c2fa 100644 --- a/ui/component/settingAppearance/index.js +++ b/ui/component/settingAppearance/index.js @@ -5,7 +5,7 @@ import { makeSelectClientSetting } from 'redux/selectors/settings'; import SettingAppearance from './view'; const select = (state) => ({ - background: makeSelectClientSetting(SETTINGS.BACKGROUND)(state), + disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state), clock24h: makeSelectClientSetting(SETTINGS.CLOCK_24H)(state), searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state), hideBalance: makeSelectClientSetting(SETTINGS.HIDE_BALANCE)(state), diff --git a/ui/component/settingAppearance/view.jsx b/ui/component/settingAppearance/view.jsx index 634f74a87..2065a5c7e 100644 --- a/ui/component/settingAppearance/view.jsx +++ b/ui/component/settingAppearance/view.jsx @@ -12,7 +12,7 @@ import ThemeSelector from 'component/themeSelector'; import homepages from 'homepages'; type Props = { - background: boolean, + disableBackground: boolean, clock24h: boolean, searchInLanguage: boolean, hideBalance: boolean, @@ -21,7 +21,7 @@ type Props = { }; export default function SettingAppearance(props: Props) { - const { clock24h, background, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props; + const { clock24h, disableBackground, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props; return ( <> @@ -68,8 +68,8 @@ export default function SettingAppearance(props: Props) { setClientSetting(SETTINGS.BACKGROUND, !background)} - checked={background} + onChange={() => setClientSetting(SETTINGS.DISABLE_BACKGROUND, !disableBackground)} + checked={disableBackground} /> diff --git a/ui/component/wallpaper/index.js b/ui/component/wallpaper/index.js index 5a13e32f7..2df615c90 100644 --- a/ui/component/wallpaper/index.js +++ b/ui/component/wallpaper/index.js @@ -4,7 +4,7 @@ import * as SETTINGS from 'constants/settings'; import { makeSelectClientSetting } from 'redux/selectors/settings'; const select = (state) => ({ - background: makeSelectClientSetting(SETTINGS.BACKGROUND)(state), + disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state), }); const perform = {}; diff --git a/ui/component/wallpaper/view.jsx b/ui/component/wallpaper/view.jsx index 11ef316ba..8fd610165 100644 --- a/ui/component/wallpaper/view.jsx +++ b/ui/component/wallpaper/view.jsx @@ -8,11 +8,11 @@ type Props = { // cover: ?string, // avatar: ?string, reset: ?boolean, - background: ?boolean, + disableBackground: ?boolean, }; const Wallpaper = (props: Props) => { - const { background } = props; + const { disableBackground } = props; /* if (avatar) { @@ -234,7 +234,7 @@ const Wallpaper = (props: Props) => {
diff --git a/ui/constants/settings.js b/ui/constants/settings.js index 8b8bfb713..9121f71bc 100644 --- a/ui/constants/settings.js +++ b/ui/constants/settings.js @@ -14,7 +14,7 @@ export const THEME = 'theme'; export const THEMES = 'themes'; export const AUTOMATIC_DARK_MODE_ENABLED = 'automatic_dark_mode_enabled'; export const CLOCK_24H = 'clock_24h'; -export const BACKGROUND = 'background'; +export const DISABLE_BACKGROUND = 'disableBackground'; export const AUTOPLAY_MEDIA = 'autoplay'; export const AUTOPLAY_NEXT = 'autoplay_next'; export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled'; diff --git a/ui/redux/reducers/settings.js b/ui/redux/reducers/settings.js index 36e6250db..f82faf6f6 100644 --- a/ui/redux/reducers/settings.js +++ b/ui/redux/reducers/settings.js @@ -40,6 +40,7 @@ const defaultState = { [SETTINGS.OS_NOTIFICATIONS_ENABLED]: true, [SETTINGS.AUTOMATIC_DARK_MODE_ENABLED]: false, [SETTINGS.CLOCK_24H]: false, + [SETTINGS.DISABLE_BACKGROUND]: false, [SETTINGS.TILE_LAYOUT]: true, [SETTINGS.VIDEO_THEATER_MODE]: false, [SETTINGS.VIDEO_PLAYBACK_RATE]: 1,