From c14577cd5d97c7541054af622f36dd7c8a3cc788 Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 6 Nov 2020 12:54:13 +0100 Subject: [PATCH 1/3] new app events --- resources/utils/events.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/utils/events.ts b/resources/utils/events.ts index 0dc62a1..82b1690 100644 --- a/resources/utils/events.ts +++ b/resources/utils/events.ts @@ -59,5 +59,12 @@ export default { NOTE_DELETE_NOTE: 'phone:deleteNote', NOTE_UPDATE_NOTE: 'phone:updateNote', NOTE_UPDATE_NOTE_SUCCESS: 'phone:updateNoteSuccess', - NOTE_UPDATE_NOTE_FAILURE: 'phone:updateNoteFailure' + NOTE_UPDATE_NOTE_FAILURE: 'phone:updateNoteFailure', + + // DO NOT CHANGE WHATS BELOW, PLEASE - CHIP + OPEN_APP_CONTACTS: 'phone:app:CONTACTS', + OPEN_APP_BANK: 'phone:app:BANK', + OPEN_APP_NOTES: 'phone:app:NOTES', + OPEN_APP_LISTINGS: 'phone:app:SELLOUT' + } From e21c52c28999b1e442be13b905d53f55fffba7ec Mon Sep 17 00:00:00 2001 From: chip Date: Fri, 6 Nov 2020 12:54:41 +0100 Subject: [PATCH 2/3] send app id when pressing on a app --- phone/src/ui/components/AppIcon.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/phone/src/ui/components/AppIcon.tsx b/phone/src/ui/components/AppIcon.tsx index 8b1e4be..2e3f20a 100644 --- a/phone/src/ui/components/AppIcon.tsx +++ b/phone/src/ui/components/AppIcon.tsx @@ -3,6 +3,7 @@ import { makeStyles } from "@material-ui/core/styles"; import Avatar from "@material-ui/core/Avatar"; import { green } from "@material-ui/core/colors"; import { Button } from "@material-ui/core"; +import Nui from "../../os/nui-events/utils/Nui"; interface IStyles { root: any; @@ -28,13 +29,18 @@ const useStyles = makeStyles( }) ); -export const AppIcon = ({ name, icon, backgroundColor, color }) => { +export const AppIcon = ({ id, name, icon, backgroundColor, color }) => { const classes = useStyles({ backgroundColor: backgroundColor || green[50], color: color || green[400], }); + + const openAppCallback = () => { + Nui.send(`phone:app:${id}`) + } + return ( -