mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(phone): overall changes for notes > documents
This commit is contained in:
1 parent
42447e544b
commit
28711c7c5d
4 files changed
+8
-69
No files matched your search
@@ -1,8 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { makeStyles, Paper } from '@material-ui/core';
|
import { makeStyles, Paper } from '@material-ui/core';
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import FolderIcon from '@material-ui/icons/Folder';
|
||||||
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
header: {
|
header: {
|
||||||
@@ -24,7 +23,7 @@ const NotesTitle = () => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Paper elevation={24} square variant="outlined" className={classes.header}>
|
<Paper elevation={24} square variant="outlined" className={classes.header}>
|
||||||
<FontAwesomeIcon icon={faStickyNote} className={classes.icon} size="lg" />
|
<FolderIcon fontSize="large" />
|
||||||
</Paper>
|
</Paper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -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',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
@@ -66,7 +66,7 @@ export const NoteModal = () => {
|
|||||||
startIcon={<ArrowBackIcon fontSize="large" />}
|
startIcon={<ArrowBackIcon fontSize="large" />}
|
||||||
onClick={_handleClose}
|
onClick={_handleClose}
|
||||||
>
|
>
|
||||||
{t('APPS_NOTES')}
|
{t('APPS_DOCUMENTS_NOTES_TITLE')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<TextField
|
<TextField
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { common, yellow } from '@material-ui/core/colors';
|
import { common, yellow } from '@material-ui/core/colors';
|
||||||
|
|
||||||
export const NOTES_APP_PRIMARY_COLOR = yellow[800];
|
export const DOCUMENTS_APP_PRIMARY_COLOR = yellow[800];
|
||||||
export const NOTES_APP_ICON_COLOR = common.white;
|
export const DOCUMENTS_APP_ICON_COLOR = common.white;
|
||||||
export const NOTES_APP_TEXT_COLOR = common.black;
|
export const DOCUMENTS_APP_TEXT_COLOR = common.black;
|
||||||
|
|
||||||
const theme = {
|
const theme = {
|
||||||
palette: {
|
palette: {
|
||||||
primary: {
|
primary: {
|
||||||
main: NOTES_APP_PRIMARY_COLOR,
|
main: DOCUMENTS_APP_PRIMARY_COLOR,
|
||||||
dark: yellow[900],
|
dark: yellow[900],
|
||||||
light: yellow[500],
|
light: yellow[500],
|
||||||
contrastText: NOTES_APP_TEXT_COLOR,
|
contrastText: DOCUMENTS_APP_TEXT_COLOR,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user