mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(phone/settings): custom background
This commit is contained in:
1 parent
ee7e3a3ae1
commit
4d46566811
7 files changed
+149
-4
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
SettingItemIconAction,
|
||||
SettingItemSlider,
|
||||
SettingSwitch,
|
||||
SettingItemModal,
|
||||
} from './SettingItem';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
||||
@@ -28,12 +29,13 @@ import {
|
||||
Book,
|
||||
DeleteForever,
|
||||
} from '@material-ui/icons';
|
||||
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { ListSubheader } from '@material-ui/core';
|
||||
import { useResetSettings, useSettings } from '../hooks/useSettings';
|
||||
import { useCustomWallpaperModal, useResetSettings, useSettings } from '../hooks/useSettings';
|
||||
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { IContextMenuOption } from '../../../ui/components/ContextMenu';
|
||||
import WallpaperModal from './WallpaperModal';
|
||||
|
||||
const SubHeaderComp = (props: { text: string }) => (
|
||||
<ListSubheader color="primary" component="div" disableSticky>
|
||||
@@ -41,12 +43,26 @@ const SubHeaderComp = (props: { text: string }) => (
|
||||
</ListSubheader>
|
||||
);
|
||||
|
||||
const useStyles = makeStyles({
|
||||
backgroundModal: {
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 5,
|
||||
},
|
||||
});
|
||||
|
||||
export const SettingsApp = () => {
|
||||
const settingsApp = useApp('SETTINGS');
|
||||
const [config] = useConfig();
|
||||
const simcard = useSimcard();
|
||||
const [settings, setSettings] = useSettings();
|
||||
const { t } = useTranslation();
|
||||
const { customWallpaperModal, setCustomWallpaperModal } = useCustomWallpaperModal();
|
||||
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
@@ -123,9 +139,12 @@ export const SettingsApp = () => {
|
||||
};
|
||||
|
||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<AppWrapper>
|
||||
<AppTitle app={settingsApp} />
|
||||
<WallpaperModal />
|
||||
<div className={customWallpaperModal ? classes.backgroundModal : undefined} />
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.PHONE')} />}>
|
||||
<SettingItemIconAction
|
||||
@@ -194,6 +213,13 @@ export const SettingsApp = () => {
|
||||
onClick={openMenu}
|
||||
icon={<Wallpaper />}
|
||||
/>
|
||||
{/* CUSTOM BACKGROUND */}
|
||||
<SettingItemModal
|
||||
icon={<Wallpaper />}
|
||||
label={t('APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER')}
|
||||
secondary={settings.customWallpaper}
|
||||
onClick={() => setCustomWallpaperModal(true)}
|
||||
/>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_FRAME')}
|
||||
value={settings.frame.label}
|
||||
|
||||
Reference in new issue
Block a user