mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-01 14:38:47 +00:00
mad formatting
This commit is contained in:
1 parent
6777498bcc
commit
046447b0fb
74 files changed
+329
-309
No files matched your search
+1
-1
@@ -6,4 +6,4 @@
|
||||
"trailingComma": "all",
|
||||
"useTabs": false,
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,27 @@
|
||||
# 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.
|
||||
|
||||
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
|
||||
|
||||
- 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.
|
||||
|
||||
## Support
|
||||
|
||||
No support is being provided currently for the resource as it is still in an unfinished state.
|
||||
No support is being provided currently for the resource as it is still in an unfinished state.
|
||||
|
||||
Should you encounter any issues, please do the following:
|
||||
|
||||
- Check the [Git Kraken](https://app.gitkraken.com/glo/board/X9YZ_x_SVQEcMwpH) to see if the issue you're referring to is already tracked.
|
||||
- Check the [State of Development](https://docs.projecterror.dev/#/npwd/state-of-dev?id=introduction) to see if the app is still a **WIP**.
|
||||
- If the issue isn't on the Git Kraken and the app is finished, please open an issue.
|
||||
- If the issue isn't on the Git Kraken and the app is **not** finished, please contact us in Discord.
|
||||
- If the issue isn't on the Git Kraken and the app is finished, please open an issue.
|
||||
- If the issue isn't on the Git Kraken and the app is **not** finished, please contact us in Discord.
|
||||
|
||||
We do not want issues opened that are due to the phone being **WIP** as this slows down development since we now have to address it more immediately.
|
||||
|
||||
@@ -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)
|
||||
|
||||
#### Apps (February 20th, 2021)
|
||||
|
||||
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)
|
||||
- [**Calculator**](https://i.imgur.com/96e3bFF.png)
|
||||
- [**Camera**](https://i.imgur.com/1aGEV28.png)
|
||||
|
||||
+36
-36
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"Locale": "en",
|
||||
"KeyTogglePhone": 288,
|
||||
"KeyTakeCall": 38,
|
||||
"PhoneAsItem": false,
|
||||
"SwimDestroy": false,
|
||||
"RunRate": 10,
|
||||
"DestoryChance": 100,
|
||||
"DestroyPhoneReCheck": 3,
|
||||
"notificationPosition": {
|
||||
"horizontal": "right",
|
||||
"vertical": "top"
|
||||
},
|
||||
"general": {
|
||||
"useDashNumber": true
|
||||
},
|
||||
"twitter": {
|
||||
"showNotifications": true,
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true,
|
||||
"allowDeleteTweets": true,
|
||||
"allowReportTweets": true,
|
||||
"characterLimit": 160,
|
||||
"newLineLimit": 10,
|
||||
"enableAvatars": true,
|
||||
"enableEmojis": true,
|
||||
"enableImages": true,
|
||||
"maxImages": 3
|
||||
},
|
||||
"bank": {
|
||||
"showNotifications": true
|
||||
},
|
||||
"debug": {
|
||||
"level": "debug",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
"Locale": "en",
|
||||
"KeyTogglePhone": 288,
|
||||
"KeyTakeCall": 38,
|
||||
"PhoneAsItem": false,
|
||||
"SwimDestroy": false,
|
||||
"RunRate": 10,
|
||||
"DestoryChance": 100,
|
||||
"DestroyPhoneReCheck": 3,
|
||||
"notificationPosition": {
|
||||
"horizontal": "right",
|
||||
"vertical": "top"
|
||||
},
|
||||
"general": {
|
||||
"useDashNumber": true
|
||||
},
|
||||
"twitter": {
|
||||
"showNotifications": true,
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true,
|
||||
"allowDeleteTweets": true,
|
||||
"allowReportTweets": true,
|
||||
"characterLimit": 160,
|
||||
"newLineLimit": 10,
|
||||
"enableAvatars": true,
|
||||
"enableEmojis": true,
|
||||
"enableImages": true,
|
||||
"maxImages": 3
|
||||
},
|
||||
"bank": {
|
||||
"showNotifications": true
|
||||
},
|
||||
"debug": {
|
||||
"level": "debug",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
+1
-4
@@ -1,8 +1,5 @@
|
||||
{
|
||||
"packages": [
|
||||
"phone",
|
||||
"resources"
|
||||
],
|
||||
"packages": ["phone", "resources"],
|
||||
"version": "0.0.0",
|
||||
"npmClient": "yarn"
|
||||
}
|
||||
+2
-1
@@ -8,7 +8,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "lerna run build --concurrency 1",
|
||||
"prepare": "husky install"
|
||||
"prepare": "husky install",
|
||||
"format": "pretty-quick"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
# New Phone Who Dis
|
||||
|
||||
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
|
||||
module.exports = {
|
||||
trailingComma: "es5",
|
||||
trailingComma: 'es5',
|
||||
tabWidth: 2,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
jsxSingleQuote: true,
|
||||
jsxBracketSameLine: false,
|
||||
bracketSpacing: true
|
||||
}
|
||||
bracketSpacing: true,
|
||||
};
|
||||
@@ -2,8 +2,14 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link 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" />
|
||||
<link
|
||||
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" />
|
||||
<title>Project Error - New Phone Who Dis</title>
|
||||
</head>
|
||||
|
||||
@@ -7,6 +7,6 @@ interface BankModalProps {
|
||||
}
|
||||
|
||||
export const useBankModal = (): BankModalProps => {
|
||||
const [ showBankModal, setShowBankModal ] = useRecoilState(bankState.bankModal);
|
||||
const [showBankModal, setShowBankModal] = useRecoilState(bankState.bankModal);
|
||||
return { showBankModal, setShowBankModal };
|
||||
};
|
||||
@@ -10,7 +10,7 @@ export const useBankService = () => {
|
||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||
const setCredentials = useSetRecoilState(bankState.bankCredentials);
|
||||
const setNotification = useSetRecoilState(bankState.notification);
|
||||
const { addAlert } = useSnackbar()
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
||||
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { SvgIcon, SvgIconProps } from '@material-ui/core';
|
||||
|
||||
export const CalculatorIcon = ({ ...props}: SvgIconProps) => {
|
||||
export const CalculatorIcon = ({ ...props }: SvgIconProps) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<svg
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import React from 'react';
|
||||
import { InputBase } from '@material-ui/core';
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import {
|
||||
createStyles,
|
||||
Theme,
|
||||
makeStyles,
|
||||
} from '@material-ui/core/styles';
|
||||
import { createStyles, Theme, makeStyles } from '@material-ui/core/styles';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ const ContactsInfoPage = () => {
|
||||
const { getContact } = useContacts();
|
||||
|
||||
const { id } = useParams<ContactInfoRouteParams>();
|
||||
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({ referal: '/contacts' });
|
||||
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({
|
||||
referal: '/contacts',
|
||||
});
|
||||
|
||||
const contact = getContact(parseInt(id));
|
||||
|
||||
|
||||
@@ -20,5 +20,5 @@ export const contactsState = {
|
||||
contactDetail: atom({
|
||||
key: 'contactDetail',
|
||||
default: null,
|
||||
})
|
||||
}),
|
||||
};
|
||||
@@ -6,8 +6,8 @@ import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
|
||||
export const useContactsService = () => {
|
||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||
const { addAlert } = useSnackbar()
|
||||
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
||||
useNuiEvent('CONTACTS', 'setAlert', addAlert);
|
||||
return useContacts();
|
||||
|
||||
@@ -19,7 +19,12 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<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}
|
||||
</Button>
|
||||
</Grid>
|
||||
@@ -27,10 +32,10 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => {
|
||||
};
|
||||
|
||||
export const DialGrid = () => {
|
||||
const { add, removeOne, clear} = useContext(DialInputCtx)
|
||||
const { add, removeOne, clear } = useContext(DialInputCtx);
|
||||
|
||||
return (
|
||||
<Box height="100%">
|
||||
<Box height='100%'>
|
||||
<Grid container justify='space-around'>
|
||||
<ButtonItem label={1} onClick={() => add(1)} />
|
||||
<ButtonItem label={2} onClick={() => add(2)} />
|
||||
|
||||
@@ -39,8 +39,8 @@ export const DialerInput = () => {
|
||||
};
|
||||
|
||||
const handleNewContact = (number: string) => {
|
||||
history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`)
|
||||
}
|
||||
history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box component={Paper} className={classes.root}>
|
||||
@@ -50,10 +50,13 @@ export const DialerInput = () => {
|
||||
value={inputVal}
|
||||
/>
|
||||
<IconButton color='primary' className={classes.iconBtn}>
|
||||
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
||||
<PhoneIcon fontSize='large' onClick={() => handleCall(inputVal)} />
|
||||
</IconButton>
|
||||
<IconButton className={classes.iconBtn}>
|
||||
<PersonAddIcon fontSize="large" onClick={() => handleNewContact(inputVal)} />
|
||||
<PersonAddIcon
|
||||
fontSize='large'
|
||||
onClick={() => handleNewContact(inputVal)}
|
||||
/>
|
||||
</IconButton>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -42,7 +42,7 @@ const DialerNavBar = () => {
|
||||
<BottomNavigationAction
|
||||
label='Dial'
|
||||
value='/phone/dial'
|
||||
color="secondary"
|
||||
color='secondary'
|
||||
component={NavLink}
|
||||
icon={<PhoneIcon />}
|
||||
to='/phone/dial'
|
||||
@@ -50,7 +50,7 @@ const DialerNavBar = () => {
|
||||
<BottomNavigationAction
|
||||
label='Contacts'
|
||||
value='/phone/contacts'
|
||||
color="secondary"
|
||||
color='secondary'
|
||||
component={NavLink}
|
||||
icon={<PersonIcon />}
|
||||
to='/phone/contacts'
|
||||
|
||||
@@ -62,10 +62,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
<List disablePadding>
|
||||
{calls.map((call: ICall) =>
|
||||
call.transmitter === number ? (
|
||||
<ListItem
|
||||
key={call.id}
|
||||
divider
|
||||
>
|
||||
<ListItem key={call.id} divider>
|
||||
<ListItemIcon>
|
||||
{<PhoneForwardedIcon className={classes.callForward} />}
|
||||
</ListItemIcon>
|
||||
@@ -91,10 +88,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
) : null}
|
||||
</ListItem>
|
||||
) : (
|
||||
<ListItem
|
||||
key={call.id}
|
||||
divider
|
||||
>
|
||||
<ListItem key={call.id} divider>
|
||||
<ListItemIcon>
|
||||
{<PhoneCallbackIcon className={classes.callBack} />}
|
||||
</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_TEXT_COLOR = common.white;
|
||||
@@ -9,9 +9,9 @@ const theme = {
|
||||
main: DIALER_APP_PRIMARY_COLOR,
|
||||
dark: green[800],
|
||||
light: green[400],
|
||||
contrastText: DIALER_APP_TEXT_COLOR
|
||||
}
|
||||
}
|
||||
}
|
||||
contrastText: DIALER_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
@@ -1,9 +1,9 @@
|
||||
const theme = {
|
||||
palette: {
|
||||
primary: {
|
||||
main: '#f23123'
|
||||
}
|
||||
}
|
||||
}
|
||||
main: '#f23123',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
export default theme;
|
||||
@@ -8,7 +8,7 @@ export const HomeApp = () => {
|
||||
const { apps } = useApps();
|
||||
return (
|
||||
<AppWrapper>
|
||||
<Box component="div" mt={6} px={1}>
|
||||
<Box component='div' mt={6} px={1}>
|
||||
{apps && <GridMenu xs={3} items={apps} />}
|
||||
</Box>
|
||||
</AppWrapper>
|
||||
|
||||
@@ -21,13 +21,9 @@ export function NewMessageGroupButton({
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<Fab
|
||||
className={classes.root}
|
||||
color='primary'
|
||||
onClick={onClick}
|
||||
>
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
<Fab className={classes.root} color='primary' onClick={onClick}>
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,8 +101,14 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
</Box>
|
||||
)}
|
||||
<Box px={2} py={3}>
|
||||
<Button disabled={submitDisabled} variant='contained' fullWidth color='primary' type='submit'>
|
||||
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
||||
<Button
|
||||
disabled={submitDisabled}
|
||||
variant='contained'
|
||||
fullWidth
|
||||
color='primary'
|
||||
type='submit'
|
||||
>
|
||||
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
||||
</Button>
|
||||
</Box>
|
||||
</form>
|
||||
|
||||
@@ -41,7 +41,12 @@ const MessagesList = (): any => {
|
||||
goToConversation(findGroup);
|
||||
}
|
||||
}
|
||||
}, [messageGroups, createMessageGroupResult, goToConversation, clearMessageGroupResult]);
|
||||
}, [
|
||||
messageGroups,
|
||||
createMessageGroupResult,
|
||||
goToConversation,
|
||||
clearMessageGroupResult,
|
||||
]);
|
||||
|
||||
if (!messageGroups) return null;
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ export const MessageImageModal = ({
|
||||
})}`
|
||||
),
|
||||
},
|
||||
|
||||
],
|
||||
[history, pathname, search]
|
||||
);
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
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';
|
||||
|
||||
interface IUseMessages {
|
||||
@@ -18,11 +22,20 @@ export default (): IUseMessages => {
|
||||
messageState.messageGroups
|
||||
);
|
||||
|
||||
const [createMessageGroupResult, setCreateMessageGroupResult] = useRecoilState<CreateMessageGroupResult | null>(
|
||||
const [
|
||||
createMessageGroupResult,
|
||||
setCreateMessageGroupResult,
|
||||
] = useRecoilState<CreateMessageGroupResult | null>(
|
||||
messageState.createMessageGroupResult
|
||||
);
|
||||
|
||||
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,
|
||||
dark: amber[900],
|
||||
light: amber[100],
|
||||
contrastText: MESSAGES_APP_TEXT_COLOR
|
||||
contrastText: MESSAGES_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -12,5 +12,5 @@ export const noteStates = {
|
||||
noteDetail: atom({
|
||||
key: 'noteDetail',
|
||||
default: null,
|
||||
})
|
||||
}),
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { Note } from '../../../common/typings/notes';
|
||||
import { noteStates } from './state';
|
||||
import { noteStates } from './state';
|
||||
|
||||
interface NotesProps {
|
||||
notes: Note[];
|
||||
@@ -9,4 +9,4 @@ interface NotesProps {
|
||||
export const useNotes = (): NotesProps => {
|
||||
const notes = useRecoilValue(noteStates.noteItems);
|
||||
return { notes };
|
||||
}
|
||||
};
|
||||
@@ -102,7 +102,7 @@ export const NoteModal = () => {
|
||||
<Typography paragraph>{detail.content.length}/250</Typography>
|
||||
{!detail.id ? (
|
||||
<>
|
||||
<Box display="inline" p={1}>
|
||||
<Box display='inline' p={1}>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
@@ -112,7 +112,7 @@ export const NoteModal = () => {
|
||||
{t('GENERIC_SAVE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box display="inline" p={1}>
|
||||
<Box display='inline' p={1}>
|
||||
<StatusButton
|
||||
color='error'
|
||||
variant='contained'
|
||||
@@ -124,7 +124,7 @@ export const NoteModal = () => {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Box display="inline" p={1}>
|
||||
<Box display='inline' p={1}>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
@@ -133,7 +133,7 @@ export const NoteModal = () => {
|
||||
{t('GENERIC_UPDATE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box display="inline" p={1}>
|
||||
<Box display='inline' p={1}>
|
||||
<StatusButton
|
||||
color='error'
|
||||
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_ICON_COLOR = common.white;
|
||||
@@ -10,9 +10,9 @@ const theme = {
|
||||
main: NOTES_APP_PRIMARY_COLOR,
|
||||
dark: yellow[900],
|
||||
light: yellow[500],
|
||||
contrastText: NOTES_APP_TEXT_COLOR
|
||||
}
|
||||
}
|
||||
}
|
||||
contrastText: NOTES_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
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';
|
||||
|
||||
export const NotesThemeProvider = createAppThemeProvider(notesTheme);
|
||||
@@ -31,7 +31,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
marginBottom: 20,
|
||||
},
|
||||
icon: {
|
||||
color: theme.palette.primary.main
|
||||
color: theme.palette.primary.main,
|
||||
},
|
||||
header: {
|
||||
margin: 10,
|
||||
|
||||
@@ -11,4 +11,4 @@ export const useSelloutService = () => {
|
||||
useNuiEvent('SELLOUT', 'setAlert', addAlert);
|
||||
useNuiEvent('SELLOUT', 'setListings', setSellout);
|
||||
return useListing();
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createAppThemeProvider } from "../../../os/apps/utils/createAppThemeProvider";
|
||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||
|
||||
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_ICON_COLOR = common.white;
|
||||
@@ -10,9 +10,9 @@ const theme = {
|
||||
main: SELLOUT_APP_PRIMARY_COLOR,
|
||||
dark: red[700],
|
||||
light: red[200],
|
||||
contrastText: SELLOUT_APP_TEXT_COLOR
|
||||
}
|
||||
}
|
||||
}
|
||||
contrastText: SELLOUT_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
@@ -186,7 +186,8 @@ InjectDebugData(
|
||||
profile_name: 'ItsChip',
|
||||
isMine: 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();
|
||||
}, [visible]);
|
||||
|
||||
const handleImageChange = useCallback(
|
||||
(e) => handleChange(e.target.value),
|
||||
[handleChange]
|
||||
);
|
||||
const handleImageChange = useCallback((e) => handleChange(e.target.value), [
|
||||
handleChange,
|
||||
]);
|
||||
|
||||
if (!visible) return null;
|
||||
return (
|
||||
|
||||
@@ -15,7 +15,7 @@ const useStyles = makeStyles({
|
||||
},
|
||||
textFieldInput: {
|
||||
fontSize: '22px',
|
||||
paddingTop: '8px'
|
||||
paddingTop: '8px',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ function processTweet(tweet) {
|
||||
* there and have moved that logic here instead.
|
||||
*/
|
||||
export const useTwitterService = () => {
|
||||
const { addAlert } = useSnackbar()
|
||||
const { addAlert } = useSnackbar();
|
||||
const { setNotification } = useTwitterNotifications();
|
||||
|
||||
const setProfile = useSetRecoilState(twitterState.profile);
|
||||
@@ -38,7 +38,6 @@ export const useTwitterService = () => {
|
||||
twitterState.updateProfileLoading
|
||||
);
|
||||
|
||||
|
||||
const setTweets = useSetRecoilState(twitterState.tweets);
|
||||
const setFilteredTweets = useSetRecoilState(twitterState.filteredTweets);
|
||||
const setCreateLoading = useSetRecoilState(twitterState.createTweetLoading);
|
||||
@@ -58,4 +57,4 @@ export const useTwitterService = () => {
|
||||
useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetResult', addAlert);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', setNotification);
|
||||
};
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
export function getNewLineCount(message: string): number {
|
||||
return message.split(/\r\n|\r|\n/).length;
|
||||
}
|
||||
return message.split(/\r\n|\r|\n/).length;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface IAlertProps {
|
||||
message: string;
|
||||
type: 'success' | 'error';
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@ export interface MarketplaceListing {
|
||||
title: string;
|
||||
url: string;
|
||||
description: string;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,16 @@
|
||||
export type AlertCategory =
|
||||
export type AlertCategory =
|
||||
| 'NOTES_ADD_SUCCESS'
|
||||
| 'NOTES_ADD_FAILED'
|
||||
| 'NOTES_UPDATE_SUCCESS'
|
||||
| 'NOTES_UPDATE_FAILED'
|
||||
| 'NOTES_DELETE_SUCCESS'
|
||||
| 'NOTES_DELETE_FAILED'
|
||||
|
||||
| 'NOTES_DELETE_FAILED';
|
||||
|
||||
export interface INotesAlert {
|
||||
alert: AlertCategory;
|
||||
setAlert: (type: AlertCategory) => void;
|
||||
}
|
||||
|
||||
|
||||
export interface Note {
|
||||
id?: number;
|
||||
title: string;
|
||||
|
||||
@@ -1,37 +1,37 @@
|
||||
{
|
||||
"Locale": "en",
|
||||
"KeyTogglePhone": 288,
|
||||
"KeyTakeCall": 38,
|
||||
"PhoneAsItem": false,
|
||||
"SwimDestroy": false,
|
||||
"RunRate": 10,
|
||||
"DestoryChance": 100,
|
||||
"DestroyPhoneReCheck": 3,
|
||||
"notificationPosition": {
|
||||
"horizontal": "right",
|
||||
"vertical": "top"
|
||||
},
|
||||
"general": {
|
||||
"useDashNumber": true
|
||||
},
|
||||
"twitter": {
|
||||
"showNotifications": true,
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true,
|
||||
"allowDeleteTweets": true,
|
||||
"allowReportTweets": true,
|
||||
"characterLimit": 160,
|
||||
"newLineLimit": 10,
|
||||
"enableAvatars": true,
|
||||
"enableEmojis": true,
|
||||
"enableImages": true,
|
||||
"maxImages": 3
|
||||
},
|
||||
"bank": {
|
||||
"showNotifications": true
|
||||
},
|
||||
"debug": {
|
||||
"level": "debug",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
"Locale": "en",
|
||||
"KeyTogglePhone": 288,
|
||||
"KeyTakeCall": 38,
|
||||
"PhoneAsItem": false,
|
||||
"SwimDestroy": false,
|
||||
"RunRate": 10,
|
||||
"DestoryChance": 100,
|
||||
"DestroyPhoneReCheck": 3,
|
||||
"notificationPosition": {
|
||||
"horizontal": "right",
|
||||
"vertical": "top"
|
||||
},
|
||||
"general": {
|
||||
"useDashNumber": true
|
||||
},
|
||||
"twitter": {
|
||||
"showNotifications": true,
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true,
|
||||
"allowDeleteTweets": true,
|
||||
"allowReportTweets": true,
|
||||
"characterLimit": 160,
|
||||
"newLineLimit": 10,
|
||||
"enableAvatars": true,
|
||||
"enableEmojis": true,
|
||||
"enableImages": true,
|
||||
"maxImages": 3
|
||||
},
|
||||
"bank": {
|
||||
"showNotifications": true
|
||||
},
|
||||
"debug": {
|
||||
"level": "debug",
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@
|
||||
"APPS_NOTES_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_NOTES_DELETE_FAILED": "Failed to delete note.",
|
||||
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Result was copied to clipboard!",
|
||||
|
||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing",
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Ampliar",
|
||||
"APPS_SETTINGS_OPTION_RINGTONE": "Tono de llamada",
|
||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volumen del tono de llamada",
|
||||
|
||||
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notificacion",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notificacion de volumen",
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume de la sonnerie",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume des notifications",
|
||||
|
||||
|
||||
"GENERIC_SAVE": "Sauvegarder",
|
||||
"GENERIC_UPDATE": "Mettre à jour",
|
||||
"GENERIC_DELETE": "Supprimer",
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import React from 'react';
|
||||
import {
|
||||
blue,
|
||||
common,
|
||||
grey,
|
||||
purple,
|
||||
} from '@material-ui/core/colors';
|
||||
import { blue, common, grey, purple } from '@material-ui/core/colors';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faAd,
|
||||
@@ -41,9 +36,18 @@ import {
|
||||
CONTACTS_APP_PRIMARY_COLOR,
|
||||
CONTACTS_APP_TEXT_COLOR,
|
||||
} from '../../../apps/contacts/contacts.theme';
|
||||
import { SELLOUT_APP_PRIMARY_COLOR, 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';
|
||||
import {
|
||||
SELLOUT_APP_PRIMARY_COLOR,
|
||||
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 {
|
||||
id: string;
|
||||
@@ -70,7 +74,7 @@ export const APPS: IAppConfig[] = [
|
||||
{
|
||||
id: 'MESSAGES',
|
||||
nameLocale: 'APPS_MESSAGES',
|
||||
icon: <MessageIcon fontSize="large" />,
|
||||
icon: <MessageIcon fontSize='large' />,
|
||||
notificationIcon: <MessageIcon fontSize='small' />,
|
||||
backgroundColor: MESSAGES_APP_PRIMARY_COLOR,
|
||||
color: MESSAGES_APP_TEXT_COLOR,
|
||||
@@ -82,7 +86,7 @@ export const APPS: IAppConfig[] = [
|
||||
{
|
||||
id: 'CONTACTS',
|
||||
nameLocale: 'APPS_CONTACTS',
|
||||
icon: <ContactsIcon fontSize="large" />,
|
||||
icon: <ContactsIcon fontSize='large' />,
|
||||
notificationIcon: <ContactsIcon fontSize='small' />,
|
||||
backgroundColor: CONTACTS_APP_PRIMARY_COLOR,
|
||||
color: CONTACTS_APP_TEXT_COLOR,
|
||||
@@ -94,7 +98,7 @@ export const APPS: IAppConfig[] = [
|
||||
{
|
||||
id: 'CALCULATOR',
|
||||
nameLocale: 'APPS_CALCULATOR',
|
||||
icon: <CalculatorIcon fontSize="large" />,
|
||||
icon: <CalculatorIcon fontSize='large' />,
|
||||
notificationIcon: <CalculatorIcon fontSize='small' />,
|
||||
backgroundColor: purple[500],
|
||||
color: grey[50],
|
||||
@@ -106,7 +110,7 @@ export const APPS: IAppConfig[] = [
|
||||
{
|
||||
id: 'SETTINGS',
|
||||
nameLocale: 'APPS_SETTINGS',
|
||||
icon: <SettingsIcon fontSize="large" />,
|
||||
icon: <SettingsIcon fontSize='large' />,
|
||||
notificationIcon: <SettingsIcon fontSize='small' />,
|
||||
backgroundColor: '#383838',
|
||||
color: grey[50],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isObject(item) {
|
||||
return (item && typeof item === 'object' && !Array.isArray(item));
|
||||
return item && typeof item === 'object' && !Array.isArray(item);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -29,4 +29,4 @@ export function deepMergeObjects(target, ...sources) {
|
||||
}
|
||||
|
||||
return deepMergeObjects(target, ...sources);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export const CallModal = () => {
|
||||
<CallTimer isAccepted={call?.accepted} />
|
||||
</Box>
|
||||
<div className={classes.actions}>
|
||||
<CallControls size="medium" />
|
||||
<CallControls size='medium' />
|
||||
</div>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useEffect, useRef } from 'react';
|
||||
import { useDuration } from '../hooks/useDuration';
|
||||
|
||||
|
||||
const runTimer = (updatedTime, setDuration) => {
|
||||
let newTime = { ...updatedTime.current };
|
||||
if (newTime.m >= 60) {
|
||||
@@ -17,25 +16,24 @@ const runTimer = (updatedTime, setDuration) => {
|
||||
newTime = { ...newTime, ms: newTime.ms + 1 };
|
||||
updatedTime.current = newTime;
|
||||
setDuration(newTime);
|
||||
}
|
||||
};
|
||||
|
||||
function CallTimer({ isAccepted }) {
|
||||
const { duration, setDuration } = useDuration();
|
||||
const updatedTime = useRef({ ms: 0, s: 0, m: 0, h: 0 });
|
||||
const timer = useRef(null)
|
||||
|
||||
const timer = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (isAccepted) {
|
||||
runTimer(updatedTime, setDuration)
|
||||
runTimer(updatedTime, setDuration);
|
||||
timer.current = setInterval(() => {
|
||||
runTimer(updatedTime, setDuration)
|
||||
runTimer(updatedTime, setDuration);
|
||||
}, 10);
|
||||
} else {
|
||||
clearInterval(timer.current);
|
||||
timer.current = null;
|
||||
}
|
||||
return () => clearInterval(timer.current)
|
||||
return () => clearInterval(timer.current);
|
||||
}, [isAccepted, setDuration]);
|
||||
|
||||
if (!duration || !isAccepted) return null;
|
||||
|
||||
@@ -3,14 +3,14 @@ import { atom } from 'recoil';
|
||||
export const callerState = {
|
||||
currentCall: atom({
|
||||
key: 'currentCall',
|
||||
default: null
|
||||
default: null,
|
||||
}),
|
||||
callModal: atom({
|
||||
key: 'callingModal',
|
||||
default: false
|
||||
default: false,
|
||||
}),
|
||||
callDuration: atom({
|
||||
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 => {
|
||||
const [modal, setModal] = useRecoilState(callerState.callModal);
|
||||
return { modal, setModal }
|
||||
}
|
||||
return { modal, setModal };
|
||||
};
|
||||
@@ -9,7 +9,7 @@ interface INotificationIcon {
|
||||
|
||||
export const NotificationIcon = ({ icon, to }: INotificationIcon) => {
|
||||
return (
|
||||
<IconButton component={NavLink} to={to} size="small">
|
||||
<IconButton component={NavLink} to={to} size='small'>
|
||||
{icon}
|
||||
</IconButton>
|
||||
);
|
||||
|
||||
@@ -14,7 +14,7 @@ interface IUsePhone {
|
||||
|
||||
export const usePhone = (): IUsePhone => {
|
||||
const isPhoneOpen = useRecoilValue(phoneState.visibility);
|
||||
|
||||
|
||||
const { removeAlerts } = useNotifications();
|
||||
|
||||
const closePhone = () => {
|
||||
|
||||
@@ -8,8 +8,8 @@ const useStyles = makeStyles({
|
||||
},
|
||||
msg: {
|
||||
maxWidth: '300px',
|
||||
wordWrap: 'break-word',
|
||||
fontSize: '1em'
|
||||
wordWrap: 'break-word',
|
||||
fontSize: '1em',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ interface IContextMenuOption {
|
||||
selected?: boolean;
|
||||
icon?: React.ReactNode;
|
||||
key?: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface IContextMenuProps {
|
||||
open: boolean;
|
||||
@@ -64,8 +64,11 @@ export const ContextMenu = ({ open, onClose, options }: IContextMenuProps) => {
|
||||
onClose();
|
||||
}}
|
||||
>
|
||||
{option.icon && <ListItemIcon >{option.icon}</ListItemIcon>}
|
||||
<ListItemText primary={option.label} secondary={option.description} />
|
||||
{option.icon && <ListItemIcon>{option.icon}</ListItemIcon>}
|
||||
<ListItemText
|
||||
primary={option.label}
|
||||
secondary={option.description}
|
||||
/>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
|
||||
@@ -3,23 +3,13 @@ import { AppIcon } from './AppIcon';
|
||||
import { Box, Grid } from '@material-ui/core';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
export const GridMenu = ({
|
||||
items,
|
||||
Component = AppIcon,
|
||||
xs = undefined,
|
||||
}) => {
|
||||
export const GridMenu = ({ items, Component = AppIcon, xs = undefined }) => {
|
||||
return (
|
||||
<Grid container alignItems='center' direction='row'>
|
||||
{items &&
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
<Grid
|
||||
item
|
||||
xs={xs}
|
||||
key={item.id}
|
||||
alignItems='center'
|
||||
justify='center'
|
||||
>
|
||||
<Grid item xs={xs} key={item.id} alignItems='center' justify='center'>
|
||||
<Box textAlign='center'>
|
||||
<Link to={item.path}>
|
||||
<Component {...item} />
|
||||
|
||||
@@ -2,15 +2,15 @@ import React from 'react';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
|
||||
interface IProps {
|
||||
src: string,
|
||||
alt: string
|
||||
src: string;
|
||||
alt: string;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles({
|
||||
root: {
|
||||
width: '100%',
|
||||
objectFit: 'contain'
|
||||
}
|
||||
objectFit: 'contain',
|
||||
},
|
||||
});
|
||||
|
||||
export const PictureResponsive = ({ src, alt }: IProps) => {
|
||||
|
||||
@@ -6,9 +6,9 @@ interface IStyleProps {
|
||||
}
|
||||
|
||||
interface IProps {
|
||||
src: string,
|
||||
alt: string,
|
||||
size?: string
|
||||
src: string;
|
||||
alt: string;
|
||||
size?: string;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles<Theme, IStyleProps>({
|
||||
|
||||
@@ -56,5 +56,11 @@ export const StatusIconButton = ({
|
||||
...props
|
||||
}: Omit<IconButtonProps, 'color'> & { color: StatusButtonStyleColor }) => {
|
||||
const classes = useStyles({ color });
|
||||
return <IconButton className={`${classes.root} ${className}`} size={size} {...props} />;
|
||||
return (
|
||||
<IconButton
|
||||
className={`${classes.root} ${className}`}
|
||||
size={size}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -1,15 +1,14 @@
|
||||
import { useContext } from 'react';
|
||||
import { SnackbarContext } from '../providers/SnackbarProvider';
|
||||
|
||||
|
||||
export interface IAlert {
|
||||
message: string;
|
||||
type: 'success' | 'error' | 'info'
|
||||
type: 'success' | 'error' | 'info';
|
||||
}
|
||||
|
||||
interface ISnackBar {
|
||||
addAlert: ({ message, type}: IAlert) => void;
|
||||
addAlert: ({ message, type }: IAlert) => void;
|
||||
alert: IAlert | null;
|
||||
}
|
||||
|
||||
export const useSnackbar = (): ISnackBar => useContext(SnackbarContext);
|
||||
export const useSnackbar = (): ISnackBar => useContext(SnackbarContext);
|
||||
@@ -12,4 +12,4 @@ export interface AppWrapperTypes {
|
||||
children?: JSX.Element | JSX.Element[];
|
||||
style?: CSSProperties;
|
||||
handleClickAway?: (...args: any[]) => void;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
['@babel/preset-env', {targets: {node: 'current'}}],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
};
|
||||
presets: [
|
||||
['@babel/preset-env', { targets: { node: 'current' } }],
|
||||
'@babel/preset-typescript',
|
||||
],
|
||||
};
|
||||
@@ -45,7 +45,7 @@ onNet(events.CONTACTS_ACTION_RESULT, (alert: any) => {
|
||||
JSON.stringify({
|
||||
app: 'CONTACTS',
|
||||
method: 'setAlert',
|
||||
data: alert
|
||||
data: alert,
|
||||
})
|
||||
);
|
||||
});
|
||||
@@ -17,7 +17,7 @@ onNet(events.NOTE_SEND_NOTE_SUCCESS, () => {
|
||||
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
||||
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||
emitNet(events.NOTE_DELETE_NOTE, data);
|
||||
|
||||
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
@@ -30,7 +30,6 @@ onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
|
||||
onNet(events.NOTE_ACTION_RESULT, (alert: any) => {
|
||||
sendNotesEvent('setAlert', alert)
|
||||
})
|
||||
sendNotesEvent('setAlert', alert);
|
||||
});
|
||||
+11
-15
@@ -104,29 +104,25 @@ onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => {
|
||||
try {
|
||||
const _identifier = getIdentifier(_source);
|
||||
await addTransfer(_identifier, transfer);
|
||||
|
||||
|
||||
// we need to create a notification for bank. that's why i have commented out.
|
||||
// as well as creating a check if the player has enough money etc....
|
||||
|
||||
|
||||
//emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
||||
|
||||
|
||||
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||
type: 'success'
|
||||
}
|
||||
);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
bankLogger.error(`Failed to add transaction, ${e.message}`, {
|
||||
source: _source,
|
||||
});
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||
type: 'error'
|
||||
}
|
||||
);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source, {
|
||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+12
-12
@@ -41,17 +41,17 @@ function getRandomPhoneNumber() {
|
||||
}
|
||||
|
||||
async function generatePhoneNumber(identifier: string) {
|
||||
if (!await usePhoneNumber(identifier)) {
|
||||
if (!(await usePhoneNumber(identifier))) {
|
||||
let existingId;
|
||||
let newNumber;
|
||||
do {
|
||||
newNumber = getRandomPhoneNumber();
|
||||
try {
|
||||
existingId = await getIdentifierByPhoneNumber(newNumber)
|
||||
} catch(e) {
|
||||
existingId = false
|
||||
}
|
||||
} while(existingId);
|
||||
newNumber = getRandomPhoneNumber();
|
||||
try {
|
||||
existingId = await getIdentifierByPhoneNumber(newNumber);
|
||||
} catch (e) {
|
||||
existingId = false;
|
||||
}
|
||||
} while (existingId);
|
||||
mainLogger.verbose(`Inserting number into Database: ${newNumber}`);
|
||||
const query = 'UPDATE users SET phone_number = ? WHERE identifier = ?';
|
||||
await pool.query(query, [newNumber, identifier]);
|
||||
@@ -67,16 +67,16 @@ async function getCredentials(identifier: string): Promise<string> {
|
||||
}
|
||||
|
||||
onNet('esx:playerLoaded', async (playerId: number, xPlayer: any) => {
|
||||
const _source = getSource()
|
||||
const _source = getSource();
|
||||
try {
|
||||
const identifier = xPlayer.identifier;
|
||||
await generatePhoneNumber(identifier);
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
mainLogger.error(`Failed to generate a phone number, ${e.message}`, {
|
||||
source: _source,
|
||||
})
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
onNet('phone:getCredentials', async () => {
|
||||
const _source = getSource();
|
||||
|
||||
@@ -313,7 +313,7 @@ onNet(events.TWITTER_UPDATE_PROFILE, async (profile: Profile) => {
|
||||
await updateProfile(identifier, profile);
|
||||
emitNet(events.TWITTER_UPDATE_PROFILE_RESULT, _source, {
|
||||
message: 'TWITTER_EDIT_PROFILE_SUCCESS',
|
||||
type: 'success'
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
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, {
|
||||
message: 'TWITTER_EDIT_PROFILE_FAILURE',
|
||||
type: 'error'
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -368,8 +368,8 @@ onNet(events.TWITTER_CREATE_TWEET, async (tweet: Tweet) => {
|
||||
});
|
||||
emitNet(events.TWITTER_CREATE_TWEET_RESULT, _source, {
|
||||
message: 'TWITTER_CREATE_FAILED',
|
||||
type: 'error'
|
||||
});
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export default {
|
||||
TWITTER: 'TWITTER',
|
||||
MESSAGES: 'MESSAGES',
|
||||
NOTES: 'NOTES'
|
||||
NOTES: 'NOTES',
|
||||
};
|
||||
@@ -1,3 +1,3 @@
|
||||
export const tokenData = {
|
||||
token: '2518ea90647ba45'
|
||||
}
|
||||
token: '2518ea90647ba45',
|
||||
};
|
||||
+20
-20
@@ -1,28 +1,28 @@
|
||||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
const RemovePlugin = require("remove-files-webpack-plugin");
|
||||
const webpack = require('webpack');
|
||||
const path = require('path');
|
||||
const RemovePlugin = require('remove-files-webpack-plugin');
|
||||
|
||||
const buildPath = path.resolve(__dirname, "dist");
|
||||
const buildPath = path.resolve(__dirname, 'dist');
|
||||
|
||||
const server = {
|
||||
entry: "./server/server.ts",
|
||||
entry: './server/server.ts',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: ["ts-loader"],
|
||||
use: ['ts-loader'],
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({ "global.GENTLY": false }),
|
||||
new webpack.DefinePlugin({ 'global.GENTLY': false }),
|
||||
new RemovePlugin({
|
||||
before: {
|
||||
include: [path.resolve(buildPath, "server")],
|
||||
include: [path.resolve(buildPath, 'server')],
|
||||
},
|
||||
watch: {
|
||||
include: [path.resolve(buildPath, "server")],
|
||||
include: [path.resolve(buildPath, 'server')],
|
||||
},
|
||||
}),
|
||||
],
|
||||
@@ -30,22 +30,22 @@ const server = {
|
||||
minimize: true,
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js"],
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: "[contenthash].server.js",
|
||||
path: path.resolve(buildPath, "server"),
|
||||
filename: '[contenthash].server.js',
|
||||
path: path.resolve(buildPath, 'server'),
|
||||
},
|
||||
target: "node",
|
||||
target: 'node',
|
||||
};
|
||||
|
||||
const client = {
|
||||
entry: "./client/client.ts",
|
||||
entry: './client/client.ts',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
use: ["ts-loader"],
|
||||
use: ['ts-loader'],
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
@@ -53,10 +53,10 @@ const client = {
|
||||
plugins: [
|
||||
new RemovePlugin({
|
||||
before: {
|
||||
include: [path.resolve(buildPath, "client")],
|
||||
include: [path.resolve(buildPath, 'client')],
|
||||
},
|
||||
watch: {
|
||||
include: [path.resolve(buildPath, "client")],
|
||||
include: [path.resolve(buildPath, 'client')],
|
||||
},
|
||||
}),
|
||||
],
|
||||
@@ -64,11 +64,11 @@ const client = {
|
||||
minimize: true,
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js"],
|
||||
extensions: ['.tsx', '.ts', '.js'],
|
||||
},
|
||||
output: {
|
||||
filename: "[contenthash].client.js",
|
||||
path: path.resolve(buildPath, "client"),
|
||||
filename: '[contenthash].client.js',
|
||||
path: path.resolve(buildPath, 'client'),
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user