From 3cdbf4860dcbb104ef760eaf0c39133e9ccad9c2 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:28:51 +0200 Subject: [PATCH 01/16] Tweak(Contacts): New interface property --- phone/src/apps/contacts/hooks/useContacts.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/phone/src/apps/contacts/hooks/useContacts.ts b/phone/src/apps/contacts/hooks/useContacts.ts index 6cddeda..16f8117 100644 --- a/phone/src/apps/contacts/hooks/useContacts.ts +++ b/phone/src/apps/contacts/hooks/useContacts.ts @@ -5,6 +5,7 @@ interface Contact { id: string; display: string; number: string; + img?: string } interface IUseContacts { From 280a34f785993409f97f9bcfb59cc5d674436818 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:29:19 +0200 Subject: [PATCH 02/16] Tweak(Contacts): New layout for modal --- .../apps/contacts/components/ContactModal.tsx | 110 +++++++++++------- 1 file changed, 71 insertions(+), 39 deletions(-) diff --git a/phone/src/apps/contacts/components/ContactModal.tsx b/phone/src/apps/contacts/components/ContactModal.tsx index d115adb..506ee2c 100644 --- a/phone/src/apps/contacts/components/ContactModal.tsx +++ b/phone/src/apps/contacts/components/ContactModal.tsx @@ -1,11 +1,15 @@ import React, { useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import { Button, TextField, Paper } from "@material-ui/core"; +import { makeStyles, Theme } from "@material-ui/core/styles"; +import { Button, TextField } from "@material-ui/core"; import Nui from "../../../os/nui-events/utils/Nui"; import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; +import Modal from '../../../ui/components/Modal'; +import { useModal } from '../hooks/useModal'; -const useStyles = makeStyles((theme) => ({ +import '../components/Contact.css' + +const useStyles = makeStyles((theme: Theme) => ({ button: { margin: 5, marginTop: 20, @@ -18,23 +22,33 @@ const useStyles = makeStyles((theme) => ({ marginLeft: "-4em", height: "20%", }, - - displayBlock: { - /*Sets modal to center*/ - display: "flex", - justifyContent: "center", - alignItems: "center", + textInputField: { + fontSize: 20, + borderBottomColor: 'red' }, - displayNone: { - display: "none", + addBtn: { + margin: 'auto', + width: 150, + background: "#2196f3", + marginBottom: 10, + padding: 8 }, + cancelBtn: { + margin: 'auto', + width: 150, + background: "#232323", + marginBottom: 20, + padding: 8 + } })); -export const AddContactModal = ({ handleClose, show }) => { +export const AddContactModal = () => { const [name, setName] = useState(""); const [number, setNumber] = useState(""); + const [avatar, setAvatar] = useState(""); const classes = useStyles(); - const showHideClassName = show ? classes.displayBlock : classes.displayNone; + + const { showModal, setShowModal } = useModal(); const addContact = () => { if (name === "" || number === "") { @@ -43,37 +57,55 @@ export const AddContactModal = ({ handleClose, show }) => { Nui.send("contacts:add", { name, number, + avatar }); - console.log(name, number); + console.log(name, number, avatar); } }; + const _handleClose = () => { + setShowModal(false) + } + return ( -
- - - - setName(e.target.value)} - style={{ fontSize: "18px" }} - fullWidth - placeholder="Name" - /> - - - setNumber(e.target.value)} - fullWidth - placeholder="Number" - type="number" - /> - + + + + setName(e.target.value)} + style={{ fontSize: "18px" }} + fullWidth + variant="outlined" + placeholder="Name" + /> + + + setNumber(e.target.value)} + fullWidth + placeholder="Number" + variant="outlined" + type="number" + /> + + + setAvatar(e.target.value)} + fullWidth + placeholder="Picture link" + variant="standard" + type="text" + /> + - - - -
+ + + ); }; From 0f6b8ba0dc2437df32c86cab40bfcdd3b012a582 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:30:14 +0200 Subject: [PATCH 03/16] Feat(Contacts): Added MuiAvatar for list --- .../apps/contacts/components/ContactList.tsx | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 phone/src/apps/contacts/components/ContactList.tsx diff --git a/phone/src/apps/contacts/components/ContactList.tsx b/phone/src/apps/contacts/components/ContactList.tsx deleted file mode 100644 index 73aa274..0000000 --- a/phone/src/apps/contacts/components/ContactList.tsx +++ /dev/null @@ -1,46 +0,0 @@ -import React from "react"; -import ListItemText from "@material-ui/core/ListItemText"; -import { Button } from "@material-ui/core"; - -import PhoneIcon from "@material-ui/icons/Phone"; -import ChatIcon from "@material-ui/icons/Chat"; -import DeleteIcon from "@material-ui/icons/Delete"; -import { List } from "../../../ui/components/List"; -import { ListItem } from "../../../ui/components/ListItem"; -import { useContacts } from "../hooks/useContacts"; - -import Nui from "../../../os/nui-events/utils/Nui"; - -export const ContactList = () => { - const contacts = useContacts(); - - const startCall = (number) => { - console.log(number); - Nui.send("phone:startCall", { - number, - }); - }; - - return ( - - {contacts.contacts.map((contact) => ( - - - - - - - ))} - - ); -}; From f81a1fa667bb2d6177317a18a471cdf78fe37f2b Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:30:59 +0200 Subject: [PATCH 04/16] Feat(Contacts): Added MuiAvatar for list - in new directoryt --- .../contacts/components/List/ContactList.tsx | 64 ++++++++++++++ .../components/List/SearchContacts.tsx | 83 +++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 phone/src/apps/contacts/components/List/ContactList.tsx create mode 100644 phone/src/apps/contacts/components/List/SearchContacts.tsx diff --git a/phone/src/apps/contacts/components/List/ContactList.tsx b/phone/src/apps/contacts/components/List/ContactList.tsx new file mode 100644 index 0000000..b968b86 --- /dev/null +++ b/phone/src/apps/contacts/components/List/ContactList.tsx @@ -0,0 +1,64 @@ +import React from "react"; +import ListItemText from "@material-ui/core/ListItemText"; +import { + Button, + ListItemAvatar, + Avatar as MuiAvatar +} from "@material-ui/core"; + +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faPen } from "@fortawesome/free-solid-svg-icons"; + +import { useFilteredContacts } from '../../hooks/useFilteredContacts'; + +import PhoneIcon from "@material-ui/icons/Phone"; +import ChatIcon from "@material-ui/icons/Chat"; +import { List } from "../../../../ui/components/List"; +import { ListItem } from "../../../../ui/components/ListItem"; +import { useContacts } from "../../hooks/useContacts"; + +import Nui from "../../../../os/nui-events/utils/Nui"; + +export const ContactList = () => { + + const { filteredContacts } = useFilteredContacts(); + + const contacts = useContacts(); + + const startCall = (number) => { + console.log(number); + Nui.send("phone:startCall", { + number, + }); + }; + + return ( + + {contacts.contacts.filter(contact => contact.display.includes(filteredContacts) || contact.number.includes(filteredContacts)).map((contact) => ( + + + {contact.img ? ( + + ): ( + {contact.display.slice(0, 1)} + )} + + + + + + + ))} + + ); +}; diff --git a/phone/src/apps/contacts/components/List/SearchContacts.tsx b/phone/src/apps/contacts/components/List/SearchContacts.tsx new file mode 100644 index 0000000..316c9e5 --- /dev/null +++ b/phone/src/apps/contacts/components/List/SearchContacts.tsx @@ -0,0 +1,83 @@ +import React, { useState } from 'react' +import { InputBase } from "@material-ui/core"; +import SearchIcon from '@material-ui/icons/Search'; +import { createStyles, fade, Theme, makeStyles } from '@material-ui/core/styles'; + +import { useFilteredContacts } from '../../hooks/useFilteredContacts'; + + +const useStyles = makeStyles((theme: Theme) => + createStyles({ + bg: { + backgroundColor: "#232323", + display: 'flex', + height: 60, + justifyContent: 'center', + alignItems: 'center' + }, + textFieldInput: { + fontSize: 20 + }, + inputRoot: { + color: '#fff', + fontSize: 18 + }, + inputInput: { + padding: theme.spacing(1, 2, 1, 2), + // vertical padding + font size from searchIcon + transition: theme.transitions.create('width'), + width: '100%', + + [theme.breakpoints.up('sm')]: { + width: '13ch', + '&:focus': { + width: '20ch', + }, + }, + }, + search: { + position: 'relative', + borderRadius: theme.shape.borderRadius, + backgroundColor: fade(theme.palette.common.white, 0.15), + '&:hover': { + backgroundColor: fade(theme.palette.common.white, 0.25), + }, + marginLeft: 0, + width: '100%', + [theme.breakpoints.up('sm')]: { + marginLeft: theme.spacing(1), + width: 'auto', + }, + }, + }) +); + +export const SearchContacts = () => { + + const { setFilteredContacts } = useFilteredContacts(); + + const classes = useStyles(); + const [ searchValue, setSearchValue ] = useState('') + + + const handleChange = (e) => { + setSearchValue(e.target.value) + setFilteredContacts(e.target.value) + } + + return ( +
+
+ +
+
+ ) +} From 63903084009cd8c3ec70fec3009f9c4012de9434 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:31:27 +0200 Subject: [PATCH 05/16] Feat(Contacts): New hook for filtering contacts --- phone/src/apps/contacts/hooks/useFilteredContacts.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 phone/src/apps/contacts/hooks/useFilteredContacts.ts diff --git a/phone/src/apps/contacts/hooks/useFilteredContacts.ts b/phone/src/apps/contacts/hooks/useFilteredContacts.ts new file mode 100644 index 0000000..b355cf4 --- /dev/null +++ b/phone/src/apps/contacts/hooks/useFilteredContacts.ts @@ -0,0 +1,7 @@ +import { useRecoilState } from 'recoil'; +import { contactsState } from './state'; + +export const useFilteredContacts = () => { + const [ filteredContacts, setFilteredContacts ] = useRecoilState(contactsState.filterContacts); + return { filteredContacts, setFilteredContacts }; +} \ No newline at end of file From d329eb6a5b95d3808897f043a2b520c416cf8497 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:31:48 +0200 Subject: [PATCH 06/16] Feat(Contacts): New hook for showing modal --- phone/src/apps/contacts/hooks/useModal.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 phone/src/apps/contacts/hooks/useModal.ts diff --git a/phone/src/apps/contacts/hooks/useModal.ts b/phone/src/apps/contacts/hooks/useModal.ts new file mode 100644 index 0000000..595a736 --- /dev/null +++ b/phone/src/apps/contacts/hooks/useModal.ts @@ -0,0 +1,7 @@ +import { useRecoilState } from 'recoil'; +import { contactsState } from './state'; + +export const useModal = () => { + const [ showModal, setShowModal ] = useRecoilState(contactsState.showModal); + return { showModal, setShowModal }; +} \ No newline at end of file From 763a0300b500c627ba1f0e8dc2cb63c45399bc90 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:32:57 +0200 Subject: [PATCH 07/16] Implenting components --- .../apps/contacts/components/ContactsApp.tsx | 61 +++++++++++++------ 1 file changed, 43 insertions(+), 18 deletions(-) diff --git a/phone/src/apps/contacts/components/ContactsApp.tsx b/phone/src/apps/contacts/components/ContactsApp.tsx index a9ad942..5ddca3e 100644 --- a/phone/src/apps/contacts/components/ContactsApp.tsx +++ b/phone/src/apps/contacts/components/ContactsApp.tsx @@ -1,38 +1,63 @@ -import React, { useState } from "react"; +import React from "react"; import { AppWrapper } from "../../../ui/components"; +import { makeStyles, createStyles, Theme } from "@material-ui/core/styles"; import { AppTitle } from "../../../ui/components/AppTitle"; import { AppContent } from "../../../ui/components/AppContent"; -import { ContactList } from "./ContactList"; +import { ContactList } from "./List/ContactList"; import { useApp } from "../../../os/apps/hooks/useApps"; -import AddCircleIcon from "@material-ui/icons/AddCircle"; import { AddContactModal } from "./ContactModal"; -import { Button } from "@material-ui/core"; +import { useModal } from '../hooks/useModal'; +import { SearchContacts } from "./List/SearchContacts"; +import { ContactTitle } from "./ContactTitle"; + +import './Contact.css'; + +import AddIcon from '@material-ui/icons/Add'; +import Fab from '@material-ui/core/Fab'; + + +const useStyles = makeStyles((theme: Theme) => + createStyles({ + backgroundModal: { + background: "black", + opacity: "0.6", + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + zIndex: 5, + }, + absolute: { + position: 'sticky', + bottom: theme.spacing(2), + left: theme.spacing(3), + }, + }) +); export const ContactsApp = () => { - const [modal, setModal] = useState(false); + + const classes = useStyles(); + const { showModal, setShowModal } = useModal(); const contacts = useApp("CONTACTS"); const openModal = () => { - setModal(true); + setShowModal(true); }; - const closeModal = () => { - setModal(false); - }; return ( - + - + + +
- + + + ); From 88aaa690276e82373bcc4a89562a66cabd3ae41f Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:34:28 +0200 Subject: [PATCH 08/16] Feat(Contacts): New state for filtering contacts --- phone/src/apps/contacts/hooks/state.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phone/src/apps/contacts/hooks/state.ts b/phone/src/apps/contacts/hooks/state.ts index feea75f..8b16291 100644 --- a/phone/src/apps/contacts/hooks/state.ts +++ b/phone/src/apps/contacts/hooks/state.ts @@ -5,4 +5,12 @@ export const contactsState = { key: "contactsList", default: [], }), + showModal: atom({ + key: 'showModal', + default: false + }), + filterContacts: atom({ + key: 'filterContacts', + default: "" + }) }; From 1368edd2af48d5ce7a99731ed6d1e78fc8c7f90a Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 18:35:17 +0200 Subject: [PATCH 09/16] Feat(Phone): Hardcoded data for contacts --- phone/src/Phone.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index c28a9f9..8cb3b35 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -43,12 +43,20 @@ setTimeout(() => { { id: 1, number: "345-4366", - display: "Kevin", + display: "Gjelten", + img: 'https://i.imgur.com/Qpw6j8D.png' }, { id: 2, - number: "345-4366", - display: "Kevin", + number: "456-4366", + display: "Loyd", + img: '' + }, + { + id: 3, + number: "123-4366", + display: "Fabian", + img: 'https://i.imgur.com/B8ta5Aa.jpeg' }, ], }, From 6219ebbdc0476fc846597e681a2a0f0c2ca758d7 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:14:16 +0200 Subject: [PATCH 10/16] Feat(Contacts:Search): Cooler layour --- .../contacts/components/List/SearchContacts.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/phone/src/apps/contacts/components/List/SearchContacts.tsx b/phone/src/apps/contacts/components/List/SearchContacts.tsx index 316c9e5..605fbb0 100644 --- a/phone/src/apps/contacts/components/List/SearchContacts.tsx +++ b/phone/src/apps/contacts/components/List/SearchContacts.tsx @@ -23,7 +23,7 @@ const useStyles = makeStyles((theme: Theme) => fontSize: 18 }, inputInput: { - padding: theme.spacing(1, 2, 1, 2), + padding: theme.spacing(1, 4, 1, 4), // vertical padding + font size from searchIcon transition: theme.transitions.create('width'), width: '100%', @@ -49,6 +49,15 @@ const useStyles = makeStyles((theme: Theme) => width: 'auto', }, }, + searchIcon: { + padding: theme.spacing(0, 0.5), + height: '100%', + position: 'absolute', + pointerEvents: 'none', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + }, }) ); @@ -68,6 +77,9 @@ export const SearchContacts = () => { return (
+
+ +
Date: Fri, 16 Oct 2020 20:15:51 +0200 Subject: [PATCH 11/16] Del: Removed css file --- phone/src/apps/contacts/components/Contact.css | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 phone/src/apps/contacts/components/Contact.css diff --git a/phone/src/apps/contacts/components/Contact.css b/phone/src/apps/contacts/components/Contact.css deleted file mode 100644 index 21164f2..0000000 --- a/phone/src/apps/contacts/components/Contact.css +++ /dev/null @@ -1,10 +0,0 @@ -.display-block { - /*Sets modal to center*/ - display: flex; - justify-content: center; - align-items: center; -} - -.display-none { - display: none; -} From 63722a62068c6e9784b75d2878a8a8a48d138007 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:18:06 +0200 Subject: [PATCH 12/16] Cleanup(Contacts): ContactsAPp --- phone/src/apps/contacts/components/ContactsApp.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/phone/src/apps/contacts/components/ContactsApp.tsx b/phone/src/apps/contacts/components/ContactsApp.tsx index 5ddca3e..5fc7cda 100644 --- a/phone/src/apps/contacts/components/ContactsApp.tsx +++ b/phone/src/apps/contacts/components/ContactsApp.tsx @@ -8,11 +8,8 @@ import { useApp } from "../../../os/apps/hooks/useApps"; import { AddContactModal } from "./ContactModal"; import { useModal } from '../hooks/useModal'; import { SearchContacts } from "./List/SearchContacts"; -import { ContactTitle } from "./ContactTitle"; +import PersonAddIcon from '@material-ui/icons/PersonAdd' -import './Contact.css'; - -import AddIcon from '@material-ui/icons/Add'; import Fab from '@material-ui/core/Fab'; @@ -56,7 +53,7 @@ export const ContactsApp = () => { - + From 03e52dca7fb78977a971f2d95b164688a587a409 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:18:35 +0200 Subject: [PATCH 13/16] Feat(Contact:Modal): New layout | Adding Avatar --- .../apps/contacts/components/ContactModal.tsx | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/phone/src/apps/contacts/components/ContactModal.tsx b/phone/src/apps/contacts/components/ContactModal.tsx index 506ee2c..e4391dd 100644 --- a/phone/src/apps/contacts/components/ContactModal.tsx +++ b/phone/src/apps/contacts/components/ContactModal.tsx @@ -6,8 +6,11 @@ import List from "@material-ui/core/List"; import ListItem from "@material-ui/core/ListItem"; import Modal from '../../../ui/components/Modal'; import { useModal } from '../hooks/useModal'; +import ClearIcon from '@material-ui/icons/Clear'; +import PersonIcon from '@material-ui/icons/Person'; +import PhoneIcon from '@material-ui/icons/Phone'; +import AccountCircleIcon from '@material-ui/icons/AccountCircle'; -import '../components/Contact.css' const useStyles = makeStyles((theme: Theme) => ({ button: { @@ -22,12 +25,18 @@ const useStyles = makeStyles((theme: Theme) => ({ marginLeft: "-4em", height: "20%", }, + clearButton: { + width: '10%', + position: 'absolute', + right: 0 + }, textInputField: { fontSize: 20, borderBottomColor: 'red' }, addBtn: { margin: 'auto', + fontSize: 16, width: 150, background: "#2196f3", marginBottom: 10, @@ -39,6 +48,9 @@ const useStyles = makeStyles((theme: Theme) => ({ background: "#232323", marginBottom: 20, padding: 8 + }, + icons: { + marginRight: 5 } })); @@ -69,43 +81,45 @@ export const AddContactModal = () => { return ( - + + + setName(e.target.value)} - style={{ fontSize: "18px" }} fullWidth - variant="outlined" + variant="standard" placeholder="Name" /> + setNumber(e.target.value)} fullWidth placeholder="Number" - variant="outlined" + variant="standard" type="number" /> + setAvatar(e.target.value)} fullWidth - placeholder="Picture link" + placeholder="Avatar URL" variant="standard" type="text" /> - ); }; From 8dcd85dc07fc73c934d01b6ccfb3c81e45840bc9 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:19:10 +0200 Subject: [PATCH 14/16] New icons for apps --- phone/src/os/apps/hooks/useApps.tsx | 32 +++++++++++++---------------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index 366c69f..626d1a0 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -5,21 +5,17 @@ import { common, grey, green, - orange, purple, red, amber, } from "@material-ui/core/colors"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faAd } from "@fortawesome/free-solid-svg-icons"; +import { faAd, faPlaneArrival, faPhoneAlt, faLandmark } from "@fortawesome/free-solid-svg-icons"; +import { faTwitter } from '@fortawesome/free-brands-svg-icons' import ContactsIcon from "@material-ui/icons/Contacts"; import SettingsIcon from "@material-ui/icons/Settings"; -import PhoneIcon from "@material-ui/icons/Phone"; -import CalendarTodayIcon from "@material-ui/icons/CalendarToday"; -import AccountBalanceIcon from "@material-ui/icons/AccountBalance"; import MessageIcon from "@material-ui/icons/Message"; -import TwitterIcon from "@material-ui/icons/Twitter"; import { atom } from "recoil"; import { CalculatorIcon } from "../../../apps/calculator/components/CalculatorIcon"; import { Route } from "react-router-dom"; @@ -40,18 +36,18 @@ const appsState = atom({ { id: "DIALER", nameLocale: "APPS_DIALER", - icon: , - backgroundColor: green[400], - color: green[50], + icon: , + backgroundColor: green[600], + color: common.white, path: "/phone", Route: () => , }, { id: "MESSAGES", nameLocale: "APPS_MESSAGES", - icon: , - backgroundColor: amber[400], - color: amber[50], + icon: , + backgroundColor: amber[700], + color: common.white, path: "/messages", Route: () => , }, @@ -60,7 +56,7 @@ const appsState = atom({ nameLocale: "APPS_CONTACTS", icon: , backgroundColor: blue[500], - color: blue[50], + color: common.white, path: "/contacts", Route: () => , }, @@ -85,16 +81,16 @@ const appsState = atom({ { id: "BANK", nameLocale: "APPS_BANK", - icon: , - backgroundColor: orange[600], - color: orange[50], + icon: , + backgroundColor: blue[900], + color: common.white, path: "/bank", Route: () => , }, { id: "TWITTER", nameLocale: "APPS_TWITTER", - icon: , + icon: , backgroundColor: blue[600], color: common.white, path: "/twitter", @@ -112,7 +108,7 @@ const appsState = atom({ { id: "EXAMPLE", nameLocale: "APPS_EXAMPLE", - icon: , + icon: , backgroundColor: blue[500], color: blue[50], path: "/example", From 99ab7ad2080b6de607531e6a4801ee21ac348259 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:19:53 +0200 Subject: [PATCH 15/16] Package for fontawesome, I think --- phone/package.json | 3 +++ phone/yarn.lock | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/phone/package.json b/phone/package.json index 9010876..a60fcea 100644 --- a/phone/package.json +++ b/phone/package.json @@ -6,11 +6,13 @@ "@babel/polyfill": "^7.4.4", "@fortawesome/fontawesome-free": "^5.15.1", "@fortawesome/fontawesome-svg-core": "^1.2.32", + "@fortawesome/free-brands-svg-icons": "^5.15.1", "@fortawesome/free-solid-svg-icons": "^5.15.1", "@fortawesome/react-fontawesome": "^0.1.11", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.56", + "@popperjs/core": "^2.5.3", "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.5.0", "@testing-library/user-event": "^7.2.1", @@ -26,6 +28,7 @@ "react-dom": "^16.13.1", "react-hotkeys": "^2.0.0", "react-i18next": "^11.7.1", + "react-popper": "^2.2.3", "react-router-dom": "^5.2.0", "react-scripts": "3.4.3", "recoil": "^0.0.10", diff --git a/phone/yarn.lock b/phone/yarn.lock index 1b32522..740de8e 100644 --- a/phone/yarn.lock +++ b/phone/yarn.lock @@ -1234,6 +1234,13 @@ dependencies: "@fortawesome/fontawesome-common-types" "^0.2.32" +"@fortawesome/free-brands-svg-icons@^5.15.1": + version "5.15.1" + resolved "https://registry.yarnpkg.com/@fortawesome/free-brands-svg-icons/-/free-brands-svg-icons-5.15.1.tgz#1dc0563f4036639e53d24b8e532ea78a53ca2250" + integrity sha512-pkTZIWn7iuliCCgV+huDfZmZb2UjslalXGDA2PcqOVUYJmYL11y6ooFiMJkJvUZu+xgAc1gZgQe+Px12mZF0CA== + dependencies: + "@fortawesome/fontawesome-common-types" "^0.2.32" + "@fortawesome/free-solid-svg-icons@^5.15.1": version "5.15.1" resolved "https://registry.yarnpkg.com/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.1.tgz#e1432676ddd43108b41197fee9f86d910ad458ef" @@ -1544,6 +1551,11 @@ resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== +"@popperjs/core@^2.5.3": + version "2.5.3" + resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.5.3.tgz#4982b0b66b7a4cf949b86f5d25a8cf757d3cfd9d" + integrity sha512-RFwCobxsvZ6j7twS7dHIZQZituMIDJJNHS/qY6iuthVebxS3zhRY+jaC2roEKiAYaVuTcGmX6Luc6YBcf6zJVg== + "@sheerun/mutationobserver-shim@^0.3.2": version "0.3.3" resolved "https://registry.yarnpkg.com/@sheerun/mutationobserver-shim/-/mutationobserver-shim-0.3.3.tgz#5405ee8e444ed212db44e79351f0c70a582aae25" @@ -9838,6 +9850,11 @@ react-error-overlay@^6.0.7: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.7.tgz#1dcfb459ab671d53f660a991513cb2f0a0553108" integrity sha512-TAv1KJFh3RhqxNvhzxj6LeT5NWklP6rDr2a0jaTfsZ5wSZWHOGeqQyejUp3xxLfPt2UpyJEcVQB/zyPcmonNFA== +react-fast-compare@^3.0.1: + version "3.2.0" + resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb" + integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA== + react-hotkeys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/react-hotkeys/-/react-hotkeys-2.0.0.tgz#a7719c7340cbba888b0e9184f806a9ec0ac2c53f" @@ -9858,6 +9875,14 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react- resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-popper@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.2.3.tgz#33d425fa6975d4bd54d9acd64897a89d904b9d97" + integrity sha512-mOEiMNT1249js0jJvkrOjyHsGvqcJd3aGW/agkiMoZk3bZ1fXN1wQszIQSjHIai48fE67+zwF8Cs+C4fWqlfjw== + dependencies: + react-fast-compare "^3.0.1" + warning "^4.0.2" + react-router-dom@^5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.2.0.tgz#9e65a4d0c45e13289e66c7b17c7e175d0ea15662" @@ -11860,6 +11885,13 @@ walker@^1.0.7, walker@~1.0.5: dependencies: makeerror "1.0.x" +warning@^4.0.2: + version "4.0.3" + resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3" + integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w== + dependencies: + loose-envify "^1.0.0" + watchpack-chokidar2@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/watchpack-chokidar2/-/watchpack-chokidar2-2.0.0.tgz#9948a1866cbbd6cb824dea13a7ed691f6c8ddff0" From 95cd24789373576b79f055cc1e3914dff9a8cc3e Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 16 Oct 2020 20:20:16 +0200 Subject: [PATCH 16/16] Feat(Contact:Header): Maybe we will use it --- .../apps/contacts/components/ContactTitle.tsx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 phone/src/apps/contacts/components/ContactTitle.tsx diff --git a/phone/src/apps/contacts/components/ContactTitle.tsx b/phone/src/apps/contacts/components/ContactTitle.tsx new file mode 100644 index 0000000..8eeff48 --- /dev/null +++ b/phone/src/apps/contacts/components/ContactTitle.tsx @@ -0,0 +1,32 @@ +import React from 'react' +import { makeStyles, createStyles, Theme } from "@material-ui/core/styles"; +import Paper from "@material-ui/core/Paper"; +import ContactsIcon from "@material-ui/icons/Contacts"; + +const useStyles = makeStyles((theme: Theme) => + createStyles({ + root: { + height: "60px", + width: "100%", + display: "flex", + flexFlow: "row nowrap", + justifyContent: "center", + alignItems: "center", + background: "#424242", + }, + icon: { + color: "#fff", + fontSize: 30, + }, + }) +); + + +export const ContactTitle = () => { + const classes = useStyles(); + return ( + + + + ) +}