tweak(phone): overall changes for notes > documents

This commit is contained in:
Christopher committed 2021-03-16 11:32:47 +01:00
1 parent 42447e544b
commit 28711c7c5d
4 files changed
+8 -69

No files matched your search

@@ -1,8 +1,7 @@
import React from 'react';
import { makeStyles, Paper } from '@material-ui/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
import FolderIcon from '@material-ui/icons/Folder';
const useStyles = makeStyles((theme) => ({
header: {
@@ -24,7 +23,7 @@ const NotesTitle = () => {
const classes = useStyles();
return (
<Paper elevation={24} square variant="outlined" className={classes.header}>
<FontAwesomeIcon icon={faStickyNote} className={classes.icon} size="lg" />
<FolderIcon fontSize="large" />
</Paper>
);
};
-60
View File
@@ -1,60 +0,0 @@
import React from 'react';
import { AppWrapper } from '../../ui/components/AppWrapper';
import { AppContent } from '../../ui/components/AppContent';
import { AppTitle } from '../../ui/components/AppTitle';
import { useApp } from '../../os/apps/hooks/useApps';
import NoteList from './list/NoteList';
import { NoteModal } from './modal/NoteModal';
import { Fab } from '@material-ui/core';
import AddIcon from '@material-ui/icons/Add';
import { useNoteDetail } from './hooks/useNoteDetail';
import useStyles from './notes.styles';
import InjectDebugData from '../../os/debug/InjectDebugData';
import { NotesThemeProvider } from './providers/NotesThemeProvider';
import { Route, useHistory } from 'react-router-dom';
export const NotesApp = () => {
const classes = useStyles();
const history = useHistory();
const notesApp = useApp('NOTES');
const { setDetail } = useNoteDetail();
const onClickCreate = () => {
setDetail({ title: '', content: '' });
history.push('/notes/detail');
};
return (
<NotesThemeProvider>
<AppWrapper id="notes-app">
<AppTitle app={notesApp} />
<Route path="/notes/detail" component={NoteModal} />
<AppContent>
<Route path="/notes" component={NoteList} />
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
<AddIcon />
</Fab>
</AppContent>
</AppWrapper>
</NotesThemeProvider>
);
};
InjectDebugData([
{
app: 'NOTES',
method: 'setNotes',
data: [
{
id: 1,
title: 'First note',
content: 'Hello, this is my shitty note',
},
{
id: 2,
title: 'Second note',
content: 'Hello, this is another shitty note',
},
],
},
]);
+1 -1
View File
@@ -66,7 +66,7 @@ export const NoteModal = () => {
startIcon={<ArrowBackIcon fontSize="large" />}
onClick={_handleClose}
>
{t('APPS_NOTES')}
{t('APPS_DOCUMENTS_NOTES_TITLE')}
</Button>
</Box>
<TextField
+5 -5
View File
@@ -1,16 +1,16 @@
import { common, yellow } from '@material-ui/core/colors';
export const NOTES_APP_PRIMARY_COLOR = yellow[800];
export const NOTES_APP_ICON_COLOR = common.white;
export const NOTES_APP_TEXT_COLOR = common.black;
export const DOCUMENTS_APP_PRIMARY_COLOR = yellow[800];
export const DOCUMENTS_APP_ICON_COLOR = common.white;
export const DOCUMENTS_APP_TEXT_COLOR = common.black;
const theme = {
palette: {
primary: {
main: NOTES_APP_PRIMARY_COLOR,
main: DOCUMENTS_APP_PRIMARY_COLOR,
dark: yellow[900],
light: yellow[500],
contrastText: NOTES_APP_TEXT_COLOR,
contrastText: DOCUMENTS_APP_TEXT_COLOR,
},
},
};