mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Merge branch 'master' of github.com:Re-Ignited-Development/new-phone-who-dis into feature/messages
This commit is contained in:
commit
b87baeb12e
52 files changed
+1185
-181
No files matched your search
+4
-1
@@ -9,7 +9,7 @@
|
|||||||
"DestroyPhoneReCheck": 3,
|
"DestroyPhoneReCheck": 3,
|
||||||
"notificationPosition": {
|
"notificationPosition": {
|
||||||
"horizontal": "right",
|
"horizontal": "right",
|
||||||
"vertical": "bottom"
|
"vertical": "top"
|
||||||
},
|
},
|
||||||
"twitter": {
|
"twitter": {
|
||||||
"showNotifications": true,
|
"showNotifications": true,
|
||||||
@@ -22,5 +22,8 @@
|
|||||||
"enableEmojis": true,
|
"enableEmojis": true,
|
||||||
"enableImages": true,
|
"enableImages": true,
|
||||||
"maxImages": 3
|
"maxImages": 3
|
||||||
|
},
|
||||||
|
"bank": {
|
||||||
|
"showNotifications": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,9 @@
|
|||||||
top: 100px;
|
top: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
background-position: center;
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
.PhoneAppContainer {
|
.PhoneAppContainer {
|
||||||
|
|||||||
+39
-48
@@ -21,6 +21,7 @@ import { useTwitterService } from "./apps/twitter/hooks/useTwitterService";
|
|||||||
import { useSelloutService } from "./apps/sellout/hooks/useSelloutService";
|
import { useSelloutService } from "./apps/sellout/hooks/useSelloutService";
|
||||||
import { useBankService } from './apps/bank/hooks/useBankService';
|
import { useBankService } from './apps/bank/hooks/useBankService';
|
||||||
import { useMessagesService } from "./apps/messages/hooks/useMessageService";
|
import { useMessagesService } from "./apps/messages/hooks/useMessageService";
|
||||||
|
import { useNotesService } from "./apps/notes/hooks/useNotesService";
|
||||||
|
|
||||||
//These events are just for testing. Comment it out before building.
|
//These events are just for testing. Comment it out before building.
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -39,21 +40,31 @@ setTimeout(() => {
|
|||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent("message", {
|
||||||
data: {
|
data: {
|
||||||
app: "MESSAGES",
|
app: "PHONE",
|
||||||
method: "setConversations",
|
method: "setVisibility",
|
||||||
|
data: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
window.dispatchEvent(
|
||||||
|
new MessageEvent("message", {
|
||||||
|
data: {
|
||||||
|
app: 'NOTES',
|
||||||
|
method: 'setNotes',
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'rocky'
|
title: 'First note',
|
||||||
|
content: 'Hello, this is my shitty note'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: 'ark'
|
title: 'Second note',
|
||||||
|
content: 'Hello, this is another shitty note'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: 'kire'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -61,39 +72,30 @@ setTimeout(() => {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
new MessageEvent("messsage", {
|
||||||
new MessageEvent("message", {
|
data: {
|
||||||
|
app: "BANK",
|
||||||
|
method: "setNotification",
|
||||||
data: {
|
data: {
|
||||||
app: "MESSAGES",
|
|
||||||
method: "setMessages",
|
|
||||||
data: [
|
|
||||||
{
|
|
||||||
id: 1,
|
id: 1,
|
||||||
sender: 'chip',
|
message: "ahhaha"
|
||||||
receiver: 'rocky',
|
|
||||||
sms: 'Hello there',
|
|
||||||
owner: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
sender: 'chip',
|
|
||||||
receiver: 'depo',
|
|
||||||
sms: 'Hello man',
|
|
||||||
owner: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
sender: 'rocky',
|
|
||||||
receiver: 'kire',
|
|
||||||
sms: 'Hello dude',
|
|
||||||
owner: 1
|
|
||||||
}
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
}, 1000)
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
new MessageEvent("messsage", {
|
||||||
|
data: {
|
||||||
|
app: "TWITTER",
|
||||||
|
method: "setNotification",
|
||||||
|
data: {
|
||||||
|
id: 1,
|
||||||
|
message: "ahhaha"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
@@ -170,7 +172,7 @@ setTimeout(() => {
|
|||||||
id: 1,
|
id: 1,
|
||||||
number: "345-4366",
|
number: "345-4366",
|
||||||
display: "chip",
|
display: "chip",
|
||||||
avatar: 'https://i.imgur.com/Qpw6j8D.png'
|
avatar: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Rotating_earth_%28large%29.gif/200px-Rotating_earth_%28large%29.gif'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
@@ -190,18 +192,6 @@ setTimeout(() => {
|
|||||||
);
|
);
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
window.dispatchEvent(
|
|
||||||
new MessageEvent("message", {
|
|
||||||
data: {
|
|
||||||
app: "PHONE",
|
|
||||||
method: "setVisibility",
|
|
||||||
data: true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.dispatchEvent(
|
window.dispatchEvent(
|
||||||
new MessageEvent("message", {
|
new MessageEvent("message", {
|
||||||
@@ -244,6 +234,7 @@ function Phone() {
|
|||||||
useSelloutService();
|
useSelloutService();
|
||||||
useBankService();
|
useBankService();
|
||||||
useMessagesService()
|
useMessagesService()
|
||||||
|
useNotesService();
|
||||||
|
|
||||||
if (visibility === false) {
|
if (visibility === false) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -31,6 +31,11 @@
|
|||||||
color: #388CF8 !important;
|
color: #388CF8 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#bank-app .MuiSnackbar-root {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
#bank-title {
|
#bank-title {
|
||||||
font-family: 'Bebas Neue', cursive;
|
font-family: 'Bebas Neue', cursive;
|
||||||
font-size: 50px;
|
font-size: 50px;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { NavigationBar } from "./navigation/NavigationBar";
|
|||||||
import { BankHome } from './home/BankHome';
|
import { BankHome } from './home/BankHome';
|
||||||
import { BankAccount } from './account/BankAccount';
|
import { BankAccount } from './account/BankAccount';
|
||||||
import { TransactionList } from "./transactions/TransactionList";
|
import { TransactionList } from "./transactions/TransactionList";
|
||||||
|
import { BankAlert } from "./alert/BankAlert";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -67,6 +68,7 @@ export const BankApp = () => {
|
|||||||
<Route path="/bank/account" exact component={BankAccount} />
|
<Route path="/bank/account" exact component={BankAccount} />
|
||||||
<Route path="/bank/transactions" exact component={TransactionList} />
|
<Route path="/bank/transactions" exact component={TransactionList} />
|
||||||
</Switch>
|
</Switch>
|
||||||
|
<BankAlert />
|
||||||
</AppContent>
|
</AppContent>
|
||||||
<NavigationBar />
|
<NavigationBar />
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import React from "react";
|
||||||
|
import MuiAlert from "@material-ui/lab/Alert";
|
||||||
|
|
||||||
|
export function Alert(props) {
|
||||||
|
return <MuiAlert elevation={6} variant="filled" {...props} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Alert;
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { useBankAlert } from "../../hooks/useBankAlert";
|
||||||
|
import Snackbar from "@material-ui/core/Snackbar";
|
||||||
|
import Alert from "./Alert";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
export const BankAlert = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const { bankAlert, setBankAlert } = useBankAlert();
|
||||||
|
const [ message, setMessage ] = useState(null);
|
||||||
|
const [severity, setSeverity] = useState("");
|
||||||
|
|
||||||
|
const _handleClose = () => {
|
||||||
|
setOpen(false);
|
||||||
|
setBankAlert(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (bankAlert === true ) {
|
||||||
|
setOpen(true);
|
||||||
|
setMessage(t("APPS_BANK_ALERT_TRANSFER_SUCCESS"));
|
||||||
|
setSeverity("success")
|
||||||
|
} else if (bankAlert === false) {
|
||||||
|
setOpen(true);
|
||||||
|
setMessage(t("APPS_BANK_ALERT_TRANSFER_FAILURE"));
|
||||||
|
setSeverity("error")
|
||||||
|
}
|
||||||
|
}, [bankAlert])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Snackbar
|
||||||
|
style={{ width: "80%" }}
|
||||||
|
open={open}
|
||||||
|
autoHideDuration={6000}
|
||||||
|
onClose={_handleClose}
|
||||||
|
>
|
||||||
|
<Alert onClose={_handleClose} severity={severity}>
|
||||||
|
{message}
|
||||||
|
</Alert>
|
||||||
|
</Snackbar>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -1,16 +1,45 @@
|
|||||||
import React from 'react'
|
import React, { useEffect, useState } from "react";
|
||||||
import Alert from '@material-ui/lab/Alert';
|
import Notification from "../../../../ui/components/Notification";
|
||||||
import Notification from '../../../../ui/components/Notification';
|
import { usePhone } from "../../../../os/phone/hooks/usePhone";
|
||||||
import { useBankAlert } from './../../hooks/useBankAlert';
|
import { useTranslation } from "react-i18next";
|
||||||
|
import useStyles from './notification.style';
|
||||||
|
import { useBankNotification } from "../../hooks/useBankNotification";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { faWonSign } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
export const BankNotification = ({ alert }) => {
|
export const BankNotification = () => {
|
||||||
const { setBankAlert } = useBankAlert();
|
const { notification } = useBankNotification()
|
||||||
|
const classes = useStyles()
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [visible, setVisible ] = useState(false);
|
||||||
|
const { config } = usePhone()
|
||||||
|
|
||||||
const handleClose = () => {
|
useEffect(() => {
|
||||||
setBankAlert(false)
|
if (notification) {
|
||||||
|
setVisible(true);
|
||||||
}
|
}
|
||||||
|
}, [notification?.id])
|
||||||
|
|
||||||
|
if (!config?.bank.showNotifications || !notification) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div></div>
|
<Notification
|
||||||
|
key={notification.id}
|
||||||
|
open={visible}
|
||||||
|
handleClose={() => setVisible(false)}
|
||||||
|
>
|
||||||
|
<div className={classes.content}>
|
||||||
|
<div className={classes.title}>
|
||||||
|
<div className={classes.titleLeft}>
|
||||||
|
<div className={classes.icon}>
|
||||||
|
<FontAwesomeIcon icon={faWonSign} />
|
||||||
|
</div>
|
||||||
|
<div className={classes.heading}>{notification.type}</div>
|
||||||
|
</div>
|
||||||
|
<div className={classes.justNow}>{t("APPS_BANK_TIME_JUST_NOW")}</div>
|
||||||
|
</div>
|
||||||
|
<div className={classes.message}>{notification.source} sent you ${notification.transferAmount}. <br></br> {notification.message}</div>
|
||||||
|
</div>
|
||||||
|
</Notification>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
|
createStyles({
|
||||||
|
content: {
|
||||||
|
padding: theme.spacing(2),
|
||||||
|
overflowY: 'hidden'
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
display: "flex",
|
||||||
|
flexFlow: "row nowrap",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
titleLeft: {
|
||||||
|
display: "flex",
|
||||||
|
flexFlow: "row nowrap",
|
||||||
|
justifyContent: "flex-start",
|
||||||
|
alignItems: "center",
|
||||||
|
},
|
||||||
|
icon: {
|
||||||
|
marginTop: "3px",
|
||||||
|
marginRight: "5px",
|
||||||
|
},
|
||||||
|
heading: {
|
||||||
|
marginBottom: "3px",
|
||||||
|
},
|
||||||
|
justNow: {
|
||||||
|
fontSize: "18px",
|
||||||
|
fontStyle: "italic",
|
||||||
|
paddingRight: "3px",
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
fontSize: "16px",
|
||||||
|
overflow: "hidden",
|
||||||
|
display: "-webkit-box",
|
||||||
|
WebkitLineClamp: 2,
|
||||||
|
WebkitBoxOrient: "vertical",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
export default useStyles;
|
||||||
@@ -6,6 +6,7 @@ import CloseIcon from '@material-ui/icons/Close';
|
|||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
import { useBankModal} from '../../hooks/useBankModal';
|
import { useBankModal} from '../../hooks/useBankModal';
|
||||||
|
import { Message } from '@material-ui/icons';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
input: {
|
input: {
|
||||||
@@ -50,15 +51,13 @@ export const TransferModal = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const addTransfer = () => {
|
const addTransfer = () => {
|
||||||
|
const transferAmount = parseInt(amount);
|
||||||
Nui.send('phone:addTransfer', {
|
Nui.send('phone:addTransfer', {
|
||||||
targetID,
|
targetID,
|
||||||
amount,
|
transferAmount,
|
||||||
message
|
message
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
|
||||||
setShowBankModal(false)
|
setShowBankModal(false)
|
||||||
}, 200)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -9,12 +9,16 @@ export const bankState = {
|
|||||||
key: 'modalVisibility',
|
key: 'modalVisibility',
|
||||||
default: false,
|
default: false,
|
||||||
}),
|
}),
|
||||||
bankAlert: atom({
|
transferSuccessful: atom({
|
||||||
key: 'bankAlert',
|
key: 'bankAlert',
|
||||||
default: false
|
default: null
|
||||||
}),
|
}),
|
||||||
bankCredentials: atom({
|
bankCredentials: atom({
|
||||||
key: 'bankCredentails',
|
key: 'bankCredentails',
|
||||||
default: null
|
default: null
|
||||||
|
}),
|
||||||
|
notification: atom({
|
||||||
|
key: 'bankNotification',
|
||||||
|
default: null
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { useRecoilState } from 'recoil';
|
import { useRecoilState } from 'recoil';
|
||||||
import { bankState } from './state';
|
import { bankState } from './state';
|
||||||
|
|
||||||
export const useBankAlert = () => {
|
export const useBankAlert = (): any => {
|
||||||
const [ bankAlert, setBankAlert ] = useRecoilState(bankState.bankAlert);
|
const [ bankAlert, setBankAlert ] = useRecoilState(bankState.transferSuccessful);
|
||||||
return { bankAlert, setBankAlert };
|
return { bankAlert, setBankAlert };
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
|
||||||
|
import { Transfer } from '../../../common/interfaces/bank';
|
||||||
|
import { bankState } from './state';
|
||||||
|
|
||||||
|
interface IBankNotification {
|
||||||
|
notification: Transfer | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useBankNotification = (): IBankNotification => {
|
||||||
|
const notification = useRecoilValue<Transfer | null>(bankState.notification);
|
||||||
|
return { notification }
|
||||||
|
}
|
||||||
@@ -2,12 +2,21 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
|||||||
import { bankState } from './state';
|
import { bankState } from './state';
|
||||||
import { useTransactions } from './useTransactions'
|
import { useTransactions } from './useTransactions'
|
||||||
import { useCredentials } from './useCredentials';
|
import { useCredentials } from './useCredentials';
|
||||||
|
import { useBankAlert } from './useBankAlert';
|
||||||
import { useSetRecoilState } from 'recoil'
|
import { useSetRecoilState } from 'recoil'
|
||||||
|
import { useBankNotification } from './useBankNotification';
|
||||||
|
|
||||||
export const useBankService = () => {
|
export const useBankService = () => {
|
||||||
const setTransaction = useSetRecoilState(bankState.transactions)
|
const setTransaction = useSetRecoilState(bankState.transactions)
|
||||||
const setCredentials = useSetRecoilState(bankState.bankCredentials)
|
const setCredentials = useSetRecoilState(bankState.bankCredentials)
|
||||||
|
const setAlertMessage = useSetRecoilState(bankState.transferSuccessful)
|
||||||
|
const setNotification = useSetRecoilState(bankState.notification);
|
||||||
|
|
||||||
|
///
|
||||||
|
|
||||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
||||||
useNuiEvent('BANK', 'setCredentials', setCredentials)
|
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
||||||
return {useTransactions, useCredentials};
|
useNuiEvent('BANK', 'setAlert', setAlertMessage);
|
||||||
|
useNuiEvent('BANK', 'setNotification', setNotification);
|
||||||
|
return { useTransactions, useCredentials, useBankAlert, useBankNotification };
|
||||||
}
|
}
|
||||||
@@ -8,9 +8,11 @@ import { useApp } from "../../../os/apps/hooks/useApps";
|
|||||||
import { AddContactModal } from "./ContactModal";
|
import { AddContactModal } from "./ContactModal";
|
||||||
import { useModal } from "../hooks/useModal";
|
import { useModal } from "../hooks/useModal";
|
||||||
import { SearchContacts } from "./List/SearchContacts";
|
import { SearchContacts } from "./List/SearchContacts";
|
||||||
import PersonAddIcon from '@material-ui/icons/PersonAdd'
|
import PersonAddIcon from "@material-ui/icons/PersonAdd";
|
||||||
import Fab from '@material-ui/core/Fab';
|
import Fab from "@material-ui/core/Fab";
|
||||||
import { useContactModal } from '../hooks/useContactModal';
|
import { useContactModal } from "../hooks/useContactModal";
|
||||||
|
import { InfoModal } from "./modal/InfoModal";
|
||||||
|
import { useContactDetail } from "../hooks/useContactDetail";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
@@ -36,7 +38,7 @@ export const ContactsApp = () => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { showModal, setShowModal } = useModal();
|
const { showModal, setShowModal } = useModal();
|
||||||
const contacts = useApp("CONTACTS");
|
const contacts = useApp("CONTACTS");
|
||||||
const { showContactModal } = useContactModal();
|
const { contactDetail } = useContactDetail();
|
||||||
|
|
||||||
const openModal = () => {
|
const openModal = () => {
|
||||||
setShowModal(true);
|
setShowModal(true);
|
||||||
@@ -47,6 +49,7 @@ export const ContactsApp = () => {
|
|||||||
<AppTitle app={contacts}></AppTitle>
|
<AppTitle app={contacts}></AppTitle>
|
||||||
<SearchContacts />
|
<SearchContacts />
|
||||||
<AddContactModal />
|
<AddContactModal />
|
||||||
|
<InfoModal key={contactDetail?.id} />
|
||||||
<div className={showModal ? classes.backgroundModal : undefined} />
|
<div className={showModal ? classes.backgroundModal : undefined} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<ContactList />
|
<ContactList />
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
ListItem,
|
ListItem,
|
||||||
TextField,
|
TextField,
|
||||||
Collapse,
|
Collapse,
|
||||||
makeStyles
|
makeStyles,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
|
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
@@ -18,39 +18,43 @@ import { useFilteredContacts } from "../../hooks/useFilteredContacts";
|
|||||||
|
|
||||||
import PhoneIcon from "@material-ui/icons/Phone";
|
import PhoneIcon from "@material-ui/icons/Phone";
|
||||||
import ChatIcon from "@material-ui/icons/Chat";
|
import ChatIcon from "@material-ui/icons/Chat";
|
||||||
|
import MoreVertIcon from "@material-ui/icons/MoreVert";
|
||||||
import { useContacts } from "../../hooks/useContacts";
|
import { useContacts } from "../../hooks/useContacts";
|
||||||
import { useContactModal } from '../../hooks/useContactModal';
|
import { useContactModal } from "../../hooks/useContactModal";
|
||||||
|
import { useContactDetail } from "../../hooks/useContactDetail";
|
||||||
|
|
||||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
import "../Contact.css"
|
import "../Contact.css";
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
updateButton: {
|
updateButton: {
|
||||||
margin: 'auto',
|
margin: "auto",
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
width: 150,
|
width: 150,
|
||||||
background: "#2196f3",
|
background: "#2196f3",
|
||||||
marginBottom: 10,
|
marginBottom: 10,
|
||||||
padding: 8
|
padding: 8,
|
||||||
},
|
},
|
||||||
collapseItem: {
|
collapseItem: {
|
||||||
margin: 'auto',
|
margin: "auto",
|
||||||
width: '50%'
|
width: "50%",
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
|
|
||||||
export const ContactList = () => {
|
export const ContactList = () => {
|
||||||
const classes = useStyles()
|
const classes = useStyles();
|
||||||
const { filteredContacts } = useFilteredContacts();
|
const { filteredContacts } = useFilteredContacts();
|
||||||
const { showContactModal, setShowContactModal } = useContactModal();
|
const { setShowContactModal } = useContactModal();
|
||||||
|
const { contactDetail, setContactDetail } = useContactDetail();
|
||||||
|
|
||||||
const contacts = useContacts();
|
const contacts = useContacts();
|
||||||
|
|
||||||
const openContactInfo = () => {
|
const openContactInfo = (contact) => {
|
||||||
setShowContactModal(!showContactModal);
|
setShowContactModal(true);
|
||||||
}
|
setContactDetail(contact);
|
||||||
|
console.log("CONTACT", contactDetail);
|
||||||
|
};
|
||||||
const startCall = (number) => {
|
const startCall = (number) => {
|
||||||
console.log(number);
|
console.log(number);
|
||||||
Nui.send("phone:startCall", {
|
Nui.send("phone:startCall", {
|
||||||
@@ -60,17 +64,28 @@ export const ContactList = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<List>
|
<List>
|
||||||
{contacts.contacts.filter(contact => contact.display.includes(filteredContacts) || contact.number.includes(filteredContacts)).map((contact) => (
|
{contacts.contacts
|
||||||
|
.filter(
|
||||||
|
(contact) =>
|
||||||
|
contact.display.includes(filteredContacts) ||
|
||||||
|
contact.number.includes(filteredContacts)
|
||||||
|
)
|
||||||
|
.map((contact) => (
|
||||||
<>
|
<>
|
||||||
<ListItem key={contact.id} divider>
|
<ListItem key={contact.id} divider>
|
||||||
<ListItemAvatar>
|
<ListItemAvatar>
|
||||||
{contact.avatar ? (
|
{contact.avatar ? (
|
||||||
<MuiAvatar src={contact.avatar} />
|
<MuiAvatar src={contact.avatar} />
|
||||||
): (
|
) : (
|
||||||
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
|
<MuiAvatar>
|
||||||
|
{contact.display.slice(0, 1).toUpperCase()}
|
||||||
|
</MuiAvatar>
|
||||||
)}
|
)}
|
||||||
</ListItemAvatar>
|
</ListItemAvatar>
|
||||||
<ListItemText primary={contact.display} secondary={contact.number} />
|
<ListItemText
|
||||||
|
primary={contact.display}
|
||||||
|
secondary={contact.number}
|
||||||
|
/>
|
||||||
<Button onClick={() => startCall(contact.number)}>
|
<Button onClick={() => startCall(contact.number)}>
|
||||||
<PhoneIcon />
|
<PhoneIcon />
|
||||||
</Button>
|
</Button>
|
||||||
@@ -81,29 +96,13 @@ export const ContactList = () => {
|
|||||||
>
|
>
|
||||||
<ChatIcon />
|
<ChatIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={openContactInfo}>
|
<Button
|
||||||
<FontAwesomeIcon icon={faPen} size="lg"/>
|
style={{ margin: -15 }}
|
||||||
|
onClick={() => openContactInfo(contact)}
|
||||||
|
>
|
||||||
|
<MoreVertIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<Collapse in={showContactModal} timeout="auto" unmountOnExit>
|
|
||||||
<List component="div" disablePadding>
|
|
||||||
<ListItem className={classes.collapseItem}>
|
|
||||||
<TextField
|
|
||||||
value={contact.display}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem className={classes.collapseItem}>
|
|
||||||
<TextField
|
|
||||||
value={contact.number}
|
|
||||||
/>
|
|
||||||
</ListItem>
|
|
||||||
<ListItem className={classes.collapseItem}>
|
|
||||||
<Button className={classes.updateButton}>
|
|
||||||
Update contact
|
|
||||||
</Button>
|
|
||||||
</ListItem>
|
|
||||||
</List>
|
|
||||||
</Collapse>
|
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import {
|
||||||
|
Paper,
|
||||||
|
Slide,
|
||||||
|
Button,
|
||||||
|
TextField,
|
||||||
|
Avatar as MuiAvatar,
|
||||||
|
} from "@material-ui/core";
|
||||||
|
import useStyles from "./modal.styles";
|
||||||
|
import { useContactModal } from "../../hooks/useContactModal";
|
||||||
|
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||||
|
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { useContactDetail } from "../../hooks/useContactDetail";
|
||||||
|
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
|
export const InfoModal = () => {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { showContactModal, setShowContactModal } = useContactModal();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { contactDetail, setContactDetail } = useContactDetail();
|
||||||
|
|
||||||
|
const [display, setDisplay] = useState(
|
||||||
|
contactDetail ? contactDetail.display : ""
|
||||||
|
);
|
||||||
|
console.log(contactDetail);
|
||||||
|
const [number, setNumber] = useState(
|
||||||
|
contactDetail ? contactDetail.number : ""
|
||||||
|
);
|
||||||
|
const [avatar, setAvatar] = useState(
|
||||||
|
contactDetail ? contactDetail.avatar : ""
|
||||||
|
);
|
||||||
|
|
||||||
|
const closeModal = () => {
|
||||||
|
setShowContactModal(false);
|
||||||
|
setContactDetail(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateContact = () => {
|
||||||
|
Nui.send("phone:updateContact", {
|
||||||
|
id: contactDetail.id,
|
||||||
|
display,
|
||||||
|
number,
|
||||||
|
avatar,
|
||||||
|
});
|
||||||
|
setContactDetail(null);
|
||||||
|
setShowContactModal(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteContact = () => {
|
||||||
|
Nui.send("phone:deleteContact", {
|
||||||
|
id: contactDetail.id,
|
||||||
|
});
|
||||||
|
setContactDetail(null);
|
||||||
|
setShowContactModal(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Slide direction="up" in={showContactModal}>
|
||||||
|
<Paper
|
||||||
|
className={showContactModal ? classes.modalRoot : classes.modalHide}
|
||||||
|
>
|
||||||
|
<Button style={{ margin: 10 }} onClick={closeModal}>
|
||||||
|
<ArrowBackIcon />
|
||||||
|
</Button>
|
||||||
|
<div className={classes.listContainer}>
|
||||||
|
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||||
|
<TextField
|
||||||
|
className={classes.input}
|
||||||
|
value={display}
|
||||||
|
onChange={(e) => setDisplay(e.target.value)}
|
||||||
|
placeholder={t("APPS_CONTACT_FORM_NAME")}
|
||||||
|
fullWidth
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputProps,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
className={classes.input}
|
||||||
|
value={number}
|
||||||
|
onChange={(e) => setNumber(e.target.value)}
|
||||||
|
placeholder={t("APPS_CONTACT_FORM_NUMBER")}
|
||||||
|
fullWidth
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputProps,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
className={classes.input}
|
||||||
|
placeholder={t("APPS_CONTACT_FORM_AVATAR")}
|
||||||
|
fullWidth
|
||||||
|
value={avatar}
|
||||||
|
onChange={(e) => setAvatar(e.target.value)}
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputProps,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div style={{ display: "block" }}>
|
||||||
|
<Button onClick={updateContact} className={classes.updateButton}>
|
||||||
|
Update
|
||||||
|
</Button>
|
||||||
|
<Button onClick={deleteContact} className={classes.deleteButton}>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Paper>
|
||||||
|
</Slide>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
modalRoot: {
|
||||||
|
zIndex: 10,
|
||||||
|
position: 'absolute',
|
||||||
|
height: '100%',
|
||||||
|
width: '100%'
|
||||||
|
},
|
||||||
|
modalHide: {
|
||||||
|
display: 'none'
|
||||||
|
},
|
||||||
|
listContainer: {
|
||||||
|
marginTop: 30,
|
||||||
|
width: '75%',
|
||||||
|
margin: '0 auto',
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
|
avatar: {
|
||||||
|
margin: 'auto',
|
||||||
|
height: '125px',
|
||||||
|
width: '124px',
|
||||||
|
marginBottom: 29
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
marginBottom: 20,
|
||||||
|
margin: 'auto',
|
||||||
|
textAlign: 'center',
|
||||||
|
},
|
||||||
|
inputProps: {
|
||||||
|
fontSize: 22
|
||||||
|
},
|
||||||
|
updateButton: {
|
||||||
|
background: '#2196f3',
|
||||||
|
width: 150,
|
||||||
|
height: 45,
|
||||||
|
fontSize: 16,
|
||||||
|
marginTop: 29,
|
||||||
|
marginBottom: 29
|
||||||
|
},
|
||||||
|
deleteButton: {
|
||||||
|
background: '#d32f2f',
|
||||||
|
width: 150,
|
||||||
|
height: 40,
|
||||||
|
fontSize: 16
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
export default useStyles;
|
||||||
@@ -16,5 +16,9 @@ export const contactsState = {
|
|||||||
showContactsModal: atom({
|
showContactsModal: atom({
|
||||||
key: 'showContactModal',
|
key: 'showContactModal',
|
||||||
default: false
|
default: false
|
||||||
|
}),
|
||||||
|
contactDetail: atom({
|
||||||
|
key: 'contactDetail',
|
||||||
|
default: null
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useRecoilState } from 'recoil';
|
||||||
|
import { contactsState } from './state';
|
||||||
|
|
||||||
|
export const useContactDetail = (): any => {
|
||||||
|
const [ contactDetail, setContactDetail ] = useRecoilState(contactsState.contactDetail);
|
||||||
|
return { contactDetail, setContactDetail };
|
||||||
|
}
|
||||||
@@ -3,12 +3,6 @@ import { useRecoilState, atom } from "recoil";
|
|||||||
const dialerHistoryState = atom({
|
const dialerHistoryState = atom({
|
||||||
key: "dialerHistory",
|
key: "dialerHistory",
|
||||||
default: [
|
default: [
|
||||||
{
|
|
||||||
id: 0,
|
|
||||||
caller: "Kidz",
|
|
||||||
phoneNumber: "000-1111",
|
|
||||||
type: "incoming",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
caller: "ROCKY",
|
caller: "ROCKY",
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
#notes-app .Mui-focused::after {
|
||||||
|
border-bottom: 3px solid #f9a825;
|
||||||
|
}
|
||||||
|
|
||||||
|
#notes-app .MuiOutlinedInput-root {
|
||||||
|
border: 2px soild #f9a825;
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { AppWrapper } from "../../ui/components/AppWrapper";
|
||||||
|
import { AppContent } from "../../ui/components/AppContent";
|
||||||
|
import NotesTitle from "./NotesTitle";
|
||||||
|
import NoteList from "./list/NoteList";
|
||||||
|
|
||||||
|
import { useNotes } from "./hooks/useNotes";
|
||||||
|
import { NoteModal } from "./modal/NoteModal";
|
||||||
|
import { Fab } from "@material-ui/core";
|
||||||
|
import AddIcon from "@material-ui/icons/Add";
|
||||||
|
|
||||||
|
import { useNoteModal } from "./hooks/useNoteModal";
|
||||||
|
import { useNoteDetail } from "./hooks/useNoteDetail";
|
||||||
|
|
||||||
|
import useStyles from "./notes.styles";
|
||||||
|
|
||||||
|
export const NotesApp = () => {
|
||||||
|
const { setNoteModal } = useNoteModal();
|
||||||
|
const { detail, setDetail } = useNoteDetail();
|
||||||
|
const notes = useNotes();
|
||||||
|
|
||||||
|
const classes = useStyles();
|
||||||
|
|
||||||
|
const handleModal = () => {
|
||||||
|
setNoteModal(true);
|
||||||
|
setDetail(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppWrapper id="notes-app">
|
||||||
|
<NotesTitle />
|
||||||
|
<NoteModal key={detail?.id} />
|
||||||
|
<AppContent>
|
||||||
|
<NoteList notes={notes} />
|
||||||
|
<Fab
|
||||||
|
className={classes.absolute}
|
||||||
|
onClick={handleModal}
|
||||||
|
style={{
|
||||||
|
background: "#f9a825",
|
||||||
|
color: "#fff",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AddIcon />
|
||||||
|
</Fab>
|
||||||
|
</AppContent>
|
||||||
|
</AppWrapper>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import { yellow } from "@material-ui/core/colors";
|
||||||
|
|
||||||
|
import useStyles from './notes.styles';
|
||||||
|
|
||||||
|
import { Paper } from "@material-ui/core";
|
||||||
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
|
import { faStickyNote } from "@fortawesome/free-solid-svg-icons";
|
||||||
|
|
||||||
|
const NotesTitle = () => {
|
||||||
|
const classes = useStyles()
|
||||||
|
return (
|
||||||
|
<Paper elevation={24} square variant="outlined" className={classes.header}>
|
||||||
|
<FontAwesomeIcon icon={faStickyNote} color={yellow[800]} size="lg" />
|
||||||
|
</Paper>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NotesTitle;
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { atom } from 'recoil';
|
||||||
|
|
||||||
|
export const noteStates = {
|
||||||
|
noteItems: atom({
|
||||||
|
key: 'noteItem',
|
||||||
|
default: []
|
||||||
|
}),
|
||||||
|
noteModal: atom({
|
||||||
|
key: 'noteModal',
|
||||||
|
default: false
|
||||||
|
}),
|
||||||
|
noteDetail: atom({
|
||||||
|
key: 'noteDetail',
|
||||||
|
default: null
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useRecoilState } from 'recoil';
|
||||||
|
import { noteStates } from './state';
|
||||||
|
|
||||||
|
export const useNoteDetail = (): any => {
|
||||||
|
const [detail, setDetail] = useRecoilState(noteStates.noteDetail);
|
||||||
|
return { detail, setDetail };
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useRecoilState } from 'recoil';
|
||||||
|
import { noteStates } from './state';
|
||||||
|
|
||||||
|
export const useNoteModal = () => {
|
||||||
|
const [noteModal, setNoteModal] = useRecoilState(noteStates.noteModal);
|
||||||
|
return { noteModal, setNoteModal };
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { noteStates } from './state';
|
||||||
|
|
||||||
|
export const useNotes = () => {
|
||||||
|
const notes = useRecoilValue(noteStates.noteItems);
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { useSetRecoilState } from 'recoil'
|
||||||
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
|
import { useNotes } from './useNotes';
|
||||||
|
import { noteStates } from './state';
|
||||||
|
|
||||||
|
export const useNotesService = () => {
|
||||||
|
const setNotes = useSetRecoilState(noteStates.noteItems);
|
||||||
|
useNuiEvent('NOTES', 'setNotes', setNotes);
|
||||||
|
return useNotes();
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { List, ListItem, ListItemText } from '@material-ui/core';
|
||||||
|
import React, { useState } from 'react'
|
||||||
|
|
||||||
|
import { useNoteModal } from '../hooks/useNoteModal';
|
||||||
|
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||||
|
|
||||||
|
// add search bar later
|
||||||
|
const NoteList = ({notes}) => {
|
||||||
|
const { setNoteModal } = useNoteModal();
|
||||||
|
const { setDetail } = useNoteDetail();
|
||||||
|
|
||||||
|
const handleNoteModal = (note) => {
|
||||||
|
setNoteModal(true)
|
||||||
|
setDetail(note)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<List>
|
||||||
|
{notes.map((note) => (
|
||||||
|
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
||||||
|
<ListItemText><strong>{note.title}</strong></ListItemText>
|
||||||
|
</ListItem>
|
||||||
|
))}
|
||||||
|
</List>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NoteList;
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
import {
|
||||||
|
Button,
|
||||||
|
TextField,
|
||||||
|
Slide,
|
||||||
|
} from "@material-ui/core";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||||
|
|
||||||
|
import { useNoteModal } from "../hooks/useNoteModal";
|
||||||
|
import { useNoteDetail } from "../hooks/useNoteDetail";
|
||||||
|
|
||||||
|
import useStyles from "./modal.styles";
|
||||||
|
|
||||||
|
import "../NotesApp.css";
|
||||||
|
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 _handleClose = () => {
|
||||||
|
setNoteModal(false);
|
||||||
|
setDetail(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleNoteSave = () => {
|
||||||
|
setNoteModal(false);
|
||||||
|
setDetail(null);
|
||||||
|
Nui.send("phone:addNote", {
|
||||||
|
title,
|
||||||
|
content,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleDeleteNote = () => {
|
||||||
|
const id = detail.id;
|
||||||
|
setNoteModal(false);
|
||||||
|
Nui.send("phone:deleteNote", {
|
||||||
|
id,
|
||||||
|
});
|
||||||
|
setDetail(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUpdateNote = () => {
|
||||||
|
Nui.send("phone:updateNote", {
|
||||||
|
id: detail.id,
|
||||||
|
title,
|
||||||
|
content,
|
||||||
|
});
|
||||||
|
setNoteModal(false);
|
||||||
|
setDetail(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={noteModal ? classes.modalRoot : classes.modalHide}>
|
||||||
|
<Slide direction="left" in={noteModal} mountOnEnter unmountOnExit>
|
||||||
|
<div>
|
||||||
|
<Button className={classes.closeButton} onClick={_handleClose}>
|
||||||
|
<ArrowBackIcon />
|
||||||
|
</Button>
|
||||||
|
<div id="notes-modal" className={classes.noteContainer}>
|
||||||
|
<TextField
|
||||||
|
className={classes.input}
|
||||||
|
placeholder="Title"
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputPropsTitle,
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
value={title}
|
||||||
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
|
/>
|
||||||
|
<TextField
|
||||||
|
className={classes.input}
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputPropsContent,
|
||||||
|
}}
|
||||||
|
placeholder="Content"
|
||||||
|
multiline
|
||||||
|
fullWidth
|
||||||
|
rows={19}
|
||||||
|
variant="outlined"
|
||||||
|
value={content}
|
||||||
|
onChange={(e) => setContent(e.target.value)}
|
||||||
|
/>
|
||||||
|
{!detail && (
|
||||||
|
<Button className={classes.saveButton} onClick={handleNoteSave}>
|
||||||
|
Save
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
{detail && (
|
||||||
|
<Button
|
||||||
|
className={classes.updateButton}
|
||||||
|
onClick={handleUpdateNote}
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
{detail && (
|
||||||
|
<Button
|
||||||
|
className={classes.deleteButton}
|
||||||
|
onClick={handleDeleteNote}
|
||||||
|
>
|
||||||
|
Delete
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Slide>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
modalRoot: {
|
||||||
|
zIndex: 20,
|
||||||
|
position: "absolute",
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
background: '#232323',
|
||||||
|
},
|
||||||
|
modalHide: {
|
||||||
|
display: 'none'
|
||||||
|
},
|
||||||
|
closeButton: {
|
||||||
|
width: '10%',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 10,
|
||||||
|
left: 0
|
||||||
|
},
|
||||||
|
noteContainer: {
|
||||||
|
width: '90%',
|
||||||
|
marginTop: 80,
|
||||||
|
margin: '0 auto',
|
||||||
|
},
|
||||||
|
input: {
|
||||||
|
marginBottom: 20,
|
||||||
|
},
|
||||||
|
inputPropsTitle: {
|
||||||
|
fontSize: 28,
|
||||||
|
},
|
||||||
|
inputPropsContent: {
|
||||||
|
fontSize: 20,
|
||||||
|
},
|
||||||
|
saveButton: {
|
||||||
|
background: '#f9a825',
|
||||||
|
padding: '10px 30px'
|
||||||
|
},
|
||||||
|
updateButton: {
|
||||||
|
background: '#f9a825',
|
||||||
|
padding: '10px 30px',
|
||||||
|
marginRight: '8px'
|
||||||
|
},
|
||||||
|
deleteButton: {
|
||||||
|
background: '#c62828',
|
||||||
|
padding: '10px 30px'
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
export default useStyles;
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
header: {
|
||||||
|
width: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
flexFlow: 'row nowrap',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
textAlign: 'center',
|
||||||
|
height: '60px',
|
||||||
|
},
|
||||||
|
backgroundModal: {
|
||||||
|
background: "black",
|
||||||
|
opacity: "0.6",
|
||||||
|
position: "absolute",
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
zIndex: 5,
|
||||||
|
},
|
||||||
|
absolute: {
|
||||||
|
position: "absolute",
|
||||||
|
bottom: theme.spacing(2),
|
||||||
|
right: theme.spacing(3),
|
||||||
|
},
|
||||||
|
}))
|
||||||
|
|
||||||
|
export default useStyles;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
export interface Credentials {
|
||||||
|
name: string;
|
||||||
|
balance: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Transfer {
|
||||||
|
id: number;
|
||||||
|
targetID: number;
|
||||||
|
source: string;
|
||||||
|
type: string;
|
||||||
|
transferAmount: number;
|
||||||
|
message: string;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -16,6 +16,10 @@ interface NotificationConfig {
|
|||||||
vertical: "bottom" | "top";
|
vertical: "bottom" | "top";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface BankConfig {
|
||||||
|
showNotifications: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ServerConfig {
|
export interface ServerConfig {
|
||||||
Locale: string;
|
Locale: string;
|
||||||
KeyTogglePhone: number;
|
KeyTogglePhone: number;
|
||||||
@@ -26,5 +30,6 @@ export interface ServerConfig {
|
|||||||
DestoryChance: number;
|
DestoryChance: number;
|
||||||
DestroyPhoneReCheck: number;
|
DestroyPhoneReCheck: number;
|
||||||
twitter: TwitterConfig;
|
twitter: TwitterConfig;
|
||||||
|
bank: BankConfig;
|
||||||
notificationPosition: NotificationConfig;
|
notificationPosition: NotificationConfig;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
export interface Note {
|
||||||
|
id?: number;
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NoteId {
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
@@ -8,11 +8,13 @@ import "./main.css";
|
|||||||
import Phone from "./Phone";
|
import Phone from "./Phone";
|
||||||
import * as serviceWorker from "./serviceWorker";
|
import * as serviceWorker from "./serviceWorker";
|
||||||
import TwitterNotification from "./apps/twitter/components/notification/TwitterNotification";
|
import TwitterNotification from "./apps/twitter/components/notification/TwitterNotification";
|
||||||
|
import { BankNotification } from "./apps/bank/components/notification/BankNotification";
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<RecoilRoot>
|
<RecoilRoot>
|
||||||
<TwitterNotification />
|
<TwitterNotification />
|
||||||
|
<BankNotification />
|
||||||
<Phone />
|
<Phone />
|
||||||
</RecoilRoot>
|
</RecoilRoot>
|
||||||
</HashRouter>,
|
</HashRouter>,
|
||||||
|
|||||||
@@ -39,9 +39,19 @@
|
|||||||
"APPS_TWITTER_TIME_HOURS": "h",
|
"APPS_TWITTER_TIME_HOURS": "h",
|
||||||
"APPS_TWITTER_TIME_DAYS": "d",
|
"APPS_TWITTER_TIME_DAYS": "d",
|
||||||
|
|
||||||
"APPS_BANK_HOME_TITLE": "Welcome, ",
|
"APPS_BANK_HOME_TITLE": "Welcome",
|
||||||
|
"APPS_BANK_ACCOUNT_LINK": "Account",
|
||||||
|
"APPS_BANK_TIME_JUST_NOW": "Just now",
|
||||||
"APPS_BANK_ACCOUNT_TITLE": "Account Summary",
|
"APPS_BANK_ACCOUNT_TITLE": "Account Summary",
|
||||||
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transactions",
|
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transactions",
|
||||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "See all"
|
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "See all",
|
||||||
|
"APPS_BANK_ACTIONS_TRANSFER": "Transfer",
|
||||||
|
"APPS_BANK_ALERT_TRANSFER_SUCCESS": "Transfer done successfully!",
|
||||||
|
"APPS_BANK_ALERT_TRANSFER_FAILURE": "Transfer failed!",
|
||||||
|
|
||||||
|
"APPS_CONTACT_FORM_NAME": "Name",
|
||||||
|
"APPS_CONTACT_FORM_NUMBER": "Number",
|
||||||
|
"APPS_CONTACT_FORM_AVATAR": "Avatar URL"
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
grey,
|
grey,
|
||||||
green,
|
green,
|
||||||
purple,
|
purple,
|
||||||
|
yellow,
|
||||||
red,
|
red,
|
||||||
amber,
|
amber,
|
||||||
} from "@material-ui/core/colors";
|
} from "@material-ui/core/colors";
|
||||||
@@ -14,7 +15,8 @@ import {
|
|||||||
faAd,
|
faAd,
|
||||||
faPlaneArrival,
|
faPlaneArrival,
|
||||||
faPhoneAlt,
|
faPhoneAlt,
|
||||||
faWonSign
|
faWonSign,
|
||||||
|
faStickyNote
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faTwitter } from "@fortawesome/free-brands-svg-icons";
|
import { faTwitter } from "@fortawesome/free-brands-svg-icons";
|
||||||
|
|
||||||
@@ -33,6 +35,7 @@ import { MessagesApp } from "../../../apps/messages/components/MessagesApp";
|
|||||||
import { TwitterApp } from "../../../apps/twitter/components/TwitterApp";
|
import { TwitterApp } from "../../../apps/twitter/components/TwitterApp";
|
||||||
import { ExampleApp } from "../../../apps/example/components/ExampleApp";
|
import { ExampleApp } from "../../../apps/example/components/ExampleApp";
|
||||||
import { SelloutApp } from "../../../apps/sellout/components/SelloutApp";
|
import { SelloutApp } from "../../../apps/sellout/components/SelloutApp";
|
||||||
|
import { NotesApp } from "../../../apps/notes/NotesApp";
|
||||||
|
|
||||||
const appsState = atom({
|
const appsState = atom({
|
||||||
key: "apps",
|
key: "apps",
|
||||||
@@ -110,6 +113,15 @@ const appsState = atom({
|
|||||||
path: "/sellout",
|
path: "/sellout",
|
||||||
Route: () => <Route path="/sellout" component={SelloutApp} />,
|
Route: () => <Route path="/sellout" component={SelloutApp} />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'NOTES',
|
||||||
|
name: 'APPS_NOTES',
|
||||||
|
icon: <FontAwesomeIcon icon={faStickyNote} fixedWidth />,
|
||||||
|
backgroundColor: yellow[800],
|
||||||
|
color: common.white,
|
||||||
|
path: "/notes",
|
||||||
|
Route: () => <Route path="/notes" component={NotesApp}/>
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "EXAMPLE",
|
id: "EXAMPLE",
|
||||||
nameLocale: "APPS_EXAMPLE",
|
nameLocale: "APPS_EXAMPLE",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { makeStyles } from "@material-ui/core/styles";
|
|||||||
import Avatar from "@material-ui/core/Avatar";
|
import Avatar from "@material-ui/core/Avatar";
|
||||||
import { green } from "@material-ui/core/colors";
|
import { green } from "@material-ui/core/colors";
|
||||||
import { Button } from "@material-ui/core";
|
import { Button } from "@material-ui/core";
|
||||||
|
import Nui from "../../os/nui-events/utils/Nui";
|
||||||
|
|
||||||
interface IStyles {
|
interface IStyles {
|
||||||
root: any;
|
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({
|
const classes = useStyles({
|
||||||
backgroundColor: backgroundColor || green[50],
|
backgroundColor: backgroundColor || green[50],
|
||||||
color: color || green[400],
|
color: color || green[400],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const openAppCallback = () => {
|
||||||
|
Nui.send(`phone:app:${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button className={classes.root}>
|
<Button onClick={openAppCallback} className={classes.root}>
|
||||||
<Avatar className={classes.avatar}>
|
<Avatar className={classes.avatar}>
|
||||||
{icon || name[0].toUpperCase()}
|
{icon || name[0].toUpperCase()}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function Notification({ children, handleClose, open }) {
|
|||||||
<Snackbar
|
<Snackbar
|
||||||
className={classes.snackBar}
|
className={classes.snackBar}
|
||||||
anchorOrigin={{ horizontal, vertical }}
|
anchorOrigin={{ horizontal, vertical }}
|
||||||
ClickAwayListenerProps={{ onClickAway: () => null }}
|
ClickAwayListenerProps={{ onClickAway: () => setTimeout(() => { handleClose() }, 5000) }}
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
open={open}
|
open={open}
|
||||||
TransitionComponent={Fade}
|
TransitionComponent={Fade}
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
|
onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
|
||||||
console.log("Client:", credentials.balance, credentials.name)
|
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: "BANK",
|
app: "BANK",
|
||||||
@@ -26,8 +25,28 @@ RegisterNuiCallbackType(events.BANK_ADD_TRANSFER);
|
|||||||
on(`__cfx_nui:${events.BANK_ADD_TRANSFER}`, (data: any) => {
|
on(`__cfx_nui:${events.BANK_ADD_TRANSFER}`, (data: any) => {
|
||||||
const transfer = data;
|
const transfer = data;
|
||||||
emitNet(events.BANK_ADD_TRANSFER, transfer)
|
emitNet(events.BANK_ADD_TRANSFER, transfer)
|
||||||
|
})
|
||||||
|
|
||||||
setTimeout(() => {
|
onNet(events.BANK_ADD_TRANSFER_SUCCESS, () => {
|
||||||
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
||||||
}, 500)
|
})
|
||||||
|
|
||||||
|
onNet(events.BANK_TRANSACTION_ALERT, (bool: boolean) => {
|
||||||
|
SendNuiMessage(
|
||||||
|
JSON.stringify({
|
||||||
|
app: 'BANK',
|
||||||
|
method: 'setAlert',
|
||||||
|
data: bool
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
onNet(events.BANK_TRANSACTION_NOTIFICATION, (transfer: any) => {
|
||||||
|
SendNuiMessage(
|
||||||
|
JSON.stringify({
|
||||||
|
app: "BANK",
|
||||||
|
method: 'setNotification',
|
||||||
|
data: transfer
|
||||||
|
})
|
||||||
|
)
|
||||||
})
|
})
|
||||||
@@ -17,8 +17,29 @@ on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT}`, (data: any) => {
|
|||||||
const avatar = data.avatar;
|
const avatar = data.avatar;
|
||||||
emitNet(events.CONTACTS_ADD_CONTACT, number, display, avatar);
|
emitNet(events.CONTACTS_ADD_CONTACT, number, display, avatar);
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS)
|
|
||||||
}, 500)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onNet(events.CONTACTS_ADD_CONTACT_SUCCESS, () => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS)
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.CONTACTS_UPDATE_CONTACT);
|
||||||
|
on(`__cfx_nui:${events.CONTACTS_UPDATE_CONTACT}`, (data: any) => {
|
||||||
|
const contact = data;
|
||||||
|
emitNet(events.CONTACTS_UPDATE_CONTACT, contact)
|
||||||
|
})
|
||||||
|
|
||||||
|
onNet(events.CONTACTS_UPDATE_CONTACT_SUCCESS, () => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS)
|
||||||
|
})
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.CONTACTS_DELETE_CONTACT);
|
||||||
|
on(`__cfx_nui:${events.CONTACTS_DELETE_CONTACT}`, (data: any) => {
|
||||||
|
const contact = data;
|
||||||
|
emitNet(events.CONTACTS_DELETE_CONTACT, contact)
|
||||||
|
})
|
||||||
|
|
||||||
|
onNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, () => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS)
|
||||||
|
})
|
||||||
@@ -235,10 +235,6 @@ async function Phone() {
|
|||||||
isPhoneOpen = true;
|
isPhoneOpen = true;
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||||
emitNet('phone:getCredentials')
|
emitNet('phone:getCredentials')
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS);
|
|
||||||
emitNet(events.SELLOUT_FETCH_LISTING);
|
|
||||||
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
|
||||||
emitNet(events.BANK_GET_CREDENTIALS);
|
|
||||||
console.log("Sellout fetched from client side")// Gets the credentials. Will eventually most likely only get the phone number and name, idk.
|
console.log("Sellout fetched from client side")// Gets the credentials. Will eventually most likely only get the phone number and name, idk.
|
||||||
SetCursorLocation(0.90, 0.922) //Experimental
|
SetCursorLocation(0.90, 0.922) //Experimental
|
||||||
let res = GetActiveScreenResolution()
|
let res = GetActiveScreenResolution()
|
||||||
@@ -274,10 +270,6 @@ async function Phone() {
|
|||||||
isPhoneOpen = true;
|
isPhoneOpen = true;
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||||
emitNet('phone:getCredentials')
|
emitNet('phone:getCredentials')
|
||||||
emitNet(events.CONTACTS_GET_CONTACTS);
|
|
||||||
emitNet(events.SELLOUT_FETCH_LISTING);
|
|
||||||
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
|
||||||
emitNet(events.BANK_GET_CREDENTIALS);
|
|
||||||
console.log("Sellout fetched from client side")
|
console.log("Sellout fetched from client side")
|
||||||
SetCursorLocation(0.936, 0.922) //Experimental
|
SetCursorLocation(0.936, 0.922) //Experimental
|
||||||
let res = GetActiveScreenResolution()
|
let res = GetActiveScreenResolution()
|
||||||
@@ -306,6 +298,30 @@ async function Phone() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
|
||||||
|
|
||||||
|
// contacts app
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_CONTACTS);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_CONTACTS}`, () => {
|
||||||
|
emitNet(events.CONTACTS_GET_CONTACTS);
|
||||||
|
})
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_LISTINGS);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_LISTINGS}`, () => {
|
||||||
|
emitNet(events.SELLOUT_FETCH_LISTING);
|
||||||
|
})
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_NOTES);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_NOTES}`, () => {
|
||||||
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
|
})
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.OPEN_APP_BANK);
|
||||||
|
on(`__cfx_nui:${events.OPEN_APP_BANK}`, () => {
|
||||||
|
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
||||||
|
emitNet(events.BANK_GET_CREDENTIALS);
|
||||||
|
})
|
||||||
|
|
||||||
RegisterCommand(
|
RegisterCommand(
|
||||||
"phone",
|
"phone",
|
||||||
() => {
|
() => {
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import events from "../utils/events";
|
||||||
|
|
||||||
|
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
|
||||||
|
SendNuiMessage(
|
||||||
|
JSON.stringify({
|
||||||
|
app: "NOTES",
|
||||||
|
method: "setNotes",
|
||||||
|
data: notes,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.NOTE_ADD_NOTE);
|
||||||
|
on(`__cfx_nui:${events.NOTE_ADD_NOTE}`, (data: any) => {
|
||||||
|
const note = data;
|
||||||
|
emitNet(events.NOTE_ADD_NOTE, note);
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(events.NOTE_SEND_NOTE_SUCCESS, () => {
|
||||||
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
||||||
|
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||||
|
const noteId = data;
|
||||||
|
emitNet(events.NOTE_DELETE_NOTE, noteId);
|
||||||
|
|
||||||
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||||
|
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
||||||
|
const note = data;
|
||||||
|
emitNet(events.NOTE_UPDATE_NOTE, note);
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
||||||
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
|
});
|
||||||
@@ -4,6 +4,7 @@ import './cl_twitter';
|
|||||||
import './cl_contacts';
|
import './cl_contacts';
|
||||||
import './cl_sellout';
|
import './cl_sellout';
|
||||||
import './cl_bank';
|
import './cl_bank';
|
||||||
|
import './cl_notes';
|
||||||
|
|
||||||
export let ESX: ESXClient = null;
|
export let ESX: ESXClient = null;
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,36 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
|
|||||||
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
|
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS npwd_notes (
|
||||||
|
id int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
identifier varchar(255) NOT NULL,
|
||||||
|
title varchar(255) NOT NULL,
|
||||||
|
content varchar(255) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
)
|
||||||
|
ENGINE = INNODB,
|
||||||
|
AUTO_INCREMENT = 5,
|
||||||
|
AVG_ROW_LENGTH = 4096,
|
||||||
|
CHARACTER SET utf8mb4,
|
||||||
|
COLLATE utf8mb4_general_ci;
|
||||||
|
|
||||||
|
CREATE TABLE npwd_sellout_listings (
|
||||||
|
id int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
identifier varchar(255) DEFAULT NULL,
|
||||||
|
name varchar(50) DEFAULT NULL,
|
||||||
|
number varchar(255) NOT NULL,
|
||||||
|
title varchar(255) DEFAULT NULL,
|
||||||
|
url varchar(255) DEFAULT NULL,
|
||||||
|
description varchar(255) NOT NULL,
|
||||||
|
PRIMARY KEY (id)
|
||||||
|
)
|
||||||
|
ENGINE = INNODB,
|
||||||
|
AUTO_INCREMENT = 26,
|
||||||
|
AVG_ROW_LENGTH = 2048,
|
||||||
|
CHARACTER SET utf8mb4,
|
||||||
|
COLLATE utf8mb4_general_ci;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
|
CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`profile_id` int NOT NULL,
|
`profile_id` int NOT NULL,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import './sv_main';
|
|||||||
import './sv_contacts';
|
import './sv_contacts';
|
||||||
import './sv_sellout';
|
import './sv_sellout';
|
||||||
import './sv_bank';
|
import './sv_bank';
|
||||||
|
import './sv_notes';
|
||||||
|
|
||||||
export let ESX: ESXServer = null;
|
export let ESX: ESXServer = null;
|
||||||
|
|
||||||
|
|||||||
+48
-36
@@ -2,18 +2,9 @@ import events from '../utils/events';
|
|||||||
import { ESX } from './server';
|
import { ESX } from './server';
|
||||||
import { getSource } from "./functions";
|
import { getSource } from "./functions";
|
||||||
import { pool } from './db';
|
import { pool } from './db';
|
||||||
import { resourceLimits } from 'worker_threads';
|
import { Transfer, Credentials } from '../../phone/src/common/interfaces/bank';
|
||||||
|
import { useIdentifier } from './functions';
|
||||||
interface Transfer {
|
import { type } from 'os';
|
||||||
targetID: string;
|
|
||||||
amount: number;
|
|
||||||
message: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Credentials {
|
|
||||||
name: string;
|
|
||||||
balance: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
async function fetchAllTransactions(identifier: string): Promise<Transfer[]> {
|
async function fetchAllTransactions(identifier: string): Promise<Transfer[]> {
|
||||||
@@ -33,63 +24,84 @@ function fetchCredentials(): Credentials {
|
|||||||
balance
|
balance
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(result.name, result.balance);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function addTransfer(identifier: string, transfer: Transfer): Promise<any> {
|
async function addTransfer(identifier: string, transfer: Transfer): Promise<any> {
|
||||||
|
|
||||||
const xPlayer = ESX.GetPlayerFromId(getSource())
|
const xPlayer = ESX.GetPlayerFromId(getSource())
|
||||||
const bankBalance = xPlayer.getAccount('bank').money;
|
const bankBalance = xPlayer.getAccount('bank').money;
|
||||||
console.log(bankBalance)
|
const sourceName = xPlayer.getName()
|
||||||
if (transfer.amount > bankBalance) {
|
|
||||||
console.log("poor man")
|
|
||||||
emitNet(events.BANK_TRANSACTION_ALERT, getSource, 'You do not have enough money on your account', 'error')
|
|
||||||
}
|
|
||||||
else if (transfer.amount <= bankBalance) {
|
|
||||||
const query = "INSERT INTO npwd_bank_transfers (identifier, target, amount, message) VALUES (?, ?, ?, ?)"
|
|
||||||
|
|
||||||
await pool.query(query, [
|
const xTarget = ESX.GetPlayerFromId(transfer.targetID);
|
||||||
|
|
||||||
|
|
||||||
|
if (transfer.transferAmount > bankBalance) {
|
||||||
|
emitNet(events.BANK_TRANSACTION_ALERT, getSource(), false)
|
||||||
|
}
|
||||||
|
else if (transfer.transferAmount < bankBalance) {
|
||||||
|
emitNet(events.BANK_TRANSACTION_ALERT, getSource(), true);
|
||||||
|
|
||||||
|
xTarget.addAccountMoney('bank', transfer.transferAmount);
|
||||||
|
xPlayer.removeAccountMoney('bank', transfer.transferAmount);
|
||||||
|
|
||||||
|
const query = "INSERT INTO npwd_bank_transfers (identifier, target, amount, message, type, source) VALUES (?, ?, ?, ?, ?, ?)"
|
||||||
|
|
||||||
|
const [results] = await pool.query(query, [
|
||||||
identifier,
|
identifier,
|
||||||
transfer.targetID,
|
transfer.targetID,
|
||||||
transfer.amount,
|
transfer.transferAmount,
|
||||||
transfer.message
|
transfer.message,
|
||||||
|
"Transfer",
|
||||||
|
sourceName,
|
||||||
])
|
])
|
||||||
emitNet(events.BANK_TRANSACTION_ALERT, getSource, 'You succesfully transferred money to someone', 'success')
|
const insertData = <any>results;
|
||||||
|
return await getTransfer(insertData.insertId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a transfer from its ID
|
||||||
|
* @param transferId - transfer id
|
||||||
|
*/
|
||||||
|
async function getTransfer(transferId: number): Promise<Transfer> {
|
||||||
|
const query = "SELECT * FROM npwd_bank_transfers WHERE id = ?"
|
||||||
|
const [ results ] = await pool.query(query, [transferId]);
|
||||||
|
const transfers = <Transfer[]>results;
|
||||||
|
const transfer = transfers[0];
|
||||||
|
return {...transfer};
|
||||||
|
}
|
||||||
|
|
||||||
onNet(events.BANK_FETCH_TRANSACTIONS, async () => {
|
onNet(events.BANK_FETCH_TRANSACTIONS, async () => {
|
||||||
try {
|
try {
|
||||||
const _source = (global as any).source;
|
const _source = (global as any).source;
|
||||||
const _identifier = ESX.GetPlayerFromId(getSource()).getIdentifier()
|
const _identifier = await useIdentifier()
|
||||||
const transfer = await fetchAllTransactions(_identifier);
|
const transfer = await fetchAllTransactions(_identifier);
|
||||||
|
|
||||||
emitNet(events.BANK_SEND_TRANSFERS, _source, transfer)
|
emitNet(events.BANK_SEND_TRANSFERS, _source, transfer)
|
||||||
console.log("WOORK")
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Failed to fetch transactions', error)
|
console.log("Failed to fetch transactions");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onNet(events.BANK_ADD_TRANSFER, (transfer: Transfer) => {
|
onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => {
|
||||||
|
const xTarget = ESX.GetPlayerFromId(transfer.targetID);
|
||||||
|
const targetSource = xTarget.source;
|
||||||
try {
|
try {
|
||||||
const _identifier = ESX.GetPlayerFromId(getSource()).getIdentifier()
|
const _identifier = await useIdentifier()
|
||||||
addTransfer(_identifier, transfer)
|
const transferNotify = await addTransfer(_identifier, transfer)
|
||||||
|
emitNet(events.BANK_TRANSACTION_NOTIFICATION, targetSource, transferNotify)
|
||||||
|
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, getSource());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Failed to add transfer', error)
|
emitNet(events.BANK_TRANSACTION_ALERT, getSource(), false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onNet(events.BANK_GET_CREDENTIALS, () => {
|
onNet(events.BANK_GET_CREDENTIALS, () => {
|
||||||
try {
|
try {
|
||||||
const credentials = fetchCredentials()
|
const credentials = fetchCredentials()
|
||||||
console.log("New log: ", credentials.balance, credentials.name)
|
|
||||||
emitNet(events.BANK_SEND_CREDENTIALS, getSource(), credentials)
|
emitNet(events.BANK_SEND_CREDENTIALS, getSource(), credentials)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log("Failed to fetch credentials");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -1,12 +1,20 @@
|
|||||||
import { ESX } from "./server";
|
import { ESX, getSource } from "./server";
|
||||||
import { pool } from "./db";
|
import { pool } from "./db";
|
||||||
import events from "../utils/events";
|
import events from "../utils/events";
|
||||||
|
import { useIdentifier } from './functions'
|
||||||
|
|
||||||
interface Contacts {
|
interface Contacts {
|
||||||
|
id?: number;
|
||||||
display: string;
|
display: string;
|
||||||
number: string;
|
number: string;
|
||||||
|
avatar: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface ContactId {
|
||||||
|
id: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async function fetchAllContacts(identifier: string): Promise<Contacts[]> {
|
async function fetchAllContacts(identifier: string): Promise<Contacts[]> {
|
||||||
const query = "SELECT * FROM npwd_phone_contacts WHERE identifier = ?";
|
const query = "SELECT * FROM npwd_phone_contacts WHERE identifier = ?";
|
||||||
const [results] = await pool.query(query, [identifier]);
|
const [results] = await pool.query(query, [identifier]);
|
||||||
@@ -26,6 +34,25 @@ async function addContact(
|
|||||||
await pool.query(query, [identifier, number, display, avatar]);
|
await pool.query(query, [identifier, number, display, avatar]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function updateContact(contact: Contacts, identifier: string): Promise<any> {
|
||||||
|
const query = "UPDATE npwd_phone_contacts SET number = ?, display = ?, avatar = ? WHERE id = ? AND identifier = ?"
|
||||||
|
await pool.query(query, [
|
||||||
|
contact.number,
|
||||||
|
contact.display,
|
||||||
|
contact.avatar,
|
||||||
|
contact.id,
|
||||||
|
identifier
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteContact(contact: ContactId, identifier: string): Promise<any> {
|
||||||
|
const query = "DELETE FROM npwd_phone_contacts WHERE id = ? AND identifier = ?"
|
||||||
|
await pool.query(query, [
|
||||||
|
contact.id,
|
||||||
|
identifier
|
||||||
|
])
|
||||||
|
}
|
||||||
|
|
||||||
onNet(events.CONTACTS_GET_CONTACTS, async () => {
|
onNet(events.CONTACTS_GET_CONTACTS, async () => {
|
||||||
try {
|
try {
|
||||||
const _source = (global as any).source;
|
const _source = (global as any).source;
|
||||||
@@ -39,16 +66,36 @@ onNet(events.CONTACTS_GET_CONTACTS, async () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
onNet(events.CONTACTS_ADD_CONTACT, (number: string, display: string, avatar: string) => {
|
onNet(events.CONTACTS_ADD_CONTACT, async (number: string, display: string, avatar: string) => {
|
||||||
try {
|
try {
|
||||||
const _source = (global as any).source;
|
const _source = (global as any).source;
|
||||||
const xPlayer = ESX.GetPlayerFromId(_source);
|
const _identifier = await useIdentifier()
|
||||||
const _identifier = xPlayer.getIdentifier()
|
|
||||||
addContact(_identifier, number, display, avatar);
|
addContact(_identifier, number, display, avatar);
|
||||||
//emit(events.CONTACTS_GET_CONTACTS);
|
emitNet(events.CONTACTS_ADD_CONTACT_SUCCESS, _source)
|
||||||
|
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
console.log("Failed to add contact: ", error);
|
console.log("Failed to add contact: ", error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onNet(events.CONTACTS_UPDATE_CONTACT, async (contact: Contacts) => {
|
||||||
|
try {
|
||||||
|
const _source = (global as any)._source
|
||||||
|
const _identifier = await useIdentifier()
|
||||||
|
updateContact(contact, _identifier)
|
||||||
|
emitNet(events.CONTACTS_UPDATE_CONTACT_SUCCESS, _source)
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onNet(events.CONTACTS_DELETE_CONTACT, async (contact: ContactId) => {
|
||||||
|
try {
|
||||||
|
const _identifier = await useIdentifier()
|
||||||
|
deleteContact(contact, _identifier)
|
||||||
|
emitNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, getSource())
|
||||||
|
} catch (error) {
|
||||||
|
console.log("DELETE CONTACT ERROR", error)
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
import events from "../utils/events";
|
||||||
|
import { ESX, getSource } from "./server";
|
||||||
|
import { pool } from "./db";
|
||||||
|
import { useIdentifier } from "./functions";
|
||||||
|
import { Note, NoteId } from "../../phone/src/common/interfaces/notes";
|
||||||
|
|
||||||
|
async function addNote(identifier: string, note: Note): Promise<any> {
|
||||||
|
const query =
|
||||||
|
"INSERT INTO npwd_notes (identifier, title, content) VALUES (?, ?, ?)";
|
||||||
|
await pool.query(query, [identifier, note.title, note.content]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchAllNotes(identifier: string): Promise<Note[]> {
|
||||||
|
const query =
|
||||||
|
"SELECT * FROM npwd_notes WHERE identifier = ? ORDER BY id DESC";
|
||||||
|
const [result] = await pool.query(query, [identifier]);
|
||||||
|
const notes = <Note[]>result;
|
||||||
|
return notes;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function deleteNote(noteId: number, identifier: string) {
|
||||||
|
const query = "DELETE FROM npwd_notes WHERE id = ? AND identifier = ?";
|
||||||
|
await pool.query(query, [noteId, identifier]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function updateNote(note: Note, identifier: string): Promise<any> {
|
||||||
|
const query =
|
||||||
|
"UPDATE npwd_notes SET title = ?, content = ? WHERE id = ? AND identifier = ?";
|
||||||
|
await pool.query(query, [note.title, note.content, note.id, identifier]);
|
||||||
|
}
|
||||||
|
|
||||||
|
onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
||||||
|
try {
|
||||||
|
const _identifier = await useIdentifier();
|
||||||
|
addNote(_identifier, note);
|
||||||
|
emitNet(events.NOTE_SEND_NOTE_SUCCESS, getSource());
|
||||||
|
} catch (error) {
|
||||||
|
console.log("NOTES ERROR: ", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(events.NOTE_FETCH_ALL_NOTES, async () => {
|
||||||
|
try {
|
||||||
|
const _source = (global as any).source;
|
||||||
|
const _identifier = await useIdentifier();
|
||||||
|
const notes = await fetchAllNotes(_identifier);
|
||||||
|
emitNet(events.NOTE_SEND_NOTE, _source, notes);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("NOTE ERROR: ", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(events.NOTE_DELETE_NOTE, async (noteId: NoteId) => {
|
||||||
|
try {
|
||||||
|
const _identifier = await useIdentifier();
|
||||||
|
const id = noteId.id;
|
||||||
|
await deleteNote(id, _identifier);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("NOTE ERROR:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(events.NOTE_UPDATE_NOTE, async (note: Note) => {
|
||||||
|
const _source = (global as any).source;
|
||||||
|
try {
|
||||||
|
const _identifier = await useIdentifier();
|
||||||
|
updateNote(note, _identifier);
|
||||||
|
emitNet(events.NOTE_UPDATE_NOTE_SUCCESS, _source);
|
||||||
|
} catch (error) {
|
||||||
|
emitNet(events.NOTE_UPDATE_NOTE_FAILURE, _source);
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -32,7 +32,11 @@ export default {
|
|||||||
CONTACTS_GET_CONTACTS: 'phone:getContacts',
|
CONTACTS_GET_CONTACTS: 'phone:getContacts',
|
||||||
CONTACTS_ADD_CONTACT_NUI: 'contacts:add',
|
CONTACTS_ADD_CONTACT_NUI: 'contacts:add',
|
||||||
CONTACTS_ADD_CONTACT: 'contacts:add',
|
CONTACTS_ADD_CONTACT: 'contacts:add',
|
||||||
CONTACTS_UPDATE_CONTACTS: 'phone:updateContacts',
|
CONTACTS_ADD_CONTACT_SUCCESS: 'contacts:addSuccess',
|
||||||
|
CONTACTS_UPDATE_CONTACT: 'phone:updateContact',
|
||||||
|
CONTACTS_DELETE_CONTACT: 'phone:deleteContact',
|
||||||
|
CONTACTS_DELETE_CONTACT_SUCCESS: 'contacts:deleteSuccess',
|
||||||
|
CONTACTS_UPDATE_CONTACT_SUCCESS: 'phone:updateContactSuccess',
|
||||||
|
|
||||||
// Sellout
|
// Sellout
|
||||||
SELLOUT_ADD_LISTING: 'phone:addListing',
|
SELLOUT_ADD_LISTING: 'phone:addListing',
|
||||||
@@ -41,12 +45,32 @@ export default {
|
|||||||
|
|
||||||
//
|
//
|
||||||
BANK_ADD_TRANSFER: 'phone:addTransfer',
|
BANK_ADD_TRANSFER: 'phone:addTransfer',
|
||||||
|
BANK_ADD_TRANSFER_SUCCESS: 'phone:addTransferSuccess',
|
||||||
BANK_FETCH_TRANSACTIONS: 'phone:fetchAllTransactions',
|
BANK_FETCH_TRANSACTIONS: 'phone:fetchAllTransactions',
|
||||||
BANK_SEND_TRANSFERS: 'phone:sendTransfers',
|
BANK_SEND_TRANSFERS: 'phone:sendTransfers',
|
||||||
BANK_TRANSACTION_ALERT: 'phone:transactionAlert',
|
BANK_TRANSACTION_ALERT: 'phone:bankTransactionAlert',
|
||||||
|
BANK_TRANSACTION_NOTIFICATION: 'phone:bankTransactionNotification',
|
||||||
BANK_SEND_CREDENTIALS: 'phone:sendBankCredentials',
|
BANK_SEND_CREDENTIALS: 'phone:sendBankCredentials',
|
||||||
BANK_GET_CREDENTIALS: 'phone:getBankCredentials',
|
BANK_GET_CREDENTIALS: 'phone:getBankCredentials',
|
||||||
|
|
||||||
//messages
|
//messages
|
||||||
MESSAGES_SEND_MESSAGE: 'phone:sendMessage',
|
MESSAGES_SEND_MESSAGE: 'phone:sendMessage',
|
||||||
|
MESSAGES_GET_MESSAGES: 'phone:getMessage',
|
||||||
|
|
||||||
|
// Notes
|
||||||
|
NOTE_ADD_NOTE: 'phone:addNote',
|
||||||
|
NOTE_FETCH_ALL_NOTES: 'phone:fetchAllNotes',
|
||||||
|
NOTE_SEND_NOTE: 'phone:sendNote',
|
||||||
|
NOTE_SEND_NOTE_SUCCESS: 'phone:sendNoteSuccess',
|
||||||
|
NOTE_DELETE_NOTE: 'phone:deleteNote',
|
||||||
|
NOTE_UPDATE_NOTE: 'phone:updateNote',
|
||||||
|
NOTE_UPDATE_NOTE_SUCCESS: 'phone:updateNoteSuccess',
|
||||||
|
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'
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user