mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
mad formatting
This commit is contained in:
1 parent
6777498bcc
commit
046447b0fb
60 files changed
+209
-189
No files matched your search
@@ -1,12 +1,15 @@
|
|||||||
# New-Phone-Who-Dis (NPWD)
|
# New-Phone-Who-Dis (NPWD)
|
||||||
|
|
||||||
NPWD is our current running project. Our team has been working on the project since Auguest, 2020. This resource isn’t complete yet and currently has no ETA for release. Feel free to test it out in a dev enviorment by following the installation guide.
|
NPWD is our current running project. Our team has been working on the project since Auguest, 2020. This resource isn’t complete yet and currently has no ETA for release. Feel free to test it out in a dev enviorment by following the installation guide.
|
||||||
|
|
||||||
Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment.
|
Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment.
|
||||||
|
|
||||||
## Project Error Discord
|
## Project Error Discord
|
||||||
|
|
||||||
- Join the [Discord](https://discord.gg/HYwBjTbAY5) to follow current development of the project.
|
- Join the [Discord](https://discord.gg/HYwBjTbAY5) to follow current development of the project.
|
||||||
|
|
||||||
## Documentation & Installation
|
## Documentation & Installation
|
||||||
|
|
||||||
- [Project-Error Docs](https://docs.projecterror.dev/#/) contains all the information regarding this resource. Please consult it for installation, dependencies, and other important information.
|
- [Project-Error Docs](https://docs.projecterror.dev/#/) contains all the information regarding this resource. Please consult it for installation, dependencies, and other important information.
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
@@ -27,7 +30,9 @@ We do not want issues opened that are due to the phone being **WIP** as this slo
|
|||||||
[Latest Teaser Video (October 28th)](https://streamable.com/f1ri9r)
|
[Latest Teaser Video (October 28th)](https://streamable.com/f1ri9r)
|
||||||
|
|
||||||
#### Apps (February 20th, 2021)
|
#### Apps (February 20th, 2021)
|
||||||
|
|
||||||
Most of these apps have UI that does **not** represent the final product and are subject to change.
|
Most of these apps have UI that does **not** represent the final product and are subject to change.
|
||||||
|
|
||||||
- [**Bank**](https://i.imgur.com/P5Dg0Mj.png)
|
- [**Bank**](https://i.imgur.com/P5Dg0Mj.png)
|
||||||
- [**Calculator**](https://i.imgur.com/96e3bFF.png)
|
- [**Calculator**](https://i.imgur.com/96e3bFF.png)
|
||||||
- [**Camera**](https://i.imgur.com/1aGEV28.png)
|
- [**Camera**](https://i.imgur.com/1aGEV28.png)
|
||||||
|
|||||||
+1
-4
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"packages": [
|
"packages": ["phone", "resources"],
|
||||||
"phone",
|
|
||||||
"resources"
|
|
||||||
],
|
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"npmClient": "yarn"
|
"npmClient": "yarn"
|
||||||
}
|
}
|
||||||
+2
-1
@@ -8,7 +8,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "lerna run build --concurrency 1",
|
"build": "lerna run build --concurrency 1",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install",
|
||||||
|
"format": "pretty-quick"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"hooks": {
|
"hooks": {
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
# New Phone Who Dis
|
# New Phone Who Dis
|
||||||
|
|
||||||
A FiveM phone created with ReactJS, with the power from BTNGaming, kidz, ROCKY_shouthpaw and chip.
|
A FiveM phone created with ReactJS, with the power from BTNGaming, kidz, ROCKY_shouthpaw and chip.
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// Taso: Including some default values for clarity sake
|
// Taso: Including some default values for clarity sake
|
||||||
module.exports = {
|
module.exports = {
|
||||||
trailingComma: "es5",
|
trailingComma: 'es5',
|
||||||
tabWidth: 2,
|
tabWidth: 2,
|
||||||
semi: true,
|
semi: true,
|
||||||
singleQuote: true,
|
singleQuote: true,
|
||||||
jsxSingleQuote: true,
|
jsxSingleQuote: true,
|
||||||
jsxBracketSameLine: false,
|
jsxBracketSameLine: false,
|
||||||
bracketSpacing: true
|
bracketSpacing: true,
|
||||||
}
|
};
|
||||||
@@ -2,8 +2,14 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
|
<link
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
|
rel="stylesheet"
|
||||||
|
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://fonts.googleapis.com/icon?family=Material+Icons"
|
||||||
|
/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<title>Project Error - New Phone Who Dis</title>
|
<title>Project Error - New Phone Who Dis</title>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const useBankService = () => {
|
|||||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||||
const setCredentials = useSetRecoilState(bankState.bankCredentials);
|
const setCredentials = useSetRecoilState(bankState.bankCredentials);
|
||||||
const setNotification = useSetRecoilState(bankState.notification);
|
const setNotification = useSetRecoilState(bankState.notification);
|
||||||
const { addAlert } = useSnackbar()
|
const { addAlert } = useSnackbar();
|
||||||
|
|
||||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
||||||
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { InputBase } from '@material-ui/core';
|
import { InputBase } from '@material-ui/core';
|
||||||
import SearchIcon from '@material-ui/icons/Search';
|
import SearchIcon from '@material-ui/icons/Search';
|
||||||
import {
|
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles';
|
||||||
createStyles,
|
|
||||||
Theme,
|
|
||||||
makeStyles,
|
|
||||||
} from '@material-ui/core/styles';
|
|
||||||
|
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ const ContactsInfoPage = () => {
|
|||||||
const { getContact } = useContacts();
|
const { getContact } = useContacts();
|
||||||
|
|
||||||
const { id } = useParams<ContactInfoRouteParams>();
|
const { id } = useParams<ContactInfoRouteParams>();
|
||||||
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({ referal: '/contacts' });
|
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({
|
||||||
|
referal: '/contacts',
|
||||||
|
});
|
||||||
|
|
||||||
const contact = getContact(parseInt(id));
|
const contact = getContact(parseInt(id));
|
||||||
|
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ export const contactsState = {
|
|||||||
contactDetail: atom({
|
contactDetail: atom({
|
||||||
key: 'contactDetail',
|
key: 'contactDetail',
|
||||||
default: null,
|
default: null,
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
@@ -6,7 +6,7 @@ import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
|||||||
|
|
||||||
export const useContactsService = () => {
|
export const useContactsService = () => {
|
||||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||||
const { addAlert } = useSnackbar()
|
const { addAlert } = useSnackbar();
|
||||||
|
|
||||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
||||||
useNuiEvent('CONTACTS', 'setAlert', addAlert);
|
useNuiEvent('CONTACTS', 'setAlert', addAlert);
|
||||||
|
|||||||
@@ -19,7 +19,12 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Grid key={label} item xs={4}>
|
<Grid key={label} item xs={4}>
|
||||||
<Button fullWidth size="large" className={classes.gridItem} onClick={onClick}>
|
<Button
|
||||||
|
fullWidth
|
||||||
|
size='large'
|
||||||
|
className={classes.gridItem}
|
||||||
|
onClick={onClick}
|
||||||
|
>
|
||||||
{label}
|
{label}
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -27,10 +32,10 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const DialGrid = () => {
|
export const DialGrid = () => {
|
||||||
const { add, removeOne, clear} = useContext(DialInputCtx)
|
const { add, removeOne, clear } = useContext(DialInputCtx);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box height="100%">
|
<Box height='100%'>
|
||||||
<Grid container justify='space-around'>
|
<Grid container justify='space-around'>
|
||||||
<ButtonItem label={1} onClick={() => add(1)} />
|
<ButtonItem label={1} onClick={() => add(1)} />
|
||||||
<ButtonItem label={2} onClick={() => add(2)} />
|
<ButtonItem label={2} onClick={() => add(2)} />
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ export const DialerInput = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleNewContact = (number: string) => {
|
const handleNewContact = (number: string) => {
|
||||||
history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`)
|
history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box component={Paper} className={classes.root}>
|
<Box component={Paper} className={classes.root}>
|
||||||
@@ -50,10 +50,13 @@ export const DialerInput = () => {
|
|||||||
value={inputVal}
|
value={inputVal}
|
||||||
/>
|
/>
|
||||||
<IconButton color='primary' className={classes.iconBtn}>
|
<IconButton color='primary' className={classes.iconBtn}>
|
||||||
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
<PhoneIcon fontSize='large' onClick={() => handleCall(inputVal)} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<IconButton className={classes.iconBtn}>
|
<IconButton className={classes.iconBtn}>
|
||||||
<PersonAddIcon fontSize="large" onClick={() => handleNewContact(inputVal)} />
|
<PersonAddIcon
|
||||||
|
fontSize='large'
|
||||||
|
onClick={() => handleNewContact(inputVal)}
|
||||||
|
/>
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ const DialerNavBar = () => {
|
|||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
label='Dial'
|
label='Dial'
|
||||||
value='/phone/dial'
|
value='/phone/dial'
|
||||||
color="secondary"
|
color='secondary'
|
||||||
component={NavLink}
|
component={NavLink}
|
||||||
icon={<PhoneIcon />}
|
icon={<PhoneIcon />}
|
||||||
to='/phone/dial'
|
to='/phone/dial'
|
||||||
@@ -50,7 +50,7 @@ const DialerNavBar = () => {
|
|||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
label='Contacts'
|
label='Contacts'
|
||||||
value='/phone/contacts'
|
value='/phone/contacts'
|
||||||
color="secondary"
|
color='secondary'
|
||||||
component={NavLink}
|
component={NavLink}
|
||||||
icon={<PersonIcon />}
|
icon={<PersonIcon />}
|
||||||
to='/phone/contacts'
|
to='/phone/contacts'
|
||||||
|
|||||||
@@ -62,10 +62,7 @@ export const DialerHistory = ({ calls }) => {
|
|||||||
<List disablePadding>
|
<List disablePadding>
|
||||||
{calls.map((call: ICall) =>
|
{calls.map((call: ICall) =>
|
||||||
call.transmitter === number ? (
|
call.transmitter === number ? (
|
||||||
<ListItem
|
<ListItem key={call.id} divider>
|
||||||
key={call.id}
|
|
||||||
divider
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
{<PhoneForwardedIcon className={classes.callForward} />}
|
{<PhoneForwardedIcon className={classes.callForward} />}
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
@@ -91,10 +88,7 @@ export const DialerHistory = ({ calls }) => {
|
|||||||
) : null}
|
) : null}
|
||||||
</ListItem>
|
</ListItem>
|
||||||
) : (
|
) : (
|
||||||
<ListItem
|
<ListItem key={call.id} divider>
|
||||||
key={call.id}
|
|
||||||
divider
|
|
||||||
>
|
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
{<PhoneCallbackIcon className={classes.callBack} />}
|
{<PhoneCallbackIcon className={classes.callBack} />}
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { common, green } from "@material-ui/core/colors";
|
import { common, green } from '@material-ui/core/colors';
|
||||||
|
|
||||||
export const DIALER_APP_PRIMARY_COLOR = green[600];
|
export const DIALER_APP_PRIMARY_COLOR = green[600];
|
||||||
export const DIALER_APP_TEXT_COLOR = common.white;
|
export const DIALER_APP_TEXT_COLOR = common.white;
|
||||||
@@ -9,9 +9,9 @@ const theme = {
|
|||||||
main: DIALER_APP_PRIMARY_COLOR,
|
main: DIALER_APP_PRIMARY_COLOR,
|
||||||
dark: green[800],
|
dark: green[800],
|
||||||
light: green[400],
|
light: green[400],
|
||||||
contrastText: DIALER_APP_TEXT_COLOR
|
contrastText: DIALER_APP_TEXT_COLOR,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
const theme = {
|
const theme = {
|
||||||
palette: {
|
palette: {
|
||||||
primary: {
|
primary: {
|
||||||
main: '#f23123'
|
main: '#f23123',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
@@ -8,7 +8,7 @@ export const HomeApp = () => {
|
|||||||
const { apps } = useApps();
|
const { apps } = useApps();
|
||||||
return (
|
return (
|
||||||
<AppWrapper>
|
<AppWrapper>
|
||||||
<Box component="div" mt={6} px={1}>
|
<Box component='div' mt={6} px={1}>
|
||||||
{apps && <GridMenu xs={3} items={apps} />}
|
{apps && <GridMenu xs={3} items={apps} />}
|
||||||
</Box>
|
</Box>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
|
|||||||
@@ -21,11 +21,7 @@ export function NewMessageGroupButton({
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Fab
|
<Fab className={classes.root} color='primary' onClick={onClick}>
|
||||||
className={classes.root}
|
|
||||||
color='primary'
|
|
||||||
onClick={onClick}
|
|
||||||
>
|
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
</Fab>
|
</Fab>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -101,7 +101,13 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
|||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<Box px={2} py={3}>
|
<Box px={2} py={3}>
|
||||||
<Button disabled={submitDisabled} variant='contained' fullWidth color='primary' type='submit'>
|
<Button
|
||||||
|
disabled={submitDisabled}
|
||||||
|
variant='contained'
|
||||||
|
fullWidth
|
||||||
|
color='primary'
|
||||||
|
type='submit'
|
||||||
|
>
|
||||||
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
@@ -41,7 +41,12 @@ const MessagesList = (): any => {
|
|||||||
goToConversation(findGroup);
|
goToConversation(findGroup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [messageGroups, createMessageGroupResult, goToConversation, clearMessageGroupResult]);
|
}, [
|
||||||
|
messageGroups,
|
||||||
|
createMessageGroupResult,
|
||||||
|
goToConversation,
|
||||||
|
clearMessageGroupResult,
|
||||||
|
]);
|
||||||
|
|
||||||
if (!messageGroups) return null;
|
if (!messageGroups) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ export const MessageImageModal = ({
|
|||||||
})}`
|
})}`
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
[history, pathname, search]
|
[history, pathname, search]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||||
import { CreateMessageGroupResult, Message, MessageGroup } from '../../../common/typings/messages';
|
import {
|
||||||
|
CreateMessageGroupResult,
|
||||||
|
Message,
|
||||||
|
MessageGroup,
|
||||||
|
} from '../../../common/typings/messages';
|
||||||
import { messageState } from './state';
|
import { messageState } from './state';
|
||||||
|
|
||||||
interface IUseMessages {
|
interface IUseMessages {
|
||||||
@@ -18,11 +22,20 @@ export default (): IUseMessages => {
|
|||||||
messageState.messageGroups
|
messageState.messageGroups
|
||||||
);
|
);
|
||||||
|
|
||||||
const [createMessageGroupResult, setCreateMessageGroupResult] = useRecoilState<CreateMessageGroupResult | null>(
|
const [
|
||||||
|
createMessageGroupResult,
|
||||||
|
setCreateMessageGroupResult,
|
||||||
|
] = useRecoilState<CreateMessageGroupResult | null>(
|
||||||
messageState.createMessageGroupResult
|
messageState.createMessageGroupResult
|
||||||
);
|
);
|
||||||
|
|
||||||
const clearMessageGroupResult = () => setCreateMessageGroupResult(null);
|
const clearMessageGroupResult = () => setCreateMessageGroupResult(null);
|
||||||
|
|
||||||
return { messages, setMessages, messageGroups, createMessageGroupResult, clearMessageGroupResult };
|
return {
|
||||||
|
messages,
|
||||||
|
setMessages,
|
||||||
|
messageGroups,
|
||||||
|
createMessageGroupResult,
|
||||||
|
clearMessageGroupResult,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
@@ -9,7 +9,7 @@ const theme = {
|
|||||||
main: MESSAGES_APP_PRIMARY_COLOR,
|
main: MESSAGES_APP_PRIMARY_COLOR,
|
||||||
dark: amber[900],
|
dark: amber[900],
|
||||||
light: amber[100],
|
light: amber[100],
|
||||||
contrastText: MESSAGES_APP_TEXT_COLOR
|
contrastText: MESSAGES_APP_TEXT_COLOR,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,5 +12,5 @@ export const noteStates = {
|
|||||||
noteDetail: atom({
|
noteDetail: atom({
|
||||||
key: 'noteDetail',
|
key: 'noteDetail',
|
||||||
default: null,
|
default: null,
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
@@ -9,4 +9,4 @@ interface NotesProps {
|
|||||||
export const useNotes = (): NotesProps => {
|
export const useNotes = (): NotesProps => {
|
||||||
const notes = useRecoilValue(noteStates.noteItems);
|
const notes = useRecoilValue(noteStates.noteItems);
|
||||||
return { notes };
|
return { notes };
|
||||||
}
|
};
|
||||||
@@ -102,7 +102,7 @@ export const NoteModal = () => {
|
|||||||
<Typography paragraph>{detail.content.length}/250</Typography>
|
<Typography paragraph>{detail.content.length}/250</Typography>
|
||||||
{!detail.id ? (
|
{!detail.id ? (
|
||||||
<>
|
<>
|
||||||
<Box display="inline" p={1}>
|
<Box display='inline' p={1}>
|
||||||
<Button
|
<Button
|
||||||
color='primary'
|
color='primary'
|
||||||
variant='contained'
|
variant='contained'
|
||||||
@@ -112,7 +112,7 @@ export const NoteModal = () => {
|
|||||||
{t('GENERIC_SAVE')}
|
{t('GENERIC_SAVE')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Box display="inline" p={1}>
|
<Box display='inline' p={1}>
|
||||||
<StatusButton
|
<StatusButton
|
||||||
color='error'
|
color='error'
|
||||||
variant='contained'
|
variant='contained'
|
||||||
@@ -124,7 +124,7 @@ export const NoteModal = () => {
|
|||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Box display="inline" p={1}>
|
<Box display='inline' p={1}>
|
||||||
<Button
|
<Button
|
||||||
color='primary'
|
color='primary'
|
||||||
variant='contained'
|
variant='contained'
|
||||||
@@ -133,7 +133,7 @@ export const NoteModal = () => {
|
|||||||
{t('GENERIC_UPDATE')}
|
{t('GENERIC_UPDATE')}
|
||||||
</Button>
|
</Button>
|
||||||
</Box>
|
</Box>
|
||||||
<Box display="inline" p={1}>
|
<Box display='inline' p={1}>
|
||||||
<StatusButton
|
<StatusButton
|
||||||
color='error'
|
color='error'
|
||||||
variant='contained'
|
variant='contained'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
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 NOTES_APP_PRIMARY_COLOR = yellow[800];
|
||||||
export const NOTES_APP_ICON_COLOR = common.white;
|
export const NOTES_APP_ICON_COLOR = common.white;
|
||||||
@@ -10,9 +10,9 @@ const theme = {
|
|||||||
main: NOTES_APP_PRIMARY_COLOR,
|
main: NOTES_APP_PRIMARY_COLOR,
|
||||||
dark: yellow[900],
|
dark: yellow[900],
|
||||||
light: yellow[500],
|
light: yellow[500],
|
||||||
contrastText: NOTES_APP_TEXT_COLOR
|
contrastText: NOTES_APP_TEXT_COLOR,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { createAppThemeProvider } from "../../../os/apps/utils/createAppThemeProvider";
|
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||||
import notesTheme from '../notes.theme';
|
import notesTheme from '../notes.theme';
|
||||||
|
|
||||||
export const NotesThemeProvider = createAppThemeProvider(notesTheme);
|
export const NotesThemeProvider = createAppThemeProvider(notesTheme);
|
||||||
@@ -31,7 +31,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
color: theme.palette.primary.main
|
color: theme.palette.primary.main,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
margin: 10,
|
margin: 10,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { createAppThemeProvider } from "../../../os/apps/utils/createAppThemeProvider";
|
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||||
|
|
||||||
import selloutTheme from '../sellout.theme';
|
import selloutTheme from '../sellout.theme';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { common, red } from "@material-ui/core/colors";
|
import { common, red } from '@material-ui/core/colors';
|
||||||
|
|
||||||
export const SELLOUT_APP_PRIMARY_COLOR = red[500];
|
export const SELLOUT_APP_PRIMARY_COLOR = red[500];
|
||||||
export const SELLOUT_APP_ICON_COLOR = common.white;
|
export const SELLOUT_APP_ICON_COLOR = common.white;
|
||||||
@@ -10,9 +10,9 @@ const theme = {
|
|||||||
main: SELLOUT_APP_PRIMARY_COLOR,
|
main: SELLOUT_APP_PRIMARY_COLOR,
|
||||||
dark: red[700],
|
dark: red[700],
|
||||||
light: red[200],
|
light: red[200],
|
||||||
contrastText: SELLOUT_APP_TEXT_COLOR
|
contrastText: SELLOUT_APP_TEXT_COLOR,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
@@ -186,7 +186,8 @@ InjectDebugData(
|
|||||||
profile_name: 'ItsChip',
|
profile_name: 'ItsChip',
|
||||||
isMine: false,
|
isMine: false,
|
||||||
isReported: false,
|
isReported: false,
|
||||||
message: 'I have tweeted this because Im even more badass... And I need this to be longer so I will continue to write',
|
message:
|
||||||
|
'I have tweeted this because Im even more badass... And I need this to be longer so I will continue to write',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -23,10 +23,9 @@ export const ImagePrompt = ({ visible, value, handleChange }) => {
|
|||||||
textFieldRef.current && textFieldRef.current.focus();
|
textFieldRef.current && textFieldRef.current.focus();
|
||||||
}, [visible]);
|
}, [visible]);
|
||||||
|
|
||||||
const handleImageChange = useCallback(
|
const handleImageChange = useCallback((e) => handleChange(e.target.value), [
|
||||||
(e) => handleChange(e.target.value),
|
handleChange,
|
||||||
[handleChange]
|
]);
|
||||||
);
|
|
||||||
|
|
||||||
if (!visible) return null;
|
if (!visible) return null;
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const useStyles = makeStyles({
|
|||||||
},
|
},
|
||||||
textFieldInput: {
|
textFieldInput: {
|
||||||
fontSize: '22px',
|
fontSize: '22px',
|
||||||
paddingTop: '8px'
|
paddingTop: '8px',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ function processTweet(tweet) {
|
|||||||
* there and have moved that logic here instead.
|
* there and have moved that logic here instead.
|
||||||
*/
|
*/
|
||||||
export const useTwitterService = () => {
|
export const useTwitterService = () => {
|
||||||
const { addAlert } = useSnackbar()
|
const { addAlert } = useSnackbar();
|
||||||
const { setNotification } = useTwitterNotifications();
|
const { setNotification } = useTwitterNotifications();
|
||||||
|
|
||||||
const setProfile = useSetRecoilState(twitterState.profile);
|
const setProfile = useSetRecoilState(twitterState.profile);
|
||||||
@@ -38,7 +38,6 @@ export const useTwitterService = () => {
|
|||||||
twitterState.updateProfileLoading
|
twitterState.updateProfileLoading
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const setTweets = useSetRecoilState(twitterState.tweets);
|
const setTweets = useSetRecoilState(twitterState.tweets);
|
||||||
const setFilteredTweets = useSetRecoilState(twitterState.filteredTweets);
|
const setFilteredTweets = useSetRecoilState(twitterState.filteredTweets);
|
||||||
const setCreateLoading = useSetRecoilState(twitterState.createTweetLoading);
|
const setCreateLoading = useSetRecoilState(twitterState.createTweetLoading);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
export function getNewLineCount(message: string): number {
|
export function getNewLineCount(message: string): number {
|
||||||
return message.split(/\r\n|\r|\n/).length;
|
return message.split(/\r\n|\r|\n/).length;
|
||||||
}
|
}
|
||||||
@@ -4,15 +4,13 @@ export type AlertCategory =
|
|||||||
| 'NOTES_UPDATE_SUCCESS'
|
| 'NOTES_UPDATE_SUCCESS'
|
||||||
| 'NOTES_UPDATE_FAILED'
|
| 'NOTES_UPDATE_FAILED'
|
||||||
| 'NOTES_DELETE_SUCCESS'
|
| 'NOTES_DELETE_SUCCESS'
|
||||||
| 'NOTES_DELETE_FAILED'
|
| 'NOTES_DELETE_FAILED';
|
||||||
|
|
||||||
|
|
||||||
export interface INotesAlert {
|
export interface INotesAlert {
|
||||||
alert: AlertCategory;
|
alert: AlertCategory;
|
||||||
setAlert: (type: AlertCategory) => void;
|
setAlert: (type: AlertCategory) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface Note {
|
export interface Note {
|
||||||
id?: number;
|
id?: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {
|
import { blue, common, grey, purple } from '@material-ui/core/colors';
|
||||||
blue,
|
|
||||||
common,
|
|
||||||
grey,
|
|
||||||
purple,
|
|
||||||
} from '@material-ui/core/colors';
|
|
||||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import {
|
import {
|
||||||
faAd,
|
faAd,
|
||||||
@@ -41,9 +36,18 @@ import {
|
|||||||
CONTACTS_APP_PRIMARY_COLOR,
|
CONTACTS_APP_PRIMARY_COLOR,
|
||||||
CONTACTS_APP_TEXT_COLOR,
|
CONTACTS_APP_TEXT_COLOR,
|
||||||
} from '../../../apps/contacts/contacts.theme';
|
} from '../../../apps/contacts/contacts.theme';
|
||||||
import { SELLOUT_APP_PRIMARY_COLOR, SELLOUT_APP_ICON_COLOR } from '../../../apps/sellout/sellout.theme';
|
import {
|
||||||
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
SELLOUT_APP_PRIMARY_COLOR,
|
||||||
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
SELLOUT_APP_ICON_COLOR,
|
||||||
|
} from '../../../apps/sellout/sellout.theme';
|
||||||
|
import {
|
||||||
|
NOTES_APP_ICON_COLOR,
|
||||||
|
NOTES_APP_PRIMARY_COLOR,
|
||||||
|
} from '../../../apps/notes/notes.theme';
|
||||||
|
import {
|
||||||
|
DIALER_APP_PRIMARY_COLOR,
|
||||||
|
DIALER_APP_TEXT_COLOR,
|
||||||
|
} from '../../../apps/dialer/dialer.theme';
|
||||||
|
|
||||||
export interface IAppConfig {
|
export interface IAppConfig {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -70,7 +74,7 @@ export const APPS: IAppConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'MESSAGES',
|
id: 'MESSAGES',
|
||||||
nameLocale: 'APPS_MESSAGES',
|
nameLocale: 'APPS_MESSAGES',
|
||||||
icon: <MessageIcon fontSize="large" />,
|
icon: <MessageIcon fontSize='large' />,
|
||||||
notificationIcon: <MessageIcon fontSize='small' />,
|
notificationIcon: <MessageIcon fontSize='small' />,
|
||||||
backgroundColor: MESSAGES_APP_PRIMARY_COLOR,
|
backgroundColor: MESSAGES_APP_PRIMARY_COLOR,
|
||||||
color: MESSAGES_APP_TEXT_COLOR,
|
color: MESSAGES_APP_TEXT_COLOR,
|
||||||
@@ -82,7 +86,7 @@ export const APPS: IAppConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'CONTACTS',
|
id: 'CONTACTS',
|
||||||
nameLocale: 'APPS_CONTACTS',
|
nameLocale: 'APPS_CONTACTS',
|
||||||
icon: <ContactsIcon fontSize="large" />,
|
icon: <ContactsIcon fontSize='large' />,
|
||||||
notificationIcon: <ContactsIcon fontSize='small' />,
|
notificationIcon: <ContactsIcon fontSize='small' />,
|
||||||
backgroundColor: CONTACTS_APP_PRIMARY_COLOR,
|
backgroundColor: CONTACTS_APP_PRIMARY_COLOR,
|
||||||
color: CONTACTS_APP_TEXT_COLOR,
|
color: CONTACTS_APP_TEXT_COLOR,
|
||||||
@@ -94,7 +98,7 @@ export const APPS: IAppConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'CALCULATOR',
|
id: 'CALCULATOR',
|
||||||
nameLocale: 'APPS_CALCULATOR',
|
nameLocale: 'APPS_CALCULATOR',
|
||||||
icon: <CalculatorIcon fontSize="large" />,
|
icon: <CalculatorIcon fontSize='large' />,
|
||||||
notificationIcon: <CalculatorIcon fontSize='small' />,
|
notificationIcon: <CalculatorIcon fontSize='small' />,
|
||||||
backgroundColor: purple[500],
|
backgroundColor: purple[500],
|
||||||
color: grey[50],
|
color: grey[50],
|
||||||
@@ -106,7 +110,7 @@ export const APPS: IAppConfig[] = [
|
|||||||
{
|
{
|
||||||
id: 'SETTINGS',
|
id: 'SETTINGS',
|
||||||
nameLocale: 'APPS_SETTINGS',
|
nameLocale: 'APPS_SETTINGS',
|
||||||
icon: <SettingsIcon fontSize="large" />,
|
icon: <SettingsIcon fontSize='large' />,
|
||||||
notificationIcon: <SettingsIcon fontSize='small' />,
|
notificationIcon: <SettingsIcon fontSize='small' />,
|
||||||
backgroundColor: '#383838',
|
backgroundColor: '#383838',
|
||||||
color: grey[50],
|
color: grey[50],
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
export function isObject(item) {
|
export function isObject(item) {
|
||||||
return (item && typeof item === 'object' && !Array.isArray(item));
|
return item && typeof item === 'object' && !Array.isArray(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export const CallModal = () => {
|
|||||||
<CallTimer isAccepted={call?.accepted} />
|
<CallTimer isAccepted={call?.accepted} />
|
||||||
</Box>
|
</Box>
|
||||||
<div className={classes.actions}>
|
<div className={classes.actions}>
|
||||||
<CallControls size="medium" />
|
<CallControls size='medium' />
|
||||||
</div>
|
</div>
|
||||||
</AppContent>
|
</AppContent>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React, { useEffect, useRef } from 'react';
|
import React, { useEffect, useRef } from 'react';
|
||||||
import { useDuration } from '../hooks/useDuration';
|
import { useDuration } from '../hooks/useDuration';
|
||||||
|
|
||||||
|
|
||||||
const runTimer = (updatedTime, setDuration) => {
|
const runTimer = (updatedTime, setDuration) => {
|
||||||
let newTime = { ...updatedTime.current };
|
let newTime = { ...updatedTime.current };
|
||||||
if (newTime.m >= 60) {
|
if (newTime.m >= 60) {
|
||||||
@@ -17,25 +16,24 @@ const runTimer = (updatedTime, setDuration) => {
|
|||||||
newTime = { ...newTime, ms: newTime.ms + 1 };
|
newTime = { ...newTime, ms: newTime.ms + 1 };
|
||||||
updatedTime.current = newTime;
|
updatedTime.current = newTime;
|
||||||
setDuration(newTime);
|
setDuration(newTime);
|
||||||
}
|
};
|
||||||
|
|
||||||
function CallTimer({ isAccepted }) {
|
function CallTimer({ isAccepted }) {
|
||||||
const { duration, setDuration } = useDuration();
|
const { duration, setDuration } = useDuration();
|
||||||
const updatedTime = useRef({ ms: 0, s: 0, m: 0, h: 0 });
|
const updatedTime = useRef({ ms: 0, s: 0, m: 0, h: 0 });
|
||||||
const timer = useRef(null)
|
const timer = useRef(null);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isAccepted) {
|
if (isAccepted) {
|
||||||
runTimer(updatedTime, setDuration)
|
runTimer(updatedTime, setDuration);
|
||||||
timer.current = setInterval(() => {
|
timer.current = setInterval(() => {
|
||||||
runTimer(updatedTime, setDuration)
|
runTimer(updatedTime, setDuration);
|
||||||
}, 10);
|
}, 10);
|
||||||
} else {
|
} else {
|
||||||
clearInterval(timer.current);
|
clearInterval(timer.current);
|
||||||
timer.current = null;
|
timer.current = null;
|
||||||
}
|
}
|
||||||
return () => clearInterval(timer.current)
|
return () => clearInterval(timer.current);
|
||||||
}, [isAccepted, setDuration]);
|
}, [isAccepted, setDuration]);
|
||||||
|
|
||||||
if (!duration || !isAccepted) return null;
|
if (!duration || !isAccepted) return null;
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { atom } from 'recoil';
|
|||||||
export const callerState = {
|
export const callerState = {
|
||||||
currentCall: atom({
|
currentCall: atom({
|
||||||
key: 'currentCall',
|
key: 'currentCall',
|
||||||
default: null
|
default: null,
|
||||||
}),
|
}),
|
||||||
callModal: atom({
|
callModal: atom({
|
||||||
key: 'callingModal',
|
key: 'callingModal',
|
||||||
default: false
|
default: false,
|
||||||
}),
|
}),
|
||||||
callDuration: atom({
|
callDuration: atom({
|
||||||
key: 'callDuration',
|
key: 'callDuration',
|
||||||
default: {ms: 0, s: 0, m: 0, h: 0}
|
default: { ms: 0, s: 0, m: 0, h: 0 },
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
@@ -8,5 +8,5 @@ interface ModalProps {
|
|||||||
|
|
||||||
export const useCallModal = (): ModalProps => {
|
export const useCallModal = (): ModalProps => {
|
||||||
const [modal, setModal] = useRecoilState(callerState.callModal);
|
const [modal, setModal] = useRecoilState(callerState.callModal);
|
||||||
return { modal, setModal }
|
return { modal, setModal };
|
||||||
}
|
};
|
||||||
@@ -9,7 +9,7 @@ interface INotificationIcon {
|
|||||||
|
|
||||||
export const NotificationIcon = ({ icon, to }: INotificationIcon) => {
|
export const NotificationIcon = ({ icon, to }: INotificationIcon) => {
|
||||||
return (
|
return (
|
||||||
<IconButton component={NavLink} to={to} size="small">
|
<IconButton component={NavLink} to={to} size='small'>
|
||||||
{icon}
|
{icon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ const useStyles = makeStyles({
|
|||||||
msg: {
|
msg: {
|
||||||
maxWidth: '300px',
|
maxWidth: '300px',
|
||||||
wordWrap: 'break-word',
|
wordWrap: 'break-word',
|
||||||
fontSize: '1em'
|
fontSize: '1em',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ interface IContextMenuOption {
|
|||||||
selected?: boolean;
|
selected?: boolean;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
key?: string;
|
key?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
interface IContextMenuProps {
|
interface IContextMenuProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -65,7 +65,10 @@ export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{option.icon && <ListItemIcon>{option.icon}</ListItemIcon>}
|
{option.icon && <ListItemIcon>{option.icon}</ListItemIcon>}
|
||||||
<ListItemText primary={option.label} secondary={option.description} />
|
<ListItemText
|
||||||
|
primary={option.label}
|
||||||
|
secondary={option.description}
|
||||||
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
|
|||||||
@@ -3,23 +3,13 @@ import { AppIcon } from './AppIcon';
|
|||||||
import { Box, Grid } from '@material-ui/core';
|
import { Box, Grid } from '@material-ui/core';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
export const GridMenu = ({
|
export const GridMenu = ({ items, Component = AppIcon, xs = undefined }) => {
|
||||||
items,
|
|
||||||
Component = AppIcon,
|
|
||||||
xs = undefined,
|
|
||||||
}) => {
|
|
||||||
return (
|
return (
|
||||||
<Grid container alignItems='center' direction='row'>
|
<Grid container alignItems='center' direction='row'>
|
||||||
{items &&
|
{items &&
|
||||||
items.length &&
|
items.length &&
|
||||||
items.map((item) => (
|
items.map((item) => (
|
||||||
<Grid
|
<Grid item xs={xs} key={item.id} alignItems='center' justify='center'>
|
||||||
item
|
|
||||||
xs={xs}
|
|
||||||
key={item.id}
|
|
||||||
alignItems='center'
|
|
||||||
justify='center'
|
|
||||||
>
|
|
||||||
<Box textAlign='center'>
|
<Box textAlign='center'>
|
||||||
<Link to={item.path}>
|
<Link to={item.path}>
|
||||||
<Component {...item} />
|
<Component {...item} />
|
||||||
|
|||||||
@@ -2,15 +2,15 @@ import React from 'react';
|
|||||||
import { makeStyles } from '@material-ui/core';
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
src: string,
|
src: string;
|
||||||
alt: string
|
alt: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles({
|
const useStyles = makeStyles({
|
||||||
root: {
|
root: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
objectFit: 'contain'
|
objectFit: 'contain',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const PictureResponsive = ({ src, alt }: IProps) => {
|
export const PictureResponsive = ({ src, alt }: IProps) => {
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ interface IStyleProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
src: string,
|
src: string;
|
||||||
alt: string,
|
alt: string;
|
||||||
size?: string
|
size?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const useStyles = makeStyles<Theme, IStyleProps>({
|
const useStyles = makeStyles<Theme, IStyleProps>({
|
||||||
|
|||||||
@@ -56,5 +56,11 @@ export const StatusIconButton = ({
|
|||||||
...props
|
...props
|
||||||
}: Omit<IconButtonProps, 'color'> & { color: StatusButtonStyleColor }) => {
|
}: Omit<IconButtonProps, 'color'> & { color: StatusButtonStyleColor }) => {
|
||||||
const classes = useStyles({ color });
|
const classes = useStyles({ color });
|
||||||
return <IconButton className={`${classes.root} ${className}`} size={size} {...props} />;
|
return (
|
||||||
|
<IconButton
|
||||||
|
className={`${classes.root} ${className}`}
|
||||||
|
size={size}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
import { useContext } from 'react';
|
import { useContext } from 'react';
|
||||||
import { SnackbarContext } from '../providers/SnackbarProvider';
|
import { SnackbarContext } from '../providers/SnackbarProvider';
|
||||||
|
|
||||||
|
|
||||||
export interface IAlert {
|
export interface IAlert {
|
||||||
message: string;
|
message: string;
|
||||||
type: 'success' | 'error' | 'info'
|
type: 'success' | 'error' | 'info';
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ISnackBar {
|
interface ISnackBar {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ onNet(events.CONTACTS_ACTION_RESULT, (alert: any) => {
|
|||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CONTACTS',
|
app: 'CONTACTS',
|
||||||
method: 'setAlert',
|
method: 'setAlert',
|
||||||
data: alert
|
data: alert,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -30,7 +30,6 @@ onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
|||||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
onNet(events.NOTE_ACTION_RESULT, (alert: any) => {
|
onNet(events.NOTE_ACTION_RESULT, (alert: any) => {
|
||||||
sendNotesEvent('setAlert', alert)
|
sendNotesEvent('setAlert', alert);
|
||||||
})
|
});
|
||||||
@@ -111,22 +111,18 @@ onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => {
|
|||||||
//emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
//emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
||||||
|
|
||||||
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source);
|
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source);
|
||||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||||
{
|
|
||||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||||
type: 'success'
|
type: 'success',
|
||||||
}
|
});
|
||||||
);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bankLogger.error(`Failed to add transaction, ${e.message}`, {
|
bankLogger.error(`Failed to add transaction, ${e.message}`, {
|
||||||
source: _source,
|
source: _source,
|
||||||
});
|
});
|
||||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||||
{
|
|
||||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||||
type: 'error'
|
type: 'error',
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -41,15 +41,15 @@ function getRandomPhoneNumber() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function generatePhoneNumber(identifier: string) {
|
async function generatePhoneNumber(identifier: string) {
|
||||||
if (!await usePhoneNumber(identifier)) {
|
if (!(await usePhoneNumber(identifier))) {
|
||||||
let existingId;
|
let existingId;
|
||||||
let newNumber;
|
let newNumber;
|
||||||
do {
|
do {
|
||||||
newNumber = getRandomPhoneNumber();
|
newNumber = getRandomPhoneNumber();
|
||||||
try {
|
try {
|
||||||
existingId = await getIdentifierByPhoneNumber(newNumber)
|
existingId = await getIdentifierByPhoneNumber(newNumber);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
existingId = false
|
existingId = false;
|
||||||
}
|
}
|
||||||
} while (existingId);
|
} while (existingId);
|
||||||
mainLogger.verbose(`Inserting number into Database: ${newNumber}`);
|
mainLogger.verbose(`Inserting number into Database: ${newNumber}`);
|
||||||
@@ -67,16 +67,16 @@ async function getCredentials(identifier: string): Promise<string> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onNet('esx:playerLoaded', async (playerId: number, xPlayer: any) => {
|
onNet('esx:playerLoaded', async (playerId: number, xPlayer: any) => {
|
||||||
const _source = getSource()
|
const _source = getSource();
|
||||||
try {
|
try {
|
||||||
const identifier = xPlayer.identifier;
|
const identifier = xPlayer.identifier;
|
||||||
await generatePhoneNumber(identifier);
|
await generatePhoneNumber(identifier);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
mainLogger.error(`Failed to generate a phone number, ${e.message}`, {
|
mainLogger.error(`Failed to generate a phone number, ${e.message}`, {
|
||||||
source: _source,
|
source: _source,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
onNet('phone:getCredentials', async () => {
|
onNet('phone:getCredentials', async () => {
|
||||||
const _source = getSource();
|
const _source = getSource();
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
|
|||||||
await updateProfile(identifier, profile);
|
await updateProfile(identifier, profile);
|
||||||
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
||||||
message: 'TWITTER_EDIT_PROFILE_SUCCESS',
|
message: 'TWITTER_EDIT_PROFILE_SUCCESS',
|
||||||
type: 'success'
|
type: 'success',
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
twitterLogger.error(`Failed to update twitter profile: ${e.message}`, {
|
twitterLogger.error(`Failed to update twitter profile: ${e.message}`, {
|
||||||
@@ -321,7 +321,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
|
|||||||
});
|
});
|
||||||
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
||||||
message: 'TWITTER_EDIT_PROFILE_FAILURE',
|
message: 'TWITTER_EDIT_PROFILE_FAILURE',
|
||||||
type: 'error'
|
type: 'error',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -368,7 +368,7 @@ onNet(events.TWITTER_CREATE_TWEET, async (tweet: Tweet) => {
|
|||||||
});
|
});
|
||||||
emitNet(events.TWITTER_CREATE_TWEET_RESULT, _source, {
|
emitNet(events.TWITTER_CREATE_TWEET_RESULT, _source, {
|
||||||
message: 'TWITTER_CREATE_FAILED',
|
message: 'TWITTER_CREATE_FAILED',
|
||||||
type: 'error'
|
type: 'error',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
TWITTER: 'TWITTER',
|
TWITTER: 'TWITTER',
|
||||||
MESSAGES: 'MESSAGES',
|
MESSAGES: 'MESSAGES',
|
||||||
NOTES: 'NOTES'
|
NOTES: 'NOTES',
|
||||||
};
|
};
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
export const tokenData = {
|
export const tokenData = {
|
||||||
token: '2518ea90647ba45'
|
token: '2518ea90647ba45',
|
||||||
}
|
};
|
||||||
+20
-20
@@ -1,28 +1,28 @@
|
|||||||
const webpack = require("webpack");
|
const webpack = require('webpack');
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const RemovePlugin = require("remove-files-webpack-plugin");
|
const RemovePlugin = require('remove-files-webpack-plugin');
|
||||||
|
|
||||||
const buildPath = path.resolve(__dirname, "dist");
|
const buildPath = path.resolve(__dirname, 'dist');
|
||||||
|
|
||||||
const server = {
|
const server = {
|
||||||
entry: "./server/server.ts",
|
entry: './server/server.ts',
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
use: ["ts-loader"],
|
use: ['ts-loader'],
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.DefinePlugin({ "global.GENTLY": false }),
|
new webpack.DefinePlugin({ 'global.GENTLY': false }),
|
||||||
new RemovePlugin({
|
new RemovePlugin({
|
||||||
before: {
|
before: {
|
||||||
include: [path.resolve(buildPath, "server")],
|
include: [path.resolve(buildPath, 'server')],
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
include: [path.resolve(buildPath, "server")],
|
include: [path.resolve(buildPath, 'server')],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -30,22 +30,22 @@ const server = {
|
|||||||
minimize: true,
|
minimize: true,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".tsx", ".ts", ".js"],
|
extensions: ['.tsx', '.ts', '.js'],
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: "[contenthash].server.js",
|
filename: '[contenthash].server.js',
|
||||||
path: path.resolve(buildPath, "server"),
|
path: path.resolve(buildPath, 'server'),
|
||||||
},
|
},
|
||||||
target: "node",
|
target: 'node',
|
||||||
};
|
};
|
||||||
|
|
||||||
const client = {
|
const client = {
|
||||||
entry: "./client/client.ts",
|
entry: './client/client.ts',
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.tsx?$/,
|
test: /\.tsx?$/,
|
||||||
use: ["ts-loader"],
|
use: ['ts-loader'],
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -53,10 +53,10 @@ const client = {
|
|||||||
plugins: [
|
plugins: [
|
||||||
new RemovePlugin({
|
new RemovePlugin({
|
||||||
before: {
|
before: {
|
||||||
include: [path.resolve(buildPath, "client")],
|
include: [path.resolve(buildPath, 'client')],
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
include: [path.resolve(buildPath, "client")],
|
include: [path.resolve(buildPath, 'client')],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@@ -64,11 +64,11 @@ const client = {
|
|||||||
minimize: true,
|
minimize: true,
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".tsx", ".ts", ".js"],
|
extensions: ['.tsx', '.ts', '.js'],
|
||||||
},
|
},
|
||||||
output: {
|
output: {
|
||||||
filename: "[contenthash].client.js",
|
filename: '[contenthash].client.js',
|
||||||
path: path.resolve(buildPath, "client"),
|
path: path.resolve(buildPath, 'client'),
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user