tweak(phone/settings): simplify some things

This commit is contained in:
Christopher committed 2021-03-31 05:05:55 +02:00
1 parent c0cca9ceb8
commit 4c73f66ab5
4 files changed
+11 -13

No files matched your search

+2 -2
View File
@@ -105,8 +105,8 @@ function Phone() {
className="PhoneScreen"
style={{
backgroundImage:
settings.wallpaper.label === 'Custom Wallpaper'
? `url(${settings.customWallpaper})`
settings.wallpaper.label === t('APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER')
? `url(${settings.wallpaper.value})`
: `url(media/backgrounds/${settings.wallpaper.value})`,
}}
>
@@ -12,8 +12,6 @@ import {
Switch,
TextField,
} from '@material-ui/core';
import CreateIcon from '@material-ui/icons/Create';
import { PictureThumbnail } from '../../../ui/components/PictureThumbnail';
interface ISettingItem {
options?: any;
@@ -73,10 +73,7 @@ export const SettingsApp = () => {
const wallpapers = config.wallpapers.map(
MapSettingItem(settings.wallpaper, (val: SettingOption) => {
if (val.label === 'Custom Wallpaper') {
setCustomWallpaperModal(true);
}
return handleSettingChange('wallpaper', val);
handleSettingChange('wallpaper', val);
}),
);
const frames = config.frames.map(
@@ -130,6 +127,13 @@ export const SettingsApp = () => {
},
];
const customWallpaper: IContextMenuOption = {
selected: false,
onClick: () => setCustomWallpaperModal(true),
key: 'CUSTOM_WALLPAPER',
label: t('APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER'),
};
const handleCopyPhoneNumber = () => {
setClipboard(simcard.number);
addAlert({
@@ -211,7 +215,7 @@ export const SettingsApp = () => {
<SettingItem
label={t('APPS_SETTINGS_OPTION_WALLPAPER')}
value={settings.wallpaper.label}
options={wallpapers}
options={[...wallpapers, customWallpaper]}
onClick={openMenu}
icon={<Wallpaper />}
/>
-4
View File
@@ -17,10 +17,6 @@
{
"label": "Project Error",
"value": "projecterror.jpg"
},
{
"label": "Custom Wallpaper",
"value": ""
}
],
"frames": [