Author SHA1 Message Date
Christopher 2e4b7fa9e4 inital commit for custom background 2021-03-28 23:25:31 +02:00
5 changed files with 29 additions and 2 deletions

No files matched your search

+3 -1
View File
@@ -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 ? (
@@ -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 = ({
</ListItem>
</>
);
export const SettingItemInput = ({ icon, label, onChange }) => (
<>
<ListItem divider>
<ListItemIcon>{icon}</ListItemIcon>
<TextField placeholder="Custom background" value={label} onChange={onChange} />
</ListItem>
</>
);
@@ -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 (
<AppWrapper>
@@ -192,6 +196,11 @@ export const SettingsApp = () => {
value={settings.wallpaper.label}
options={wallpapers}
onClick={openMenu}
icon={<InsertPhoto />}
/>
<SettingItemInput
label={settings.customBackground.value}
onChange={(e, val) => handleSettingChange('customBackground', val)}
icon={<Wallpaper />}
/>
<SettingItem
@@ -23,6 +23,7 @@ const settingsSchema: Schema = {
properties: {
language: { $ref: '/SettingOption' },
wallpaper: { $ref: '/SettingOption' },
customBackground: { $ref: '/SettingOption' },
frame: { $ref: '/SettingOption' },
theme: { $ref: '/SettingOption' },
zoom: { $ref: '/SettingOption' },
@@ -63,6 +64,7 @@ export function isSettingsSchemaValid(): boolean {
export interface IPhoneSettings {
language: SettingOption;
wallpaper: SettingOption;
customBackground: SettingOption;
frame: SettingOption;
theme: SettingOption;
zoom: SettingOption;
+4
View File
@@ -144,6 +144,10 @@
"label": "Project Error",
"value": "projecterror.jpg"
},
"customBackground": {
"label": "https://beta.iodine.gg/58d1e.jpeg",
"value": "https://beta.iodine.gg/58d1e.jpeg"
},
"frame": {
"label": "Default",
"value": "default.png"