diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index bbedc87..9be5595 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -104,7 +104,9 @@ function Phone() { id="phone" className="PhoneScreen" style={{ - backgroundImage: `url(media/backgrounds/${settings.wallpaper.value})`, + backgroundImage: settings.customBackground.value + ? `url(${settings.customBackground.value})` + : `url(media/backgrounds/${settings.wallpaper.value})`, }} > {isPhoneReady ? ( diff --git a/phone/src/apps/settings/components/SettingItem.tsx b/phone/src/apps/settings/components/SettingItem.tsx index a6dff73..ee3680b 100644 --- a/phone/src/apps/settings/components/SettingItem.tsx +++ b/phone/src/apps/settings/components/SettingItem.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useState } from 'react'; import { ListItem, ListItemText, @@ -10,6 +10,7 @@ import { Tooltip, Typography, Switch, + TextField, } from '@material-ui/core'; interface ISettingItem { @@ -106,3 +107,12 @@ export const SettingItemIconAction = ({ ); + +export const SettingItemInput = ({ icon, label, onChange }) => ( + <> + + {icon} + + + +); diff --git a/phone/src/apps/settings/components/SettingsApp.tsx b/phone/src/apps/settings/components/SettingsApp.tsx index 0b27fac..5551be9 100644 --- a/phone/src/apps/settings/components/SettingsApp.tsx +++ b/phone/src/apps/settings/components/SettingsApp.tsx @@ -12,6 +12,7 @@ import { SettingItemIconAction, SettingItemSlider, SettingSwitch, + SettingItemInput, } from './SettingItem'; import { useTranslation } from 'react-i18next'; import VisibilityOffIcon from '@material-ui/icons/VisibilityOff'; @@ -27,6 +28,7 @@ import { FileCopy, Book, DeleteForever, + InsertPhoto, } from '@material-ui/icons'; import { ListSubheader } from '@material-ui/core'; @@ -122,6 +124,8 @@ export const SettingsApp = () => { }); }; + const setCustomBackground = () => {}; + const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu(); return ( @@ -192,6 +196,11 @@ export const SettingsApp = () => { value={settings.wallpaper.label} options={wallpapers} onClick={openMenu} + icon={} + /> + handleSettingChange('customBackground', val)} icon={} />