diff --git a/phone/src/apps/notes/NotesApp.tsx b/phone/src/apps/notes/NotesApp.tsx index 7186f0c..c730344 100644 --- a/phone/src/apps/notes/NotesApp.tsx +++ b/phone/src/apps/notes/NotesApp.tsx @@ -15,6 +15,7 @@ import { useNoteDetail } from './hooks/useNoteDetail'; import useStyles from './notes.styles'; import InjectDebugData from '../../os/debug/InjectDebugData'; +import { NotesAlert } from './alert/NotesAlert'; InjectDebugData([ { @@ -32,7 +33,7 @@ InjectDebugData([ content: 'Hello, this is another shitty note', }, ], - }, + } ]); export const NotesApp = () => { @@ -65,6 +66,7 @@ export const NotesApp = () => { + ); }; diff --git a/phone/src/apps/notes/modal/NoteModal.tsx b/phone/src/apps/notes/modal/NoteModal.tsx index fb75c6e..c3c3a42 100644 --- a/phone/src/apps/notes/modal/NoteModal.tsx +++ b/phone/src/apps/notes/modal/NoteModal.tsx @@ -1,5 +1,5 @@ import { Button, TextField, Slide } from '@material-ui/core'; -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import { useNoteModal } from '../hooks/useNoteModal'; @@ -14,11 +14,12 @@ import Nui from '../../../os/nui-events/utils/Nui'; export const NoteModal = () => { const { noteModal, setNoteModal } = useNoteModal(); const { detail, setDetail } = useNoteDetail(); - console.log(detail); const [title, setTitle] = useState(detail ? detail.title : ''); const [content, setContent] = useState(detail ? detail.content : ''); - const classes = useStyles(); + const classes = useStyles() + + const _handleClose = () => { setNoteModal(false); @@ -26,12 +27,14 @@ export const NoteModal = () => { }; const handleNoteSave = () => { + setNoteModal(false); setDetail(null); Nui.send('phone:addNote', { title, content, }); + setDetail(null) }; const handleDeleteNote = () => { @@ -63,6 +66,7 @@ export const NoteModal = () => {
{ className={classes.input} inputProps={{ className: classes.inputPropsContent, + maxLength: 250, }} placeholder='Content' multiline @@ -84,8 +89,9 @@ export const NoteModal = () => { value={content} onChange={(e) => setContent(e.target.value)} /> - {!detail && ( - )}