From 3a1bd75f97eef327609de28bb801ebc068c40abe Mon Sep 17 00:00:00 2001 From: erik-sn Date: Sun, 18 Oct 2020 13:38:01 -0400 Subject: [PATCH] formatting --- phone/package.json | 1 + phone/src/Phone.tsx | 6 +- .../apps/contacts/components/ContactModal.tsx | 55 ++++++------ .../apps/contacts/components/ContactTitle.tsx | 9 +- .../apps/contacts/components/ContactsApp.tsx | 21 ++--- .../contacts/components/List/ContactList.tsx | 68 ++++++++------- .../components/List/SearchContacts.tsx | 84 ++++++++++--------- phone/src/apps/contacts/hooks/state.ts | 10 +-- phone/src/apps/contacts/hooks/useContacts.ts | 2 +- .../contacts/hooks/useFilteredContacts.ts | 10 ++- phone/src/apps/contacts/hooks/useModal.ts | 8 +- .../notification/TwitterNotification.test.tsx | 67 ++++++++------- .../notification/TwitterNotification.tsx | 61 +++++++------- phone/src/apps/twitter/hooks/state.ts | 4 +- .../twitter/hooks/useTwitterNotification.ts | 2 +- .../apps/twitter/hooks/useTwitterService.ts | 5 +- phone/src/apps/twitter/interfaces.ts | 18 ++-- phone/src/index.tsx | 2 +- phone/src/main.css | 11 ++- phone/src/os/apps/hooks/useApps.tsx | 11 ++- phone/src/os/interfaces/serverConfig.ts | 4 +- phone/src/ui/components/Notification.tsx | 41 ++++----- resources/html/index.html | 45 +++++++++- 23 files changed, 309 insertions(+), 236 deletions(-) diff --git a/phone/package.json b/phone/package.json index 2f147d0..26a7505 100644 --- a/phone/package.json +++ b/phone/package.json @@ -69,6 +69,7 @@ "scripts": { "start": "react-scripts start", "watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js", + "format": "prettier --write src/**/*.{js,jsx,ts,tsx,json,css,scss,md}", "build": "react-scripts build", "build:resources": "cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout", "test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.[jt]s?(x)", diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index d05b59f..b2dbd8b 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -44,19 +44,19 @@ setTimeout(() => { id: 1, number: "345-4366", display: "Gjelten", - avatar: 'https://i.imgur.com/Qpw6j8D.png' + avatar: "https://i.imgur.com/Qpw6j8D.png", }, { id: 2, number: "456-4366", display: "Loyd", - avatar: '' + avatar: "", }, { id: 3, number: "123-4366", display: "Fabian", - avatar: 'https://i.imgur.com/B8ta5Aa.jpeg' + avatar: "https://i.imgur.com/B8ta5Aa.jpeg", }, ], }, diff --git a/phone/src/apps/contacts/components/ContactModal.tsx b/phone/src/apps/contacts/components/ContactModal.tsx index f285b44..eaa6993 100644 --- a/phone/src/apps/contacts/components/ContactModal.tsx +++ b/phone/src/apps/contacts/components/ContactModal.tsx @@ -4,13 +4,12 @@ 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'; -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 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"; const useStyles = makeStyles((theme: Theme) => ({ button: { @@ -26,32 +25,32 @@ const useStyles = makeStyles((theme: Theme) => ({ height: "20%", }, clearButton: { - width: '10%', - position: 'absolute', - right: 0 + width: "10%", + position: "absolute", + right: 0, }, textInputField: { fontSize: 20, - borderBottomColor: 'red' + borderBottomColor: "red", }, addBtn: { - margin: 'auto', + margin: "auto", fontSize: 16, width: 150, background: "#2196f3", marginBottom: 10, - padding: 8 + padding: 8, }, cancelBtn: { - margin: 'auto', + margin: "auto", width: 150, background: "#232323", marginBottom: 20, - padding: 8 + padding: 8, }, icons: { - marginRight: 5 - } + marginRight: 5, + }, })); export const AddContactModal = () => { @@ -69,25 +68,27 @@ export const AddContactModal = () => { Nui.send("contacts:add", { name, number, - avatar + avatar, }); console.log(name, number, avatar); } }; const _handleClose = () => { - setShowModal(false) - } + setShowModal(false); + }; return ( - + setName(e.target.value)} fullWidth variant="standard" @@ -98,7 +99,7 @@ export const AddContactModal = () => { setNumber(e.target.value)} fullWidth placeholder="Number" @@ -110,7 +111,7 @@ export const AddContactModal = () => { setAvatar(e.target.value)} fullWidth placeholder="Avatar URL" @@ -118,8 +119,10 @@ export const AddContactModal = () => { type="text" /> - - + + ); }; diff --git a/phone/src/apps/contacts/components/ContactTitle.tsx b/phone/src/apps/contacts/components/ContactTitle.tsx index 8eeff48..75f0944 100644 --- a/phone/src/apps/contacts/components/ContactTitle.tsx +++ b/phone/src/apps/contacts/components/ContactTitle.tsx @@ -1,9 +1,9 @@ -import React from 'react' +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) => +const useStyles = makeStyles((theme: Theme) => createStyles({ root: { height: "60px", @@ -21,12 +21,11 @@ const useStyles = makeStyles((theme: Theme) => }) ); - export const ContactTitle = () => { const classes = useStyles(); return ( - ) -} + ); +}; diff --git a/phone/src/apps/contacts/components/ContactsApp.tsx b/phone/src/apps/contacts/components/ContactsApp.tsx index 5fc7cda..4517555 100644 --- a/phone/src/apps/contacts/components/ContactsApp.tsx +++ b/phone/src/apps/contacts/components/ContactsApp.tsx @@ -6,14 +6,13 @@ import { AppContent } from "../../../ui/components/AppContent"; import { ContactList } from "./List/ContactList"; import { useApp } from "../../../os/apps/hooks/useApps"; import { AddContactModal } from "./ContactModal"; -import { useModal } from '../hooks/useModal'; +import { useModal } from "../hooks/useModal"; import { SearchContacts } from "./List/SearchContacts"; -import PersonAddIcon from '@material-ui/icons/PersonAdd' +import PersonAddIcon from "@material-ui/icons/PersonAdd"; -import Fab from '@material-ui/core/Fab'; +import Fab from "@material-ui/core/Fab"; - -const useStyles = makeStyles((theme: Theme) => +const useStyles = makeStyles((theme: Theme) => createStyles({ backgroundModal: { background: "black", @@ -26,7 +25,7 @@ const useStyles = makeStyles((theme: Theme) => zIndex: 5, }, absolute: { - position: 'sticky', + position: "sticky", bottom: theme.spacing(2), left: theme.spacing(3), }, @@ -34,7 +33,6 @@ const useStyles = makeStyles((theme: Theme) => ); export const ContactsApp = () => { - const classes = useStyles(); const { showModal, setShowModal } = useModal(); const contacts = useApp("CONTACTS"); @@ -43,16 +41,19 @@ export const ContactsApp = () => { setShowModal(true); }; - return ( - +
- + diff --git a/phone/src/apps/contacts/components/List/ContactList.tsx b/phone/src/apps/contacts/components/List/ContactList.tsx index 43cc1e2..e77698b 100644 --- a/phone/src/apps/contacts/components/List/ContactList.tsx +++ b/phone/src/apps/contacts/components/List/ContactList.tsx @@ -1,15 +1,11 @@ import React from "react"; import ListItemText from "@material-ui/core/ListItemText"; -import { - Button, - ListItemAvatar, - Avatar as MuiAvatar -} from "@material-ui/core"; +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 { useFilteredContacts } from "../../hooks/useFilteredContacts"; import PhoneIcon from "@material-ui/icons/Phone"; import ChatIcon from "@material-ui/icons/Chat"; @@ -20,7 +16,6 @@ import { useContacts } from "../../hooks/useContacts"; import Nui from "../../../../os/nui-events/utils/Nui"; export const ContactList = () => { - const { filteredContacts } = useFilteredContacts(); const contacts = useContacts(); @@ -34,31 +29,40 @@ export const ContactList = () => { return ( - {contacts.contacts.filter(contact => contact.display.includes(filteredContacts) || contact.number.includes(filteredContacts)).map((contact) => ( - - - {contact.avatar ? ( - - ): ( - {contact.display.slice(0, 1)} - )} - - - - - - - ))} + {contacts.contacts + .filter( + (contact) => + contact.display.includes(filteredContacts) || + contact.number.includes(filteredContacts) + ) + .map((contact) => ( + + + {contact.avatar ? ( + + ) : ( + {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 index 605fbb0..cb373bb 100644 --- a/phone/src/apps/contacts/components/List/SearchContacts.tsx +++ b/phone/src/apps/contacts/components/List/SearchContacts.tsx @@ -1,95 +1,97 @@ -import React, { useState } from 'react' +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 SearchIcon from "@material-ui/icons/Search"; +import { + createStyles, + fade, + Theme, + makeStyles, +} from "@material-ui/core/styles"; -import { useFilteredContacts } from '../../hooks/useFilteredContacts'; +import { useFilteredContacts } from "../../hooks/useFilteredContacts"; - -const useStyles = makeStyles((theme: Theme) => +const useStyles = makeStyles((theme: Theme) => createStyles({ bg: { backgroundColor: "#232323", - display: 'flex', + display: "flex", height: 60, - justifyContent: 'center', - alignItems: 'center' + justifyContent: "center", + alignItems: "center", }, textFieldInput: { - fontSize: 20 + fontSize: 20, }, inputRoot: { - color: '#fff', - fontSize: 18 + color: "#fff", + fontSize: 18, }, inputInput: { padding: theme.spacing(1, 4, 1, 4), // vertical padding + font size from searchIcon - transition: theme.transitions.create('width'), - width: '100%', - - [theme.breakpoints.up('sm')]: { - width: '13ch', - '&:focus': { - width: '20ch', + transition: theme.transitions.create("width"), + width: "100%", + + [theme.breakpoints.up("sm")]: { + width: "13ch", + "&:focus": { + width: "20ch", }, }, }, search: { - position: 'relative', + position: "relative", borderRadius: theme.shape.borderRadius, backgroundColor: fade(theme.palette.common.white, 0.15), - '&:hover': { + "&:hover": { backgroundColor: fade(theme.palette.common.white, 0.25), }, marginLeft: 0, - width: '100%', - [theme.breakpoints.up('sm')]: { + width: "100%", + [theme.breakpoints.up("sm")]: { marginLeft: theme.spacing(1), - width: 'auto', + width: "auto", }, }, searchIcon: { padding: theme.spacing(0, 0.5), - height: '100%', - position: 'absolute', - pointerEvents: 'none', - display: 'flex', - alignItems: 'center', - justifyContent: 'center', + height: "100%", + position: "absolute", + pointerEvents: "none", + display: "flex", + alignItems: "center", + justifyContent: "center", }, }) ); export const SearchContacts = () => { - const { setFilteredContacts } = useFilteredContacts(); const classes = useStyles(); - const [ searchValue, setSearchValue ] = useState('') - + const [searchValue, setSearchValue] = useState(""); const handleChange = (e) => { - setSearchValue(e.target.value) - setFilteredContacts(e.target.value) - } + setSearchValue(e.target.value); + setFilteredContacts(e.target.value); + }; return (
- +
- ) -} + ); +}; diff --git a/phone/src/apps/contacts/hooks/state.ts b/phone/src/apps/contacts/hooks/state.ts index 8b16291..d0784e0 100644 --- a/phone/src/apps/contacts/hooks/state.ts +++ b/phone/src/apps/contacts/hooks/state.ts @@ -6,11 +6,11 @@ export const contactsState = { default: [], }), showModal: atom({ - key: 'showModal', - default: false + key: "showModal", + default: false, }), filterContacts: atom({ - key: 'filterContacts', - default: "" - }) + key: "filterContacts", + default: "", + }), }; diff --git a/phone/src/apps/contacts/hooks/useContacts.ts b/phone/src/apps/contacts/hooks/useContacts.ts index 16f8117..e83a7a2 100644 --- a/phone/src/apps/contacts/hooks/useContacts.ts +++ b/phone/src/apps/contacts/hooks/useContacts.ts @@ -5,7 +5,7 @@ interface Contact { id: string; display: string; number: string; - img?: string + img?: string; } interface IUseContacts { diff --git a/phone/src/apps/contacts/hooks/useFilteredContacts.ts b/phone/src/apps/contacts/hooks/useFilteredContacts.ts index b355cf4..0e77e25 100644 --- a/phone/src/apps/contacts/hooks/useFilteredContacts.ts +++ b/phone/src/apps/contacts/hooks/useFilteredContacts.ts @@ -1,7 +1,9 @@ -import { useRecoilState } from 'recoil'; -import { contactsState } from './state'; +import { useRecoilState } from "recoil"; +import { contactsState } from "./state"; export const useFilteredContacts = () => { - const [ filteredContacts, setFilteredContacts ] = useRecoilState(contactsState.filterContacts); + const [filteredContacts, setFilteredContacts] = useRecoilState( + contactsState.filterContacts + ); return { filteredContacts, setFilteredContacts }; -} \ No newline at end of file +}; diff --git a/phone/src/apps/contacts/hooks/useModal.ts b/phone/src/apps/contacts/hooks/useModal.ts index 595a736..fddf5a1 100644 --- a/phone/src/apps/contacts/hooks/useModal.ts +++ b/phone/src/apps/contacts/hooks/useModal.ts @@ -1,7 +1,7 @@ -import { useRecoilState } from 'recoil'; -import { contactsState } from './state'; +import { useRecoilState } from "recoil"; +import { contactsState } from "./state"; export const useModal = () => { - const [ showModal, setShowModal ] = useRecoilState(contactsState.showModal); + const [showModal, setShowModal] = useRecoilState(contactsState.showModal); return { showModal, setShowModal }; -} \ No newline at end of file +}; diff --git a/phone/src/apps/twitter/components/notification/TwitterNotification.test.tsx b/phone/src/apps/twitter/components/notification/TwitterNotification.test.tsx index 0e9f959..40eca1e 100644 --- a/phone/src/apps/twitter/components/notification/TwitterNotification.test.tsx +++ b/phone/src/apps/twitter/components/notification/TwitterNotification.test.tsx @@ -1,42 +1,47 @@ -import React from 'react'; -import { shallow } from 'enzyme'; -import TwitterNotification from './TwitterNotification'; +import React from "react"; +import { shallow } from "enzyme"; +import TwitterNotification from "./TwitterNotification"; -jest.mock('react-i18next', () => ({ - useTranslation: () => ({t: key => key}) +jest.mock("react-i18next", () => ({ + useTranslation: () => ({ t: (key) => key }), })); -jest.mock('../../../../os/phone/hooks/usePhone', () => ({ - usePhone: jest.fn().mockReturnValue({ config: { - twitter: { - showNotifications: true, - } - } }) +jest.mock("../../../../os/phone/hooks/usePhone", () => ({ + usePhone: jest.fn().mockReturnValue({ + config: { + twitter: { + showNotifications: true, + }, + }, + }), })); -jest.mock('../../hooks/useTwitterNotification', () => ({ - useTwitterNotification: jest.fn().mockReturnValue({ notification: { - profile_name: 'test', - message: 'test message' - } }) +jest.mock("../../hooks/useTwitterNotification", () => ({ + useTwitterNotification: jest.fn().mockReturnValue({ + notification: { + profile_name: "test", + message: "test message", + }, + }), })); +describe("TwitterNotification", () => { + let wrapper; -describe('TwitterNotification', () => { - let wrapper; + beforeEach(() => { + wrapper = shallow(); + }); + it("renders", () => { + expect(wrapper).toBeDefined(); + }); - beforeEach(() => { - wrapper = shallow() - }) - it('renders', () => { - expect(wrapper).toBeDefined(); - }); + it("renders profile name", () => { + expect(wrapper.find(".makeStyles-profileName-5").text()).toEqual("@test"); + }); - it('renders profile name', () => { - expect(wrapper.find('.makeStyles-profileName-5').text()).toEqual('@test'); - }); - - it('renders message', () => { - expect(wrapper.find('.makeStyles-message-7').text()).toEqual('test message'); - }); + it("renders message", () => { + expect(wrapper.find(".makeStyles-message-7").text()).toEqual( + "test message" + ); + }); }); diff --git a/phone/src/apps/twitter/components/notification/TwitterNotification.tsx b/phone/src/apps/twitter/components/notification/TwitterNotification.tsx index 51f5789..45c1d8c 100644 --- a/phone/src/apps/twitter/components/notification/TwitterNotification.tsx +++ b/phone/src/apps/twitter/components/notification/TwitterNotification.tsx @@ -1,48 +1,48 @@ import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { makeStyles, createStyles, Theme } from "@material-ui/core/styles"; -import TwitterIcon from '@material-ui/icons/Twitter'; -import { useTwitterNotification } from '../../hooks/useTwitterNotification'; -import Notification from '../../../../ui/components/Notification'; +import TwitterIcon from "@material-ui/icons/Twitter"; +import { useTwitterNotification } from "../../hooks/useTwitterNotification"; +import Notification from "../../../../ui/components/Notification"; import { usePhone } from "../../../../os/phone/hooks/usePhone"; -const useStyles = makeStyles((theme: Theme) => +const useStyles = makeStyles((theme: Theme) => createStyles({ content: { padding: theme.spacing(2), - overflowY: 'hidden' + overflowY: "hidden", }, title: { - display: 'flex', - flexFlow: 'row nowrap', - justifyContent: 'space-between', - alignItems: 'center' + display: "flex", + flexFlow: "row nowrap", + justifyContent: "space-between", + alignItems: "center", }, titleLeft: { - display: 'flex', - flexFlow: 'row nowrap', - justifyContent: 'flex-start', - alignItems: 'center' + display: "flex", + flexFlow: "row nowrap", + justifyContent: "flex-start", + alignItems: "center", }, icon: { - marginTop: '3px', - marginRight: '5px' + marginTop: "3px", + marginRight: "5px", }, profileName: { - marginBottom: '3px', + marginBottom: "3px", }, justNow: { - fontSize: '18px', - fontStyle: 'italic', - paddingRight: '3px', + fontSize: "18px", + fontStyle: "italic", + paddingRight: "3px", }, message: { - fontSize: '16px', - overflow: 'hidden', - display: '-webkit-box', + fontSize: "16px", + overflow: "hidden", + display: "-webkit-box", WebkitLineClamp: 2, - WebkitBoxOrient: 'vertical', - } + WebkitBoxOrient: "vertical", + }, }) ); @@ -57,18 +57,24 @@ function TwitterNotification() { if (notification) { setVisible(true); } - }, [notification?.id]) + }, [notification?.id]); if (!config?.twitter.showNotifications || !notification) return null; const profileName = `@${notification.profile_name?.trim()}`; return ( - setVisible(false)}> + setVisible(false)} + >
-
+
+ +
{profileName}
{t("APPS_TWITTER_JUST_NOW")}
@@ -79,5 +85,4 @@ function TwitterNotification() { ); } - export default TwitterNotification; diff --git a/phone/src/apps/twitter/hooks/state.ts b/phone/src/apps/twitter/hooks/state.ts index 10d8a65..6349459 100644 --- a/phone/src/apps/twitter/hooks/state.ts +++ b/phone/src/apps/twitter/hooks/state.ts @@ -38,7 +38,7 @@ export const twitterState = { default: null, }), notification: atom({ - key: 'notification', + key: "notification", default: null, - }) + }), }; diff --git a/phone/src/apps/twitter/hooks/useTwitterNotification.ts b/phone/src/apps/twitter/hooks/useTwitterNotification.ts index 98b6ad7..2e4c231 100644 --- a/phone/src/apps/twitter/hooks/useTwitterNotification.ts +++ b/phone/src/apps/twitter/hooks/useTwitterNotification.ts @@ -4,7 +4,7 @@ import { Tweet } from "../interfaces"; import { twitterState } from "./state"; interface ITwitterNotification { - notification: Tweet | null; + notification: Tweet | null; } export const useTwitterNotification = (): ITwitterNotification => { diff --git a/phone/src/apps/twitter/hooks/useTwitterService.ts b/phone/src/apps/twitter/hooks/useTwitterService.ts index 2937bd5..25a2f5b 100644 --- a/phone/src/apps/twitter/hooks/useTwitterService.ts +++ b/phone/src/apps/twitter/hooks/useTwitterService.ts @@ -6,7 +6,6 @@ import { IMAGE_DELIMITER } from "../utils/images"; import { APP_TWITTER } from "../utils/constants"; import { twitterState } from "./state"; - /** * Perform all necessary processing/transforms from the raw database * data to what the frontend expects @@ -59,7 +58,7 @@ export const useTwitterService = () => { const _setNotification = (tweet) => { setNotification(tweet); - } + }; const _setTweets = (tweets) => { setTweets(tweets.map(processTweet)); @@ -75,5 +74,5 @@ export const useTwitterService = () => { useNuiEvent(APP_TWITTER, "fetchTweetsFiltered", _setFilteredTweets); useNuiEvent(APP_TWITTER, "createTweetLoading", setCreateLoading); useNuiEvent(APP_TWITTER, "createTweetResult", _setCreateSuccess); - useNuiEvent(APP_TWITTER, 'createTweetBroadcast', _setNotification) + useNuiEvent(APP_TWITTER, "createTweetBroadcast", _setNotification); }; diff --git a/phone/src/apps/twitter/interfaces.ts b/phone/src/apps/twitter/interfaces.ts index 5db7924..39e6436 100644 --- a/phone/src/apps/twitter/interfaces.ts +++ b/phone/src/apps/twitter/interfaces.ts @@ -1,10 +1,10 @@ export interface Tweet { - id: number; - profile_name?: string; - avatar_url?: string; - message: string; - createdAt?: string; - updatedAt?: string; - images?: string; - likes?: number; - } \ No newline at end of file + id: number; + profile_name?: string; + avatar_url?: string; + message: string; + createdAt?: string; + updatedAt?: string; + images?: string; + likes?: number; +} diff --git a/phone/src/index.tsx b/phone/src/index.tsx index 2835c84..c7fc224 100644 --- a/phone/src/index.tsx +++ b/phone/src/index.tsx @@ -7,7 +7,7 @@ import { RecoilRoot } from "recoil"; import "./main.css"; import Phone from "./Phone"; import * as serviceWorker from "./serviceWorker"; -import TwitterNotification from './apps/twitter/components/notification/TwitterNotification'; +import TwitterNotification from "./apps/twitter/components/notification/TwitterNotification"; ReactDOM.render( diff --git a/phone/src/main.css b/phone/src/main.css index 787c617..f7ed8a8 100644 --- a/phone/src/main.css +++ b/phone/src/main.css @@ -1,6 +1,6 @@ body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", + "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -10,10 +10,13 @@ body { } code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } -a, a:visited, a:hover, a:active { +a, +a:visited, +a:hover, +a:active { text-decoration: none; } diff --git a/phone/src/os/apps/hooks/useApps.tsx b/phone/src/os/apps/hooks/useApps.tsx index 626d1a0..c81aee8 100644 --- a/phone/src/os/apps/hooks/useApps.tsx +++ b/phone/src/os/apps/hooks/useApps.tsx @@ -10,8 +10,13 @@ import { amber, } from "@material-ui/core/colors"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; -import { faAd, faPlaneArrival, faPhoneAlt, faLandmark } from "@fortawesome/free-solid-svg-icons"; -import { faTwitter } from '@fortawesome/free-brands-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"; @@ -90,7 +95,7 @@ const appsState = atom({ { id: "TWITTER", nameLocale: "APPS_TWITTER", - icon: , + icon: , backgroundColor: blue[600], color: common.white, path: "/twitter", diff --git a/phone/src/os/interfaces/serverConfig.ts b/phone/src/os/interfaces/serverConfig.ts index 178ce51..6c2bf27 100644 --- a/phone/src/os/interfaces/serverConfig.ts +++ b/phone/src/os/interfaces/serverConfig.ts @@ -10,8 +10,8 @@ interface TwitterConfig { } interface NotificationConfig { - horizontal: 'left' | 'center' | 'right'; - vertical: 'bottom' | 'top'; + horizontal: "left" | "center" | "right"; + vertical: "bottom" | "top"; } export interface ServerConfig { diff --git a/phone/src/ui/components/Notification.tsx b/phone/src/ui/components/Notification.tsx index 4da7ddb..851880d 100644 --- a/phone/src/ui/components/Notification.tsx +++ b/phone/src/ui/components/Notification.tsx @@ -1,18 +1,21 @@ import React from "react"; import { ThemeProvider } from "@material-ui/core"; -import Paper from '@material-ui/core/Paper'; -import Snackbar from '@material-ui/core/Snackbar'; -import Fade from '@material-ui/core/Fade'; +import Paper from "@material-ui/core/Paper"; +import Snackbar from "@material-ui/core/Snackbar"; +import Fade from "@material-ui/core/Fade"; import { makeStyles } from "@material-ui/core/styles"; import { useSettings } from "../../apps/settings/hooks/useSettings"; import { usePhone } from "../../os/phone/hooks/usePhone"; const useStyles = makeStyles({ paper: { - width: '350px', - height: '100px', - opacity: '0.93', - } + width: "350px", + height: "100px", + opacity: "0.93", + }, + snackBar: { + zIndex: -5, // we want this to appear behind other active NUI events...probably + }, }); function Notification({ children, handleClose, open }) { @@ -26,21 +29,19 @@ function Notification({ children, handleClose, open }) { return ( - null }} - onClose={handleClose} - open={open} - TransitionComponent={Fade} - autoHideDuration={6000} - > - - {children} - - + null }} + onClose={handleClose} + open={open} + TransitionComponent={Fade} + autoHideDuration={6000} + > + {children} + ); } - export default Notification; diff --git a/resources/html/index.html b/resources/html/index.html index 9c511ba..d196fe9 100644 --- a/resources/html/index.html +++ b/resources/html/index.html @@ -1 +1,44 @@ -React App
\ No newline at end of file + + + + + + + + + + + + + + React App + + + +
+ + +