mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Tweak(Apps): Change of file names
This commit is contained in:
1 parent
693b3a00f8
commit
279fa0407a
3 files changed
+122
No files matched your search
@@ -0,0 +1,28 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { AppWrapper } from "../../../ui/components";
|
||||||
|
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||||
|
import { AppContent } from "../../../ui/components/AppContent";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useContacts } from "../hooks/useContacts";
|
||||||
|
import { ContactList } from "./ContactList";
|
||||||
|
import { useApps } from "../../appmarket/hooks/useApps";
|
||||||
|
|
||||||
|
export const ContactsApp = () => {
|
||||||
|
const { contactList } = useContacts();
|
||||||
|
const { getApp } = useApps();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<AppWrapper>
|
||||||
|
<AppTitle color={getApp("contacts").backgroundColor}>
|
||||||
|
{t("APPS_CONTACTS")}
|
||||||
|
</AppTitle>
|
||||||
|
<AppContent>
|
||||||
|
<ContactList
|
||||||
|
contacts={contactList}
|
||||||
|
onCall={(contact => console.log(contact))}
|
||||||
|
onMessage={() => console.log("Opening messages")}
|
||||||
|
/>
|
||||||
|
</AppContent>
|
||||||
|
</AppWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { AppWrapper } from "../../../ui/components";
|
||||||
|
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||||
|
import { AppContent } from "../../../ui/components/AppContent";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useApps } from "../../appmarket/hooks/useApps";
|
||||||
|
|
||||||
|
export const PhoneApp = () => {
|
||||||
|
const { getApp } = useApps();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<AppWrapper>
|
||||||
|
<AppTitle color={getApp("phone").backgroundColor}>
|
||||||
|
{t("APPS_PHONE")}
|
||||||
|
</AppTitle>
|
||||||
|
<AppContent>
|
||||||
|
|
||||||
|
</AppContent>
|
||||||
|
</AppWrapper>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { AppWrapper } from "../../../ui/components";
|
||||||
|
import { List, ListItem, ListItemText, Divider } from "@material-ui/core";
|
||||||
|
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||||
|
import { AppContent } from "../../../ui/components/AppContent";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import {
|
||||||
|
useContextMenu,
|
||||||
|
MapStringOptions,
|
||||||
|
} from "../../../ui/hooks/useContextMenu";
|
||||||
|
import { useConfig } from "../../../config/hooks/useConfig";
|
||||||
|
import { useSettings } from "../hooks/useSettings";
|
||||||
|
import { useApps } from "../../appmarket/hooks/useApps";
|
||||||
|
|
||||||
|
export const SettingItem = ({ options, label, value, onClick }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ListItem onClick={() => onClick(options)} button>
|
||||||
|
<ListItemText primary={label} secondary={value} />
|
||||||
|
</ListItem>
|
||||||
|
<Divider />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SettingsApp = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [config] = useConfig();
|
||||||
|
const { getApp } = useApps();
|
||||||
|
const { setSettings, settings } = useSettings();
|
||||||
|
|
||||||
|
const wallpapers = config.wallpapers.map(
|
||||||
|
MapStringOptions(settings.wallpaper, (val) => setSettings("wallpaper", val))
|
||||||
|
);
|
||||||
|
const frames = config.frames.map(
|
||||||
|
MapStringOptions(settings.frame, (val) => setSettings("frame", val))
|
||||||
|
);
|
||||||
|
const themes = Object.keys(config.themes).map(
|
||||||
|
MapStringOptions(settings.theme, (val) => setSettings("theme", val))
|
||||||
|
);
|
||||||
|
|
||||||
|
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||||
|
return (
|
||||||
|
<AppWrapper>
|
||||||
|
<AppTitle color={getApp("settings").backgroundColor}>
|
||||||
|
{t("APPS_SETTINGS")}
|
||||||
|
</AppTitle>
|
||||||
|
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||||
|
<List>
|
||||||
|
<SettingItem
|
||||||
|
label="Theme"
|
||||||
|
value={settings.theme}
|
||||||
|
options={themes}
|
||||||
|
onClick={openMenu}
|
||||||
|
/>
|
||||||
|
<SettingItem
|
||||||
|
label="Wallpaper"
|
||||||
|
value={settings.wallpaper}
|
||||||
|
options={wallpapers}
|
||||||
|
onClick={openMenu}
|
||||||
|
/>
|
||||||
|
<SettingItem
|
||||||
|
label="Frame"
|
||||||
|
value={settings.frame}
|
||||||
|
options={frames}
|
||||||
|
onClick={openMenu}
|
||||||
|
/>
|
||||||
|
</List>
|
||||||
|
</AppContent>
|
||||||
|
<ContextMenu />
|
||||||
|
</AppWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
Reference in new issue
Block a user