mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
Make styling!!
This commit is contained in:
1 parent
0bbd463c01
commit
bc20bfac99
13 files changed
+115
-114
No files matched your search
@@ -8,7 +8,7 @@ import { atom } from "recoil";
|
||||
|
||||
const appsState = atom({
|
||||
key: 'apps',
|
||||
default: null
|
||||
default: { preinstalled: [] }
|
||||
});
|
||||
|
||||
export const useApps = () => {
|
||||
@@ -17,6 +17,7 @@ export const useApps = () => {
|
||||
useEffect(() => {
|
||||
setApps("preinstalled", [
|
||||
{
|
||||
id: 'contacts',
|
||||
name: t('APPS_CONTACTS'),
|
||||
icon: <ContactsIcon />,
|
||||
backgroundColor: blue[500],
|
||||
@@ -24,6 +25,7 @@ export const useApps = () => {
|
||||
path: '/contacts'
|
||||
},
|
||||
{
|
||||
id: 'settings',
|
||||
name: t('APPS_SETTINGS'),
|
||||
icon: <SettingsIcon />,
|
||||
backgroundColor: grey[700],
|
||||
@@ -34,5 +36,9 @@ export const useApps = () => {
|
||||
// eslint-disable-next-line
|
||||
}, []);
|
||||
|
||||
return { apps, setApps };
|
||||
const allApps = [...apps.preinstalled];
|
||||
|
||||
const getApp = id => allApps.find(a => a.id === id) || {};
|
||||
|
||||
return { apps, allApps, setApps, getApp };
|
||||
};
|
||||
@@ -1,5 +1,4 @@
|
||||
import React from "react";
|
||||
import { makeStyles } from "@material-ui/core/styles";
|
||||
import List from "@material-ui/core/List";
|
||||
import ListItem from "@material-ui/core/ListItem";
|
||||
import ListItemText from "@material-ui/core/ListItemText";
|
||||
@@ -8,31 +7,19 @@ import { Button } from "@material-ui/core";
|
||||
import PhoneIcon from "@material-ui/icons/Phone";
|
||||
import ChatIcon from "@material-ui/icons/Chat";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: "100%",
|
||||
maxWidth: 360,
|
||||
color: "#fff",
|
||||
},
|
||||
listItem: {
|
||||
color: "#fff",
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContactList = ({ contacts, onCall, onMessage }) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<List component="nav" className={classes.root}>
|
||||
<List>
|
||||
{contacts.map((contact) => (
|
||||
<ListItem divider className={classes.listItem}>
|
||||
<ListItem key={contact.id} divider>
|
||||
<ListItemText
|
||||
primary={contact.display}
|
||||
secondary={contact.phoneNumber}
|
||||
/>
|
||||
<Button className={classes.listItem} onClick={onCall}>
|
||||
<Button onClick={onCall}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button className={classes.listItem} onClick={onMessage}>
|
||||
<Button onClick={onMessage}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
|
||||
@@ -1,33 +1,27 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { makeStyles } from "@material-ui/core";
|
||||
import lightBlue from "@material-ui/core/colors/lightBlue";
|
||||
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';
|
||||
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
backgroundColor: '#232323',
|
||||
},
|
||||
title: {
|
||||
backgroundColor: lightBlue[300],
|
||||
textAlign: 'center'
|
||||
},
|
||||
}));
|
||||
import { ContactList } from "./ContactList";
|
||||
import { useApps } from "../../appmarket/hooks/useApps";
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const classes = useStyles();
|
||||
const { contactList } = useContacts();
|
||||
const { getApp } = useApps();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<AppWrapper className={classes.root}>
|
||||
<AppTitle className={classes.title}>{t("APPS_CONTACTS")}</AppTitle>
|
||||
<AppWrapper>
|
||||
<AppTitle color={getApp("contacts").backgroundColor}>
|
||||
{t("APPS_CONTACTS")}
|
||||
</AppTitle>
|
||||
<AppContent>
|
||||
<ContactList contacts={contactList} onCall={() => console.log("Calling")} onMessage={() => console.log("Opening messages")}/>
|
||||
<ContactList
|
||||
contacts={contactList}
|
||||
onCall={() => console.log("Calling")}
|
||||
onMessage={() => console.log("Opening messages")}
|
||||
/>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
|
||||
@@ -4,10 +4,12 @@ const contactListState = atom({
|
||||
key: "contactList",
|
||||
default: [
|
||||
{
|
||||
id: 0,
|
||||
display: "Test Contact",
|
||||
phoneNumber: "000-1111",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
display: "Test Contact 2",
|
||||
phoneNumber: "000-1112",
|
||||
},
|
||||
|
||||
@@ -1,31 +1,23 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { makeStyles, List, ListItem } from "@material-ui/core";
|
||||
import { List, ListItem, ListItemText } from "@material-ui/core";
|
||||
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||
import { AppContent } from "../../../ui/components/AppContent";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { grey } from "@material-ui/core/colors";
|
||||
import { useContextMenu } from "../../../ui/hooks/useContextMenu";
|
||||
import { useConfig } from "../../../config/hooks/useConfig";
|
||||
import { useSettings } from "../hooks/useSettings";
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
backgroundColor: grey[50],
|
||||
},
|
||||
title: {
|
||||
backgroundColor: grey[600],
|
||||
},
|
||||
}));
|
||||
import { useApps } from "../../appmarket/hooks/useApps";
|
||||
|
||||
export const SettingsApp = () => {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const [config] = useConfig();
|
||||
const { setSettings } = useSettings();
|
||||
const { getApp } = useApps();
|
||||
const { setSettings, settings } = useSettings();
|
||||
|
||||
const wallpaperOptions = config.wallpapers.map((w) => ({
|
||||
label: w,
|
||||
key: w,
|
||||
onClick: () => setSettings("wallpaper", w),
|
||||
}));
|
||||
|
||||
@@ -33,12 +25,12 @@ export const SettingsApp = () => {
|
||||
wallpaperOptions
|
||||
);
|
||||
return (
|
||||
<AppWrapper className={classes.root}>
|
||||
<AppTitle className={classes.title}>{t("APPS_SETTINGS")}</AppTitle>
|
||||
<AppWrapper>
|
||||
<AppTitle color={getApp("settings").backgroundColor}>{t("APPS_SETTINGS")}</AppTitle>
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List>
|
||||
<ListItem onClick={openMenu} button>
|
||||
{t("APPS_SETTINGS_OPTIONS_WALLPAPER")}
|
||||
<ListItemText primary={t("APPS_SETTINGS_OPTIONS_WALLPAPER")} secondary={settings.wallpaper} />
|
||||
</ListItem>
|
||||
</List>
|
||||
</AppContent>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"wallpaper": "default.png",
|
||||
"frame": "default.png"
|
||||
"frame": "default.png",
|
||||
"theme": "default-dark"
|
||||
}
|
||||
Reference in new issue
Block a user