Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added checkbox to enable/disable background #7630

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions static/app-strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2312,5 +2312,7 @@
"Free --[legend, unused disk space]--": "Free",
"Top content in %language%": "Top content in %language%",
"Apply": "Apply",
"24-hour clock": "24-hour clock",
"Disable background": "Disable background",
"--end--": "--end--"
}
1 change: 1 addition & 0 deletions ui/component/settingAppearance/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { makeSelectClientSetting } from 'redux/selectors/settings';
import SettingAppearance from './view';

const select = (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),
Expand Down
11 changes: 10 additions & 1 deletion ui/component/settingAppearance/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import ThemeSelector from 'component/themeSelector';
import homepages from 'homepages';

type Props = {
disableBackground: boolean,
clock24h: boolean,
searchInLanguage: boolean,
hideBalance: boolean,
Expand All @@ -20,7 +21,7 @@ type Props = {
};

export default function SettingAppearance(props: Props) {
const { clock24h, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props;
const { clock24h, disableBackground, searchInLanguage, hideBalance, setClientSetting, setSearchInLanguage } = props;

return (
<>
Expand Down Expand Up @@ -63,6 +64,14 @@ export default function SettingAppearance(props: Props) {
checked={clock24h}
/>
</SettingsRow>
<SettingsRow title={__('Disable background')}>
<FormField
type="checkbox"
name="background"
onChange={() => setClientSetting(SETTINGS.DISABLE_BACKGROUND, !disableBackground)}
checked={disableBackground}
/>
</SettingsRow>
<SettingsRow title={__('Hide wallet balance in header')}>
<FormField
type="checkbox"
Expand Down
20 changes: 8 additions & 12 deletions ui/component/wallpaper/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { connect } from 'react-redux';
// import { makeSelectCoverForUri, makeSelectAvatarForUri } from 'redux/selectors/claims';
import Wallpaper from './view';
import * as SETTINGS from 'constants/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
jessopb marked this conversation as resolved.
Show resolved Hide resolved

/*
const select = (state, props) => {
if (props.uri && (props.uri.indexOf('@') !== -1 || props.uri.indexOf('#') !== -1)) {
return {
cover: makeSelectCoverForUri(props.uri)(state),
avatar: makeSelectAvatarForUri(props.uri)(state),
};
} else return {};
};
*/
const select = (state) => ({
disableBackground: makeSelectClientSetting(SETTINGS.DISABLE_BACKGROUND)(state),
});

export default connect()(Wallpaper);
const perform = {};

export default connect(select, perform)(Wallpaper);
6 changes: 4 additions & 2 deletions ui/component/wallpaper/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ type Props = {
// cover: ?string,
// avatar: ?string,
reset: ?boolean,
disableBackground: ?boolean,
};

const Wallpaper = (props: Props) => {
// const { cover, avatar } = props;
const { disableBackground } = props;

/*
if (avatar) {
Expand Down Expand Up @@ -227,12 +228,13 @@ const Wallpaper = (props: Props) => {
}}
/>
*/

return (
<>
<div
className={'background-image'}
style={{
backgroundImage: `url(${freeezepeach})`,
backgroundImage: disableBackground ? `none` : `url(${freeezepeach})`,
}}
/>
<div className={'theme'} />
Expand Down
1 change: 1 addition & 0 deletions ui/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +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 DISABLE_BACKGROUND = 'disableBackground';
export const AUTOPLAY_MEDIA = 'autoplay';
export const AUTOPLAY_NEXT = 'autoplay_next';
export const OS_NOTIFICATIONS_ENABLED = 'os_notifications_enabled';
Expand Down
1 change: 1 addition & 0 deletions ui/redux/reducers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down