mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 14:38:45 +00:00
fix(phone): move FABs outside of AppContent
This commit is contained in:
1 parent
3df2f88759
commit
10639260e0
4 files changed
+23
-33
No files matched your search
@@ -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 (
|
||||
<ContactsThemeProvider>
|
||||
@@ -24,6 +34,13 @@ export const ContactsApp = () => {
|
||||
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
|
||||
</React.Suspense>
|
||||
</AppContent>
|
||||
<Fab
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
</Fab>
|
||||
</AppWrapper>
|
||||
</ContactsThemeProvider>
|
||||
);
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<div style={{ paddingBottom: 60 }}>
|
||||
<ContactList />
|
||||
<Fab
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
</Fab>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -30,10 +30,10 @@ export const NotesApp = () => {
|
||||
<NoteModal />
|
||||
<AppContent>
|
||||
<Route path="/notes" component={NoteList} />
|
||||
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</AppContent>
|
||||
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</AppWrapper>
|
||||
</NotesThemeProvider>
|
||||
);
|
||||
|
||||
@@ -13,8 +13,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
},
|
||||
absolute: {
|
||||
position: 'absolute',
|
||||
bottom: theme.spacing(2),
|
||||
right: theme.spacing(3),
|
||||
bottom: theme.spacing(5),
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
Reference in new issue
Block a user