From 7bafa7d5185849479f7c1f0278595b77e6611e35 Mon Sep 17 00:00:00 2001 From: J Francisco Rader Date: Sun, 14 Feb 2021 13:40:57 -0500 Subject: [PATCH] I make phone work (#89) --- .../components/views/ContactsPage.tsx | 2 -- .../apps/example/components/ExampleApp.tsx | 4 +--- phone/src/apps/notes/NotesApp.tsx | 22 +++++++++---------- phone/src/apps/notes/hooks/useNotesService.ts | 6 ++--- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/phone/src/apps/contacts/components/views/ContactsPage.tsx b/phone/src/apps/contacts/components/views/ContactsPage.tsx index 49644c6..0694239 100644 --- a/phone/src/apps/contacts/components/views/ContactsPage.tsx +++ b/phone/src/apps/contacts/components/views/ContactsPage.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { ContactList } from '../List/ContactList'; import Fab from '@material-ui/core/Fab'; import PersonAddIcon from '@material-ui/icons/PersonAdd'; -import { ContactAlert } from '../alert/ContactAlert'; import { useHistory } from 'react-router-dom'; import { makeStyles, Theme } from '@material-ui/core/styles'; @@ -33,7 +32,6 @@ export const ContactPage = () => { > - ); }; diff --git a/phone/src/apps/example/components/ExampleApp.tsx b/phone/src/apps/example/components/ExampleApp.tsx index a5c3dc1..ca6e58e 100644 --- a/phone/src/apps/example/components/ExampleApp.tsx +++ b/phone/src/apps/example/components/ExampleApp.tsx @@ -1,12 +1,9 @@ import React from 'react'; import { AppWrapper } from '../../../ui/components'; -import { AppTitle } from '../../../ui/components/AppTitle'; import { AppContent } from '../../../ui/components/AppContent'; import { useApp } from '../../../os/apps/hooks/useApps'; import { useExample } from '../hooks/useExample'; -import { useSnackbar } from '../../../ui/hooks/useSnackbar'; -import SnackbarProvider from '../../../ui/components/SnackbarProvider'; export const ExampleApp = () => { // calling the example hook, and we assign the value to a variable @@ -17,6 +14,7 @@ export const ExampleApp = () => {

This is an example

+

{example.id}

{/* Here we are using the value in a h3 tag */}

{exampleString}

diff --git a/phone/src/apps/notes/NotesApp.tsx b/phone/src/apps/notes/NotesApp.tsx index 8a880e8..face916 100644 --- a/phone/src/apps/notes/NotesApp.tsx +++ b/phone/src/apps/notes/NotesApp.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React from 'react'; import { AppWrapper } from '../../ui/components/AppWrapper'; import { AppContent } from '../../ui/components/AppContent'; import { AppTitle } from '../../ui/components/AppTitle'; @@ -32,7 +32,7 @@ InjectDebugData([ content: 'Hello, this is another shitty note', }, ], - } + }, ]); export const NotesApp = () => { @@ -56,15 +56,15 @@ export const NotesApp = () => { - - + className={classes.absolute} + onClick={handleModal} + style={{ + background: '#f9a825', + color: '#fff', + }} + > + +
); }; diff --git a/phone/src/apps/notes/hooks/useNotesService.ts b/phone/src/apps/notes/hooks/useNotesService.ts index dfe627b..88156b8 100644 --- a/phone/src/apps/notes/hooks/useNotesService.ts +++ b/phone/src/apps/notes/hooks/useNotesService.ts @@ -1,5 +1,3 @@ - -import { createContext, useCallback } from 'react'; import { useSetRecoilState } from 'recoil'; import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent'; import { useNotes } from './useNotes'; @@ -7,10 +5,10 @@ import { noteStates } from './state'; import { useSnackbar } from '../../../ui/hooks/useSnackbar'; export const useNotesService = () => { - const { addAlert } = useSnackbar() + const { addAlert } = useSnackbar(); const setNotes = useSetRecoilState(noteStates.noteItems); useNuiEvent('NOTES', 'setNotes', setNotes); - useNuiEvent('NOTES', 'setAlert', addAlert) + useNuiEvent('NOTES', 'setAlert', addAlert); return useNotes(); };