From 10639260e02e59614f0fca10c0ac67e5b295735d Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 8 Jun 2021 20:45:12 +0200 Subject: [PATCH] fix(phone): move FABs outside of AppContent --- .../apps/contacts/components/ContactsApp.tsx | 17 ++++++++++ .../components/views/ContactsPage.tsx | 31 ++----------------- phone/src/apps/notes/NotesApp.tsx | 6 ++-- phone/src/apps/notes/notes.styles.ts | 2 +- 4 files changed, 23 insertions(+), 33 deletions(-) diff --git a/phone/src/apps/contacts/components/ContactsApp.tsx b/phone/src/apps/contacts/components/ContactsApp.tsx index 74e72fc..9d76932 100644 --- a/phone/src/apps/contacts/components/ContactsApp.tsx +++ b/phone/src/apps/contacts/components/ContactsApp.tsx @@ -11,8 +11,18 @@ import { ContactsThemeProvider } from '../providers/ContactsThemeProvider'; import { ContactEvents } from '../../../../../typings/contact'; import { LoadingSpinner } from '../../../ui/components/LoadingSpinner'; +const useStyles = makeStyles((theme: Theme) => ({ + absolute: { + position: 'absolute', + right: theme.spacing(3), + bottom: theme.spacing(2), + }, +})); + export const ContactsApp = () => { const contacts = useApp('CONTACTS'); + const history = useHistory(); + const classes = useStyles(); return ( @@ -24,6 +34,13 @@ export const ContactsApp = () => { + history.push('/contacts/-1')} + className={classes.absolute} + > + + ); diff --git a/phone/src/apps/contacts/components/views/ContactsPage.tsx b/phone/src/apps/contacts/components/views/ContactsPage.tsx index d072f30..204a803 100644 --- a/phone/src/apps/contacts/components/views/ContactsPage.tsx +++ b/phone/src/apps/contacts/components/views/ContactsPage.tsx @@ -1,37 +1,10 @@ import React from 'react'; -import Fab from '@material-ui/core/Fab'; -import PersonAddIcon from '@material-ui/icons/PersonAdd'; -import { useHistory } from 'react-router-dom'; -import { makeStyles, Theme } from '@material-ui/core/styles'; import { ContactList } from '../List/ContactList'; -const useStyles = makeStyles((theme: Theme) => ({ - absolute: { - position: 'absolute', - bottom: theme.spacing(2), - right: theme.spacing(2), - }, - icon: { - color: '#fff', - fontSize: 30, - }, -})); - export const ContactPage = () => { - const history = useHistory(); - - const classes = useStyles(); - return ( - <> +
- history.push('/contacts/-1')} - className={classes.absolute} - > - - - +
); }; diff --git a/phone/src/apps/notes/NotesApp.tsx b/phone/src/apps/notes/NotesApp.tsx index 85d7c50..ddf5b1c 100644 --- a/phone/src/apps/notes/NotesApp.tsx +++ b/phone/src/apps/notes/NotesApp.tsx @@ -30,10 +30,10 @@ export const NotesApp = () => { - - - + + + ); diff --git a/phone/src/apps/notes/notes.styles.ts b/phone/src/apps/notes/notes.styles.ts index 71b03e3..ed1fd52 100644 --- a/phone/src/apps/notes/notes.styles.ts +++ b/phone/src/apps/notes/notes.styles.ts @@ -13,8 +13,8 @@ const useStyles = makeStyles((theme) => ({ }, absolute: { position: 'absolute', - bottom: theme.spacing(2), right: theme.spacing(3), + bottom: theme.spacing(5), }, }));