mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 06:28:52 +00:00
Compare commits
24
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b38b488a42 | ||
|
|
c39468eb34 | ||
|
|
a2c0f94bd8 | ||
|
|
e8d28359a9 | ||
|
|
67b557b7c3 | ||
|
|
4b29cbbce3 | ||
|
|
06137d77ad | ||
|
|
279778e4f3 | ||
|
|
a6e8c769c0 | ||
|
|
5c6538b340 | ||
|
|
1ecdb7a4a8 | ||
|
|
d5d483eee8 | ||
|
|
ef30daeb65 | ||
|
|
19e228894d | ||
|
|
a244183976 | ||
|
|
e01057d818 | ||
|
|
9ffca0d14e | ||
|
|
1a9c21f89d | ||
|
|
3031e650e3 | ||
|
|
23ef9b8cd6 | ||
|
|
598bcd2eb3 | ||
|
|
78961b788f | ||
|
|
adf9758d9f | ||
|
|
bc8a89d825 |
No files matched your search
@@ -3,7 +3,7 @@
|
||||
<img src="https://beta.iodine.gg/zVkK7.png" width="500" height="300" />
|
||||
|
||||
|
||||
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 environment 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.
|
||||
|
||||
|
||||
@@ -16,5 +16,6 @@ ui_page 'resources/html/index.html'
|
||||
files {
|
||||
'resources/html/index.html',
|
||||
'resources/html/*.js',
|
||||
'resources/html/*.map',
|
||||
'resources/html/media/**/*'
|
||||
}
|
||||
+2
-11
@@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS npwd_notes (
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_sellout_listings (
|
||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_listings (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) DEFAULT NULL,
|
||||
username varchar(255) DEFAULT NULL,
|
||||
@@ -75,12 +75,6 @@ CREATE TABLE IF NOT EXISTS npwd_sellout_listings (
|
||||
createdAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updatedAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
ENGINE = INNODB,
|
||||
AUTO_INCREMENT = 31,
|
||||
AVG_ROW_LENGTH = 2048,
|
||||
CHARACTER SET utf8mb4,
|
||||
COLLATE utf8mb4_general_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_reports (
|
||||
@@ -88,10 +82,7 @@ CREATE TABLE IF NOT EXISTS npwd_marketplace_reports (
|
||||
listing_id int(11) DEFAULT NULL,
|
||||
profile varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
)
|
||||
ENGINE = INNODB,
|
||||
CHARACTER SET utf8mb4,
|
||||
COLLATE utf8mb4_general_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
|
||||
+9
-2
@@ -1,4 +1,4 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import './Phone.css';
|
||||
import './i18n';
|
||||
import { Route } from 'react-router-dom';
|
||||
@@ -33,11 +33,18 @@ import { usePhone } from './os/phone/hooks/usePhone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
function Phone() {
|
||||
const { t } = useTranslation();
|
||||
const { t, i18n } = useTranslation();
|
||||
|
||||
const { apps } = useApps();
|
||||
|
||||
const [settings] = useSettings();
|
||||
|
||||
// Set language from local storage
|
||||
// This will only trigger on first mount & settings changes
|
||||
useEffect(() => {
|
||||
i18n.changeLanguage(settings.language.value).catch((e) => console.error(e));
|
||||
}, [i18n, settings.language]);
|
||||
|
||||
useNuiService();
|
||||
useKeyboardService();
|
||||
usePhoneService();
|
||||
|
||||
@@ -3,8 +3,9 @@ import React, { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faHome, faList, faMoneyCheck } from '@fortawesome/free-solid-svg-icons';
|
||||
import HomeIcon from '@material-ui/icons/Home';
|
||||
import LocalAtmIcon from '@material-ui/icons/LocalAtm';
|
||||
import ListIcon from '@material-ui/icons/List';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -30,21 +31,9 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/bank"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
||||
to="/bank/account"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faList} />}
|
||||
to="/bank/transactions"
|
||||
/>
|
||||
<BottomNavigationAction component={Link} icon={<HomeIcon />} to="/bank" />
|
||||
<BottomNavigationAction component={Link} icon={<LocalAtmIcon />} to="/bank/account" />
|
||||
<BottomNavigationAction component={Link} icon={<ListIcon />} to="/bank/transactions" />
|
||||
</BottomNavigation>
|
||||
);
|
||||
};
|
||||
@@ -3,31 +3,40 @@ import { AppWrapper } from '../../ui/components/AppWrapper';
|
||||
import { AppContent } from '../../ui/components/AppContent';
|
||||
import { AppTitle } from '../../ui/components/AppTitle';
|
||||
import { useApp } from '../../os/apps/hooks/useApps';
|
||||
import NoteList from './list/NoteList';
|
||||
import { NoteModal } from './modal/NoteModal';
|
||||
import { Fab } from '@material-ui/core';
|
||||
import AddIcon from '@material-ui/icons/Add';
|
||||
import { useNoteDetail } from './hooks/useNoteDetail';
|
||||
import useStyles from './documents.styles';
|
||||
import useStyles from './notes.styles';
|
||||
import InjectDebugData from '../../os/debug/InjectDebugData';
|
||||
import { DocumentsThemeProvider } from './providers/DoucmentsThemeProvider';
|
||||
import { NotesThemeProvider } from './providers/NotesThemeProvider';
|
||||
import { Route, useHistory } from 'react-router-dom';
|
||||
import DocumentList from './list/DoucmentList';
|
||||
import NoteList from './list/NoteList';
|
||||
|
||||
export const NotesApp = () => {
|
||||
const documentsApp = useApp('DOCUMENTS');
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const notesApp = useApp('NOTES');
|
||||
const { setDetail } = useNoteDetail();
|
||||
|
||||
const onClickCreate = () => {
|
||||
setDetail({ title: '', content: '' });
|
||||
history.push('/notes/detail');
|
||||
};
|
||||
|
||||
return (
|
||||
<DocumentsThemeProvider>
|
||||
<AppWrapper id="documents-app">
|
||||
<AppTitle app={documentsApp} />
|
||||
<Route path="/documents/notes/detail" component={NoteModal} />
|
||||
<NotesThemeProvider>
|
||||
<AppWrapper id="notes-app">
|
||||
<AppTitle app={notesApp} />
|
||||
<Route path="/notes/detail" component={NoteModal} />
|
||||
<AppContent>
|
||||
<Route path="/documents" exact component={DocumentList} />
|
||||
<Route path="/documents/notes" exact component={NoteList} />
|
||||
<Route path="/notes" component={NoteList} />
|
||||
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
</DocumentsThemeProvider>
|
||||
</NotesThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
|
||||
import { makeStyles, Paper } from '@material-ui/core';
|
||||
import FolderIcon from '@material-ui/icons/Folder';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
header: {
|
||||
@@ -23,7 +24,7 @@ const NotesTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper elevation={24} square variant="outlined" className={classes.header}>
|
||||
<FolderIcon fontSize="large" />
|
||||
<FontAwesomeIcon icon={faStickyNote} className={classes.icon} size="lg" />
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
import { common, yellow } from '@material-ui/core/colors';
|
||||
|
||||
export const DOCUMENTS_APP_PRIMARY_COLOR = yellow[800];
|
||||
export const DOCUMENTS_APP_ICON_COLOR = common.white;
|
||||
export const DOCUMENTS_APP_TEXT_COLOR = common.black;
|
||||
|
||||
const theme = {
|
||||
palette: {
|
||||
primary: {
|
||||
main: DOCUMENTS_APP_PRIMARY_COLOR,
|
||||
dark: yellow[900],
|
||||
light: yellow[500],
|
||||
contrastText: DOCUMENTS_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
@@ -1,37 +0,0 @@
|
||||
import { List, ListItem, ListItemIcon, ListItemText } from '@material-ui/core';
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import NoteIcon from '@material-ui/icons/Note';
|
||||
import RecentActorsIcon from '@material-ui/icons/RecentActors';
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
export default function DoucmentList() {
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
|
||||
const [list, setList] = useState([
|
||||
{
|
||||
id: 1,
|
||||
name: t('APPS_DOCUMENTS_NOTES_TITLE'),
|
||||
icon: <NoteIcon />,
|
||||
route: '/documents/notes',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: t('APPS_DOCUMENTS_LICENSE_TITLE'),
|
||||
icon: <RecentActorsIcon />,
|
||||
route: '/documents/licenses',
|
||||
},
|
||||
]);
|
||||
|
||||
return (
|
||||
<List disablePadding>
|
||||
{list.map((l) => (
|
||||
<ListItem divider button key={l.id} onClick={() => history.push(l.route)}>
|
||||
<ListItemIcon>{l.icon}</ListItemIcon>
|
||||
<ListItemText primary={l.name} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Fab, List, ListItem, ListItemText, Box, Typography } from '@material-ui/core';
|
||||
import { List, ListItem, ListItemText } from '@material-ui/core';
|
||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||
import { useNotes } from '../hooks/useNotes';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import useStyles from '../documents.styles';
|
||||
import AddIcon from '@material-ui/icons/Add';
|
||||
|
||||
// add search bar later
|
||||
// TODO: Add interface for note
|
||||
@@ -12,31 +10,20 @@ const NoteList = () => {
|
||||
const history = useHistory();
|
||||
const { notes } = useNotes();
|
||||
const { setDetail } = useNoteDetail();
|
||||
const classes = useStyles();
|
||||
|
||||
const handleNoteModal = (note) => {
|
||||
setDetail(note);
|
||||
history.push('/documents/notes/detail');
|
||||
};
|
||||
|
||||
const onClickCreate = () => {
|
||||
setDetail({ title: '', content: '' });
|
||||
history.push('/documents/notes/detail');
|
||||
history.push('/notes/detail');
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<List disablePadding>
|
||||
{notes.map((note) => (
|
||||
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
||||
<ListItemText primary={note.title} secondary={`${note.content.slice(0, 35)}...`} />
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</div>
|
||||
<List disablePadding>
|
||||
{notes.map((note) => (
|
||||
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
||||
<ListItemText>{note.title}</ListItemText>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
CircularProgress,
|
||||
Box,
|
||||
} from '@material-ui/core';
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import { useNoteDetail } from '../hooks/useNoteDetail';
|
||||
import useStyles from './modal.styles';
|
||||
@@ -16,9 +16,6 @@ import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { StatusButton } from '../../../ui/components/StatusButton';
|
||||
import ShareIcon from '@material-ui/icons/Share';
|
||||
import Modal from '../../../ui/components/Modal';
|
||||
import { Autocomplete } from '@material-ui/lab';
|
||||
|
||||
export const NoteModal = () => {
|
||||
const classes = useStyles();
|
||||
@@ -26,9 +23,6 @@ export const NoteModal = () => {
|
||||
const { t } = useTranslation();
|
||||
const { detail, setDetail } = useNoteDetail();
|
||||
|
||||
const [open, setOpen] = useState(false);
|
||||
const [number, setNumber] = useState('');
|
||||
|
||||
const onClose = () => history.goBack();
|
||||
|
||||
const _handleClose = () => {
|
||||
@@ -57,43 +51,9 @@ export const NoteModal = () => {
|
||||
onClose();
|
||||
};
|
||||
|
||||
const handleShareNoteModal = () => setOpen(true);
|
||||
|
||||
const NoteShareModal = () => {
|
||||
const opts = [
|
||||
{
|
||||
title: 'Nice',
|
||||
},
|
||||
{
|
||||
title: 'wtf',
|
||||
},
|
||||
];
|
||||
|
||||
const handleShareNote = () => {
|
||||
Nui.send('phone:shareNote', {});
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal visible={open} handleClose={() => setOpen(false)}>
|
||||
<Autocomplete
|
||||
freeSolo
|
||||
disableClearable
|
||||
options={opts.map((op) => op.title)}
|
||||
onChange={(e: any) => setNumber(e.currentTarget.value)}
|
||||
renderInput={(params) => (
|
||||
<TextField {...params} label="Search contacts" margin="normal" />
|
||||
)}
|
||||
/>
|
||||
<Button onClick={handleShareNote}>Share</Button>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<Slide direction="left" in={!!detail}>
|
||||
<Paper className={classes.modalRoot}>
|
||||
<NoteShareModal />
|
||||
<div className={open ? classes.backgroundModal : undefined} />
|
||||
{!detail ? (
|
||||
<CircularProgress />
|
||||
) : (
|
||||
@@ -106,7 +66,7 @@ export const NoteModal = () => {
|
||||
startIcon={<ArrowBackIcon fontSize="large" />}
|
||||
onClick={_handleClose}
|
||||
>
|
||||
{t('APPS_DOCUMENTS_NOTES_TITLE')}
|
||||
{t('APPS_NOTES')}
|
||||
</Button>
|
||||
</Box>
|
||||
<TextField
|
||||
@@ -166,11 +126,6 @@ export const NoteModal = () => {
|
||||
{t('GENERIC_DELETE')}
|
||||
</StatusButton>
|
||||
</Box>
|
||||
<Box display="inline" p={1}>
|
||||
<Button color="primary" onClick={handleShareNoteModal}>
|
||||
<ShareIcon />
|
||||
</Button>
|
||||
</Box>
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -18,16 +18,6 @@ const useStyles = makeStyles((theme) => ({
|
||||
fontSize: 20,
|
||||
lineHeight: 1.2,
|
||||
},
|
||||
backgroundModal: {
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 5,
|
||||
},
|
||||
}));
|
||||
|
||||
export default useStyles;
|
||||
File renamed without changes.
@@ -0,0 +1,18 @@
|
||||
import { common, yellow } from '@material-ui/core/colors';
|
||||
|
||||
export const NOTES_APP_PRIMARY_COLOR = yellow[800];
|
||||
export const NOTES_APP_ICON_COLOR = common.white;
|
||||
export const NOTES_APP_TEXT_COLOR = common.black;
|
||||
|
||||
const theme = {
|
||||
palette: {
|
||||
primary: {
|
||||
main: NOTES_APP_PRIMARY_COLOR,
|
||||
dark: yellow[900],
|
||||
light: yellow[500],
|
||||
contrastText: NOTES_APP_TEXT_COLOR,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default theme;
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||
import notesTheme from '../documents.theme';
|
||||
|
||||
export const DocumentsThemeProvider = createAppThemeProvider(notesTheme);
|
||||
@@ -0,0 +1,4 @@
|
||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||
import notesTheme from '../notes.theme';
|
||||
|
||||
export const NotesThemeProvider = createAppThemeProvider(notesTheme);
|
||||
@@ -2,9 +2,8 @@ import React, { useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faHome } from '@fortawesome/free-solid-svg-icons';
|
||||
import AddCircleIcon from '@material-ui/icons/AddCircle';
|
||||
import HomeIcon from '@material-ui/icons/Home';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -28,11 +27,7 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/sellout"
|
||||
/>
|
||||
<BottomNavigationAction component={Link} icon={<HomeIcon />} to="/sellout" />
|
||||
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/sellout/new" />
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
@@ -67,12 +67,13 @@ interface ISettingSwitch {
|
||||
value: boolean;
|
||||
onClick: any;
|
||||
icon: JSX.Element;
|
||||
secondary: string;
|
||||
}
|
||||
|
||||
export const SettingSwitch = ({ label, value, onClick, icon }: ISettingSwitch) => (
|
||||
export const SettingSwitch = ({ label, value, onClick, icon, secondary }: ISettingSwitch) => (
|
||||
<ListItem divider button>
|
||||
<ListItemIcon>{icon}</ListItemIcon>
|
||||
<ListItemText primary={label} />
|
||||
<ListItemText primary={label} secondary={secondary} />
|
||||
<ListItemSecondaryAction>
|
||||
<Switch color="primary" checked={value} onChange={() => onClick(value)} />
|
||||
</ListItemSecondaryAction>
|
||||
|
||||
@@ -25,10 +25,13 @@ import {
|
||||
LibraryMusic,
|
||||
VolumeUp,
|
||||
FileCopy,
|
||||
Book,
|
||||
} from '@material-ui/icons';
|
||||
|
||||
import { ListSubheader } from '@material-ui/core';
|
||||
import { useSettings } from '../hooks/useSettings';
|
||||
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
|
||||
const SubHeaderComp = (props: { text: string }) => (
|
||||
<ListSubheader color="primary" component="div" disableSticky>
|
||||
@@ -42,8 +45,8 @@ export const SettingsApp = () => {
|
||||
const simcard = useSimcard();
|
||||
const [settings, setSettings] = useSettings();
|
||||
const { t } = useTranslation();
|
||||
// TODO: Uncomment when #135 is merged
|
||||
// const { addAlert } = useSnackbar();
|
||||
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
const handleSettingChange = (key: string | number, value: unknown) => {
|
||||
setSettings({ ...settings, [key]: value });
|
||||
@@ -84,16 +87,18 @@ export const SettingsApp = () => {
|
||||
),
|
||||
);
|
||||
|
||||
const languages = config.languages.map(
|
||||
MapSettingItem(settings.language, (val: SettingOption) => handleSettingChange('language', val)),
|
||||
);
|
||||
|
||||
const handleCopyPhoneNumber = () => {
|
||||
// TODO: Dependent on #132 merge
|
||||
// setClipboard(simcard.number)
|
||||
// TODO: Dependent on #135 merge
|
||||
// addAlert({
|
||||
// message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
|
||||
// content: 'number',
|
||||
// }),
|
||||
// type: 'success',
|
||||
// });
|
||||
setClipboard(simcard.number);
|
||||
addAlert({
|
||||
message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
|
||||
content: 'number',
|
||||
}),
|
||||
type: 'success',
|
||||
});
|
||||
};
|
||||
|
||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||
@@ -101,7 +106,7 @@ export const SettingsApp = () => {
|
||||
<AppWrapper>
|
||||
<AppTitle app={settingsApp} />
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List disablePadding subheader={<SubHeaderComp text="Phone" />}>
|
||||
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.PHONE')} />}>
|
||||
<SettingItemIconAction
|
||||
label={t('APPS_SETTINGS_PHONE_NUMBER')}
|
||||
labelSecondary={simcard.number}
|
||||
@@ -140,12 +145,20 @@ export const SettingsApp = () => {
|
||||
/>
|
||||
<SettingSwitch
|
||||
label={t('APPS_SETTINGS_OPTION_STREAMER_MODE')}
|
||||
secondary={t('APPS_SETTING_STREAMER_MODE_DESC')}
|
||||
icon={<VisibilityOffIcon />}
|
||||
value={settings.streamerMode}
|
||||
onClick={(curr) => handleSettingChange('streamerMode', !curr)}
|
||||
/>
|
||||
</List>
|
||||
<List disablePadding subheader={<SubHeaderComp text="Appearance" />}>
|
||||
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.APPEARANCE')} />}>
|
||||
<SettingItem
|
||||
label={t('SETTINGS.OPTIONS.LANGUAGE')}
|
||||
value={settings.language.label}
|
||||
options={languages}
|
||||
onClick={openMenu}
|
||||
icon={<Book />}
|
||||
/>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_THEME')}
|
||||
value={settings.theme.label}
|
||||
|
||||
@@ -26,6 +26,7 @@ export const settingsState = atom({
|
||||
});
|
||||
|
||||
export interface IPhoneSettings {
|
||||
language: SettingOption;
|
||||
wallpaper: SettingOption;
|
||||
frame: SettingOption;
|
||||
theme: SettingOption;
|
||||
|
||||
@@ -6,30 +6,8 @@ import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import ReportButton from '../buttons/ReportButton';
|
||||
|
||||
/**
|
||||
* Ok this is some bullshit. Due to either scaling issues or the NUI
|
||||
* overlay being different than the display resolution just letting
|
||||
* material-ui determine what the anchor positioning of the popover
|
||||
* is not reliable and has some error that appears to scale vertically.
|
||||
*
|
||||
* This vertical offset raises the popover positioning implementing the
|
||||
* transformOrigin prop that material-ui's Popover element provides.
|
||||
*
|
||||
* These coefficients are NOT based on any known offsets or calc()
|
||||
* functions. They are empiricallly determined. The actual scaling issue
|
||||
* does NOT appear to be linear, but over the comparatively low height
|
||||
* of the phone compared to the window it produces results that are within
|
||||
* acceptable tolerances from the player's perspective.
|
||||
* @param top - the computed distance from the top of the window to the top
|
||||
* of the anchor element
|
||||
*/
|
||||
function calculateVerticalOffset(top: number): number {
|
||||
return top * 0.2 - 38;
|
||||
}
|
||||
|
||||
export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
const [anchorEl, setAnchorEl] = useState<Element | null>(null);
|
||||
const [verticalOffset, setVerticalOffset] = useState(0);
|
||||
const { t } = useTranslation();
|
||||
const { config } = usePhone();
|
||||
|
||||
@@ -38,14 +16,10 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
const handleClick = (event: React.MouseEvent) => {
|
||||
const element = event.currentTarget;
|
||||
setAnchorEl(element);
|
||||
|
||||
const top = window.pageYOffset + element.getBoundingClientRect().top;
|
||||
setVerticalOffset(calculateVerticalOffset(top));
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setAnchorEl(null);
|
||||
setVerticalOffset(0);
|
||||
};
|
||||
|
||||
const handleDeleteTweet = () => {
|
||||
@@ -72,7 +46,7 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
open={Boolean(anchorEl)}
|
||||
onClose={handleClose}
|
||||
transformOrigin={{
|
||||
vertical: verticalOffset,
|
||||
vertical: -30,
|
||||
horizontal: 'left',
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"cellProvider": "AT&T",
|
||||
"language": "en",
|
||||
"defaultLanguage": "en",
|
||||
"wallpapers": [
|
||||
{
|
||||
"label": "Minimal",
|
||||
@@ -67,6 +67,44 @@
|
||||
"value": 0.7
|
||||
}
|
||||
],
|
||||
"languages": [
|
||||
{
|
||||
"label": "English",
|
||||
"value": "en"
|
||||
},
|
||||
{
|
||||
"label": "Español",
|
||||
"value": "es"
|
||||
},
|
||||
{
|
||||
"label": "Français",
|
||||
"value": "fr"
|
||||
},
|
||||
{
|
||||
"label": "Türk",
|
||||
"value": "tr"
|
||||
},
|
||||
{
|
||||
"label": "Norsk",
|
||||
"value": "no"
|
||||
},
|
||||
{
|
||||
"label": "Svenska",
|
||||
"value": "sv"
|
||||
},
|
||||
{
|
||||
"label": "Português",
|
||||
"value": "pt"
|
||||
},
|
||||
{
|
||||
"label": "Português (BR)",
|
||||
"value": "ptbr"
|
||||
},
|
||||
{
|
||||
"label": "Bosanski",
|
||||
"value": "ba"
|
||||
}
|
||||
],
|
||||
"ringtones": [
|
||||
{
|
||||
"label": "Marimba",
|
||||
@@ -98,6 +136,10 @@
|
||||
}
|
||||
],
|
||||
"defaultSettings": {
|
||||
"language": {
|
||||
"label": "English",
|
||||
"value": "en"
|
||||
},
|
||||
"wallpaper": {
|
||||
"label": "Project Error",
|
||||
"value": "projecterror.jpg"
|
||||
@@ -107,7 +149,7 @@
|
||||
"value": "default.png"
|
||||
},
|
||||
"theme": {
|
||||
"label": "taso-dark",
|
||||
"label": "Taso Dark",
|
||||
"value": "taso-dark"
|
||||
},
|
||||
"zoom": {
|
||||
|
||||
+7
-5
@@ -3,7 +3,7 @@ import { initReactI18next } from 'react-i18next';
|
||||
import en from './locale/en.json';
|
||||
import es from './locale/es.json';
|
||||
import fr from './locale/fr.json';
|
||||
import bs from './locale/bs.json';
|
||||
import ba from './locale/ba.json';
|
||||
import sv from './locale/sv.json';
|
||||
import no from './locale/no.json';
|
||||
import tr from './locale/tr.json';
|
||||
@@ -15,7 +15,7 @@ const resources = {
|
||||
en,
|
||||
es,
|
||||
fr,
|
||||
bs,
|
||||
ba,
|
||||
no,
|
||||
sv,
|
||||
tr,
|
||||
@@ -27,9 +27,11 @@ i18n
|
||||
.use(initReactI18next) // passes i18n down to react-i18next
|
||||
.init({
|
||||
resources,
|
||||
lng: config.language,
|
||||
|
||||
keySeparator: false, // we do not use keys in form messages.welcome
|
||||
lng: config.defaultLanguage,
|
||||
react: {
|
||||
bindI18n: 'languageChanged',
|
||||
},
|
||||
keySeparator: '.', // we do not use keys in form messages.welcome
|
||||
|
||||
interpolation: {
|
||||
escapeValue: false, // react already safes from xss
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"APPS_CALCULATOR": "Calculator",
|
||||
"APPS_SETTINGS": "Postavke",
|
||||
"APPS_BANK": "WhoDis Banka",
|
||||
"APPS_DOCUMENTS": "Bilješke",
|
||||
"APPS_NOTES": "Bilješke",
|
||||
"APPS_EXAMPLE": "Primjerna Aplikacija",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -97,12 +97,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Dodajte kontakt",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Bilješka je uspješno spremljena.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Spremanje bilješke nije uspjelo.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Bilješka je uspješno ažurirana.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Ažuriranje bilješke nije uspjelo.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Bilješka je uspješno izbrisana.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Brisanje bilješke nije uspjelo.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Bilješka je uspješno spremljena.",
|
||||
"APPS_NOTES_ADD_FAILED": "Spremanje bilješke nije uspjelo.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Bilješka je uspješno ažurirana.",
|
||||
"APPS_NOTES_UPDATE_FAILED": "Ažuriranje bilješke nije uspjelo.",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Bilješka je uspješno izbrisana.",
|
||||
"APPS_NOTES_DELETE_FAILED": "Brisanje bilješke nije uspjelo.",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Rezultat je kopiran u međuspremnik!",
|
||||
|
||||
@@ -1,127 +0,0 @@
|
||||
{
|
||||
"translation": {
|
||||
"DATE_FORMAT": "MM/DD/YYYY",
|
||||
"DATE_TIME_FORMAT": "MM/DD/YYYY hh:mm A",
|
||||
|
||||
"COMING_SOON": "Coming soon...",
|
||||
|
||||
"APPS_DIALER": "Telephone",
|
||||
"APPS_CONTACTS": "Contacti",
|
||||
"APPS_MESSAGES": "Poruke",
|
||||
"APPS_CALCULATOR": "Calculator",
|
||||
"APPS_SETTINGS": "Postavke",
|
||||
"APPS_BANK": "WhoDis Banka",
|
||||
"APPS_DOCUMENTS": "Bilješke",
|
||||
"APPS_EXAMPLE": "Primjerna Aplikacija",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
"APPS_CAMERA": "Camera",
|
||||
|
||||
"APPS_DIALER_INCOMING_CALL_TITLE": "Incoming Phone Call",
|
||||
"APPS_DIALER_CURRENT_CALL_TITLE": "Current Phone Call",
|
||||
"APPS_DIALER_CURRENT_CALL_WITH": "In call with {{ transmitter }}",
|
||||
"APPS_DIALER_TRANSMITTER_IS_CALLING": "{{ transmitter }} is calling you!",
|
||||
"APPS_DIALER_ACCEPT_CALL": "Accept",
|
||||
"APPS_DIALER_REJECT_CALL": "Reject",
|
||||
"APPS_DIALER_END_CALL": "End",
|
||||
|
||||
"APPS_TWITTER_TWEET": "Tweet",
|
||||
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "Šta ima?",
|
||||
"APPS_TWITTER_IMAGE_PLACEHOLDER": "Link do vašeg slike ili gifa",
|
||||
"APPS_TWITTER_SUBMIT_IMAGE": "Dodati Slike",
|
||||
"APPS_TWITTER_CLOSE_IMAGE": "Zatvori",
|
||||
"APPS_TWITTER_CLOSE": "Zatvori",
|
||||
"APPS_TWITTER_DELETE": "Izbriši",
|
||||
"APPS_TWITTER_REPORT": "Prijavi",
|
||||
"APPS_TWITTER_REPORTED": "Prijavio",
|
||||
"APPS_TWITTER_JUST_NOW": "Tek Sada",
|
||||
"APPS_TWITTER_SEARCH_TWEETS": "Potražite za tweet",
|
||||
"APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER": "Pretražite sa imenom profila ili poruke",
|
||||
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Poruka ide preko ograničenje broj Slova",
|
||||
"APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT": "Message is over the new line limit",
|
||||
"APPS_TWITTER_CREATE_SUCCESS": "Vaš tweet je uspješno poslan",
|
||||
"APPS_TWITTER_CREATE_FAILED": "Slanje vašeg tweeta nije uspjelo",
|
||||
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "URL za avatar",
|
||||
"APPS_TWITTER_EDIT_PROFILE_NAME": "Ime profila",
|
||||
"APPS_TWITTER_EDIT_PROFILE_BIO": "Descriptcia",
|
||||
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Lokacija",
|
||||
"APPS_TWITTER_EDIT_PROFILE_JOB": "Posao",
|
||||
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Ažuriran vam je profil!",
|
||||
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Nismo uspjeli ažurirati vaš profil!",
|
||||
"APPS_TWITTER_TIME_JUST_NOW": "Tek Sada",
|
||||
"APPS_TWITTER_TIME_MINUTES": "m",
|
||||
"APPS_TWITTER_TIME_HOURS": "h",
|
||||
"APPS_TWITTER_TIME_DAYS": "d",
|
||||
"APPS_TWITTER_NEW_BROADCAST": "New tweet from @{{ profile_name }}!",
|
||||
"APPS_TWITTER_UNREAD_MESSAGES": "You have {{ count }} new tweets in your timeline!",
|
||||
|
||||
"APPS_BANK_TRANSFER": "Prebaciti Novac",
|
||||
"APPS_BANK_HOME_TITLE": "Dobrodošli!",
|
||||
"APPS_BANK_ACCOUNT_LINK": "Račun",
|
||||
"APPS_BANK_TIME_JUST_NOW": "Tek Sada",
|
||||
"APPS_BANK_ACCOUNT_TITLE": "Sažetak računa",
|
||||
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transakcije",
|
||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Vidjeti sve",
|
||||
"APPS_BANK_ACTIONS_TRANSFER": "Prebaciti Novac",
|
||||
"APPS_BANK_ALERT_TRANSFER_SUCCESS": "uspješno prebacio novac!",
|
||||
"APPS_BANK_ALERT_TRANSFER_FAILURE": "Nismo uspjeli prebaciti novac!",
|
||||
|
||||
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Po tražiti poruke ...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE": "Poruka...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Failed to send message",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Brojevi Telephona...",
|
||||
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Oznaka grupnog chata...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Pošalji",
|
||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Nije validan brok telephona: ",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Ova groupa već postoji!",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Nismo mogli napraviti ovu groupu!",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Ne možete sami sebe dodati u grupu!",
|
||||
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Search contacts or type number and press enter",
|
||||
|
||||
"APPS_CONTACT_FORM_NAME": "Ime",
|
||||
"APPS_CONTACT_FORM_NUMBER": "Brok",
|
||||
"APPS_CONTACT_FORM_AVATAR": "URL za avatar",
|
||||
|
||||
"APPS_CONTACT_ADD_SUCCESS": "Uspješno napravili novi kontakt!",
|
||||
"APPS_CONTACT_ADD_FAILED": "Nismo uspjeli stvoriti novi kontakt!",
|
||||
"APPS_CONTACT_UPDATE_SUCCESS": "Uspješno ažurirali kontakt!",
|
||||
"APPS_CONTACT_UPDATE_FAILED": "Nismo uspjeli ažurirati kontakt!",
|
||||
"APPS_CONTACT_DELETE_SUCCESS": "Uspješno izbrisali kontakt!",
|
||||
"APPS_CONTACT_DELETE_FAILED": "Nismo uspjeli izbrisati ovaj kontakt!",
|
||||
"APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS": "Search contacts",
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_NAME": "Name",
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_NUMBER": "Number",
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Failed to delete note.",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Result was copied to clipboard!",
|
||||
|
||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing",
|
||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Failed to create a new listing",
|
||||
|
||||
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||
"APPS_SETTINGS_OPTION_RINGTONE": "Ringtone",
|
||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringtone Volume",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notification Volume",
|
||||
|
||||
"GENERIC_SAVE": "Save",
|
||||
"GENERIC_UPDATE": "Update",
|
||||
"GENERIC_DELETE": "Delete",
|
||||
"GENERIC_CLOSE": "Close",
|
||||
"GENERIC_CANCEL": "Cancel",
|
||||
"GENERIC_TITLE": "Title",
|
||||
"GENERIC_CONTENT": "Content"
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,15 @@
|
||||
"translation": {
|
||||
"DATE_FORMAT": "MM/DD/YYYY",
|
||||
"DATE_TIME_FORMAT": "MM/DD/YYYY hh:mm A",
|
||||
"SETTINGS": {
|
||||
"CATEGORY": {
|
||||
"APPEARANCE": "Appearance",
|
||||
"PHONE": "Phone"
|
||||
},
|
||||
"OPTIONS": {
|
||||
"LANGUAGE": "Language"
|
||||
}
|
||||
},
|
||||
|
||||
"COMING_SOON": "Coming soon...",
|
||||
"INITIALIZING": "Initializing",
|
||||
@@ -12,7 +21,7 @@
|
||||
"APPS_CALCULATOR": "Calculator",
|
||||
"APPS_SETTINGS": "Settings",
|
||||
"APPS_BANK": "WhoDis Banking",
|
||||
"APPS_DOCUMENTS": "Documents",
|
||||
"APPS_NOTES": "Notes",
|
||||
"APPS_EXAMPLE": "Example app",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -101,14 +110,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
||||
|
||||
"APPS_DOCUMENTS_NOTES_TITLE": "Notes",
|
||||
"APPS_DOCUMENTS_LICENSE_TITLE": "Licenses",
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Failed to delete note.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_NOTES_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"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!",
|
||||
|
||||
@@ -123,6 +130,7 @@
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Notification Filters",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notification Volume",
|
||||
"APPS_SETTING_STREAMER_MODE_DESC": "Hide images before they are shown",
|
||||
|
||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing",
|
||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Failed to create a new listing",
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"APPS_CALCULATOR": "Calculadora",
|
||||
"APPS_SETTINGS": "Ajustes",
|
||||
"APPS_BANK": "Banco WhoDis",
|
||||
"APPS_DOCUMENTS": "Notas",
|
||||
"APPS_NOTES": "Notas",
|
||||
"APPS_EXAMPLE": "App de Ejemplo",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Mercado",
|
||||
@@ -94,12 +94,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Agregar contacto",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Se ha guardado la nota.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Hubo un error al guardar la nota.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Se ha actualizado la nota.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Hubo un error al actualizar la nota.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Se ha borrado la nota.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Hubo un error al borrar la nota.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Se ha guardado la nota.",
|
||||
"APPS_NOTES_ADD_FAILED": "Hubo un error al guardar la nota.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Se ha actualizado la nota.",
|
||||
"APPS_NOTES_UPDATE_FAILED": "Hubo un error al actualizar la nota.",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Se ha borrado la nota.",
|
||||
"APPS_NOTES_DELETE_FAILED": "Hubo un error al borrar la nota.",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Se ha copiado el resultado!",
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"APPS_CALCULATOR": "Calculatrice",
|
||||
"APPS_SETTINGS": "Paramètres",
|
||||
"APPS_BANK": "WhoDis Banque",
|
||||
"APPS_DOCUMENTS": "Notes",
|
||||
"APPS_NOTES": "Notes",
|
||||
"APPS_EXAMPLE": "App test",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Marché",
|
||||
@@ -101,12 +101,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Photo",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Ajouter un contact",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Note sauvegardée avec succès.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Erreur lors de la suppression d'une note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Mise à jour d'une note réalisée avec succès.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Erreur lors de la mise à jour d'une note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Note supprimée avec succès.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Erreur lors de la suppression d'une note.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Note sauvegardée avec succès.",
|
||||
"APPS_NOTES_ADD_FAILED": "Erreur lors de la suppression d'une note.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Mise à jour d'une note réalisée avec succès.",
|
||||
"APPS_NOTES_UPDATE_FAILED": "Erreur lors de la mise à jour d'une note.",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Note supprimée avec succès.",
|
||||
"APPS_NOTES_DELETE_FAILED": "Erreur lors de la suppression d'une note.",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Résultat copié dans le presse-papier!",
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtre de notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume des notifications",
|
||||
|
||||
|
||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Nouvelle liste créée avec succès!",
|
||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Échec lors de la création d'une nouvelle liste",
|
||||
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Liste supprimée avec succès",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"APPS_CALCULATOR": "Kalkulator",
|
||||
"APPS_SETTINGS": "Instillinger",
|
||||
"APPS_BANK": "WhoDis Bank",
|
||||
"APPS_DOCUMENTS": "Notater",
|
||||
"APPS_NOTES": "Notater",
|
||||
"APPS_EXAMPLE": "Example app",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Marked",
|
||||
@@ -101,12 +101,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Legg til",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Lagret notat!",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Kunne ikke lagre notatet!",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Oppdatert notat!",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Kunne ikke oppdatere notatet!",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Slettet notat!",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Kunne ikke slette notatet!",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Lagret notat!",
|
||||
"APPS_NOTES_ADD_FAILED": "Kunne ikke lagre notatet!",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Oppdatert notat!",
|
||||
"APPS_NOTES_UPDATE_FAILED": "Kunne ikke oppdatere notatet!",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Slettet notat!",
|
||||
"APPS_NOTES_DELETE_FAILED": "Kunne ikke slette notatet!",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Teskten ble kopiert til utklippstavle",
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"APPS_CALCULATOR": "Calculadora",
|
||||
"APPS_SETTINGS": "Definições",
|
||||
"APPS_BANK": "WhoDis Banco",
|
||||
"APPS_DOCUMENTS": "Notas",
|
||||
"APPS_NOTES": "Notas",
|
||||
"APPS_EXAMPLE": "Aplicativo exemplo",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -94,12 +94,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Adicionar contacto",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Failed to delete note.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_NOTES_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"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!",
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
"APPS_CALCULATOR": "Calculadora",
|
||||
"APPS_SETTINGS": "Configurações",
|
||||
"APPS_BANK": "Banco WhoDis",
|
||||
"APPS_DOCUMENTS": "Notas",
|
||||
"APPS_NOTES": "Notas",
|
||||
"APPS_EXAMPLE": "Aplicativo de exemplo",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -112,12 +112,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Foto de perfil",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Adcionar contato",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Nota salva com sucesso.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Falha em salvar nota.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Nota atualizada com sucesso.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Falha em atualizar nota.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Nota deletada com sucesso.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Falha em deletar nota.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Nota salva com sucesso.",
|
||||
"APPS_NOTES_ADD_FAILED": "Falha em salvar nota.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Nota atualizada com sucesso.",
|
||||
"APPS_NOTES_UPDATE_FAILED": "Falha em atualizar nota.",
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Nota deletada com sucesso.",
|
||||
"APPS_NOTES_DELETE_FAILED": "Falha em deletar nota.",
|
||||
|
||||
"APPS_CALCULATOR_COPIED": "Resultado foi copiado para a área de transferência!",
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"APPS_CALCULATOR": "Kalkylator",
|
||||
"APPS_SETTINGS": "Inställningar",
|
||||
"APPS_BANK": "WhoDis Bank",
|
||||
"APPS_DOCUMENTS": "Anteckningar",
|
||||
"APPS_NOTES": "Anteckningar",
|
||||
"APPS_EXAMPLE": "Exempel app",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -94,12 +94,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Failed to delete note.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_NOTES_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"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!",
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
"APPS_CALCULATOR": "Hesap makinesi",
|
||||
"APPS_SETTINGS": "Ayarlar",
|
||||
"APPS_BANK": "WhoDis Bankası",
|
||||
"APPS_DOCUMENTS": "Notlar",
|
||||
"APPS_NOTES": "Notlar",
|
||||
"APPS_EXAMPLE": "Örnek uygulama",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
@@ -94,12 +94,12 @@
|
||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
||||
|
||||
"APPS_DOCUMENTS_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_DOCUMENTS_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_DOCUMENTS_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"APPS_DOCUMENTS_UPDATE_FAILED": "Failed to update note.",
|
||||
"APPS_DOCUMENTS_DELETE_SUCCESS": "Successfully deleted note.",
|
||||
"APPS_DOCUMENTS_DELETE_FAILED": "Failed to delete note.",
|
||||
"APPS_NOTES_ADD_SUCCESS": "Successfully saved note.",
|
||||
"APPS_NOTES_ADD_FAILED": "Failed to save note.",
|
||||
"APPS_NOTES_UPDATE_SUCCESS": "Successfully updated note.",
|
||||
"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!",
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ import { faTwitter } from '@fortawesome/free-brands-svg-icons';
|
||||
|
||||
import ContactsIcon from '@material-ui/icons/Contacts';
|
||||
import SettingsIcon from '@material-ui/icons/Settings';
|
||||
import FolderIcon from '@material-ui/icons/Folder';
|
||||
import MessageIcon from '@material-ui/icons/Message';
|
||||
import { CalculatorIcon } from '../../../apps/calculator/components/CalculatorIcon';
|
||||
import CameraAltIcon from '@material-ui/icons/CameraAlt';
|
||||
@@ -25,7 +24,7 @@ import { MessagesApp } from '../../../apps/messages/components/MessagesApp';
|
||||
import { TwitterApp } from '../../../apps/twitter/components/TwitterApp';
|
||||
import { ExampleApp } from '../../../apps/example/components/ExampleApp';
|
||||
import { SelloutApp } from '../../../apps/sellout/components/SelloutApp';
|
||||
import { NotesApp } from '../../../apps/notes/DoucmentsApp';
|
||||
import { NotesApp } from '../../../apps/notes/NotesApp';
|
||||
import CameraApp from '../../../apps/camera/components/CameraApp';
|
||||
import { AppRoute } from '../components/AppRoute';
|
||||
|
||||
@@ -41,10 +40,7 @@ import {
|
||||
SELLOUT_APP_PRIMARY_COLOR,
|
||||
SELLOUT_APP_ICON_COLOR,
|
||||
} from '../../../apps/sellout/sellout.theme';
|
||||
import {
|
||||
DOCUMENTS_APP_ICON_COLOR,
|
||||
DOCUMENTS_APP_PRIMARY_COLOR,
|
||||
} from '../../../apps/notes/documents.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 {
|
||||
TWITTER_APP_PRIMARY_COLOR,
|
||||
@@ -144,14 +140,14 @@ export const APPS: IAppConfig[] = [
|
||||
Route: () => <AppRoute id="SELLOUT" path="/sellout" component={SelloutApp} />,
|
||||
},
|
||||
{
|
||||
id: 'DOCUMENTS',
|
||||
nameLocale: 'APPS_DOCUMENTS',
|
||||
icon: <FolderIcon fontSize="large" />,
|
||||
id: 'NOTES',
|
||||
nameLocale: 'APPS_NOTES',
|
||||
icon: <FontAwesomeIcon icon={faStickyNote} fixedWidth />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faStickyNote} fixedWidth size="xs" />,
|
||||
backgroundColor: DOCUMENTS_APP_PRIMARY_COLOR,
|
||||
color: DOCUMENTS_APP_ICON_COLOR,
|
||||
path: '/documents',
|
||||
Route: () => <AppRoute id="DOCUMENTS" path="/documents" component={NotesApp} />,
|
||||
backgroundColor: NOTES_APP_PRIMARY_COLOR,
|
||||
color: NOTES_APP_ICON_COLOR,
|
||||
path: '/notes',
|
||||
Route: () => <AppRoute id="NOTES" path="/notes" component={NotesApp} />,
|
||||
},
|
||||
{
|
||||
id: 'CAMERA',
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getSoundSettings = (
|
||||
try {
|
||||
return app
|
||||
? {
|
||||
sound: getPath[type](settings[`${app}_${type}`].value || settings[type].value),
|
||||
sound: getPath[type](settings[`${app}_${type}`]?.value || settings[type].value),
|
||||
volume: (settings[`${app}_${type}Vol`] || settings[`${type}Vol`]) / 100,
|
||||
}
|
||||
: {
|
||||
|
||||
@@ -9,7 +9,7 @@ export const GridMenu = ({ items, Component = AppIcon, xs = undefined }) => {
|
||||
{items &&
|
||||
items.length &&
|
||||
items.map((item) => (
|
||||
<Grid item xs={xs} key={item.id} alignItems="center" justify="center">
|
||||
<Grid item xs={xs} key={item.id}>
|
||||
<Box textAlign="center">
|
||||
<Link to={item.path}>
|
||||
<Component {...item} />
|
||||
|
||||
@@ -4,6 +4,7 @@ const webpack = require('webpack');
|
||||
module.exports = (options) => ({
|
||||
mode: options.mode,
|
||||
entry: options.entry,
|
||||
devtool: 'source-maps',
|
||||
output: {
|
||||
path: path.resolve(process.cwd(), '../resources/html'),
|
||||
filename: '[name].js',
|
||||
|
||||
@@ -6,8 +6,7 @@ const exp = (global as any).exports;
|
||||
|
||||
RegisterNuiCallbackType(events.PHONE_INITIALIZE_CALL); // Fires when the call is started.
|
||||
on(`__cfx_nui:${events.PHONE_INITIALIZE_CALL}`, (data: any, cb: Function) => {
|
||||
const start = Date.now();
|
||||
emitNet(events.PHONE_INITIALIZE_CALL, data.number, start);
|
||||
emitNet(events.PHONE_INITIALIZE_CALL, data.number);
|
||||
cb();
|
||||
});
|
||||
|
||||
@@ -58,8 +57,7 @@ onNet(
|
||||
|
||||
RegisterNuiCallbackType(events.PHONE_CALL_REJECTED); // Fires when cancelling and rejecting a call.
|
||||
on(`__cfx_nui:${events.PHONE_CALL_REJECTED}`, (data: any, cb: Function) => {
|
||||
const end = Date.now();
|
||||
emitNet(events.PHONE_CALL_REJECTED, data.phoneNumber, end);
|
||||
emitNet(events.PHONE_CALL_REJECTED, data.phoneNumber);
|
||||
cb();
|
||||
});
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ const postToWebhook = async (content: DiscordMessage): Promise<AxiosResponse | v
|
||||
// If convar isnt set
|
||||
if (!DISCORD_WEBHOOK) {
|
||||
discordLogger.warn(
|
||||
'Got a request to report a listing but discord is not configures. See README o how to configure discord endpoints.',
|
||||
'Got a request to report a listing but discord is not configures. See README on how to configure discord endpoints.',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import events from '../utils/events';
|
||||
import { getIdentifierByPhoneNumber, getPlayer, getSource } from './functions';
|
||||
|
||||
import { getPlayerFromIdentifier } from './functions';
|
||||
import { ICall } from '../../typings/call';
|
||||
|
||||
@@ -30,9 +29,11 @@ async function fetchCalls(phoneNumber: string): Promise<ICall[]> {
|
||||
|
||||
let calls: Map<string, ICall> = new Map();
|
||||
|
||||
onNet(events.PHONE_INITIALIZE_CALL, async (phoneNumber: string, timestamp: number) => {
|
||||
onNet(events.PHONE_INITIALIZE_CALL, async (phoneNumber: string) => {
|
||||
const _source = getSource();
|
||||
|
||||
const startCallTimeUnix = new Date().getTime() / 1000;
|
||||
|
||||
const callIdentifier = uuidv4();
|
||||
|
||||
// the client that is calling
|
||||
@@ -60,7 +61,7 @@ onNet(events.PHONE_INITIALIZE_CALL, async (phoneNumber: string, timestamp: numbe
|
||||
transmitterSource: _source,
|
||||
receiver: receiverNumber,
|
||||
receiverSource: xReceiver.source,
|
||||
start: timestamp / 1000,
|
||||
start: Math.floor(startCallTimeUnix),
|
||||
accepted: false,
|
||||
});
|
||||
|
||||
@@ -81,6 +82,10 @@ onNet(events.PHONE_ACCEPT_CALL, async (transmitterNumber: string) => {
|
||||
const pSource = getSource();
|
||||
try {
|
||||
const currentCall = calls.get(transmitterNumber);
|
||||
|
||||
// Sanity check if call exists in current set
|
||||
if (!currentCall) new Error('Transmitter number does not exist in set.');
|
||||
|
||||
const channelId = pSource;
|
||||
|
||||
await updateCall(currentCall, true, null);
|
||||
@@ -109,6 +114,9 @@ onNet(events.PHONE_CALL_REJECTED, async (transmitterNumber: string, timestamp: n
|
||||
const pSource = getSource();
|
||||
try {
|
||||
const currentCall = calls.get(transmitterNumber);
|
||||
|
||||
// Sanity check if call exists in current set
|
||||
if (!currentCall) new Error('Transmitter number does not exist in set.');
|
||||
await updateCall(currentCall, false, timestamp);
|
||||
|
||||
// player who is called and initiasted the rejection.
|
||||
@@ -124,13 +132,17 @@ onNet(events.PHONE_CALL_REJECTED, async (transmitterNumber: string, timestamp: n
|
||||
}
|
||||
});
|
||||
|
||||
onNet(events.PHONE_END_CALL, async (transmitterNumber: string, timestamp: number) => {
|
||||
onNet(events.PHONE_END_CALL, async (transmitterNumber: string) => {
|
||||
const pSource = getSource();
|
||||
try {
|
||||
const currentTimeUnix = new Date().getTime() / 1000;
|
||||
|
||||
const currentCall = calls.get(transmitterNumber);
|
||||
const endTime = timestamp / 1000;
|
||||
await updateCall(currentCall, false, endTime);
|
||||
const accepted = calls.get(pSource);
|
||||
|
||||
// Sanity check if call exists in current set
|
||||
if (!currentCall) new Error('Transmitter number does not exist in set.');
|
||||
|
||||
await updateCall(currentCall, false, currentTimeUnix);
|
||||
|
||||
// player who is being called
|
||||
emitNet(events.PHONE_CALL_WAS_ENDED, currentCall.receiverSource);
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import md5 from 'md5';
|
||||
|
||||
import events from '../utils/events';
|
||||
import { CreateMessageGroupResult, Message, MessageGroup } from '../../typings/messages';
|
||||
import { pool, withTransaction } from './db';
|
||||
import { getIdentifier, getSource, getPlayerFromIdentifier } from './functions';
|
||||
import { mainLogger } from './sv_logger';
|
||||
import { group } from 'console';
|
||||
|
||||
const messageLogger = mainLogger.child({ module: 'messages' });
|
||||
|
||||
@@ -45,13 +42,14 @@ interface MessageGroupMapping {
|
||||
* @param userIdentifier - identifier of the user creating this message
|
||||
* @param groupId - the message group ID to attach this message to
|
||||
* @param message - content of the message
|
||||
* @param participants -
|
||||
*/
|
||||
async function createMessage(
|
||||
userIdentifier: string,
|
||||
groupId: string,
|
||||
message: string,
|
||||
participants: string[],
|
||||
): Promise<any> {
|
||||
): Promise<UnformattedMessageGroup[]> {
|
||||
const query = `
|
||||
INSERT INTO npwd_messages
|
||||
(user_identifier, message, group_id)
|
||||
@@ -71,7 +69,7 @@ async function createMessage(
|
||||
.map((s) => pool.query(groupQuery, [s, groupId])),
|
||||
);
|
||||
|
||||
return results;
|
||||
return <UnformattedMessageGroup[]>results;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -172,7 +170,7 @@ async function createMessageGroup(
|
||||
(user_identifier, group_id, participant_identifier)
|
||||
VALUES (?, ?, ?)
|
||||
`;
|
||||
const [results] = await pool.query(query, [userIdentifier, groupId, participantIdentifier]);
|
||||
await pool.query(query, [userIdentifier, groupId, participantIdentifier]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -379,7 +377,8 @@ function getIdentifiersFromParticipants(groupId: string) {
|
||||
|
||||
/**
|
||||
* Sets the current message isRead to 0 for said player
|
||||
* @param id
|
||||
* @param groupId The unique group ID for the message
|
||||
* @param identifier The identifier for the player
|
||||
*/
|
||||
async function setMessageRead(groupId: string, identifier: string) {
|
||||
const query =
|
||||
@@ -408,40 +407,44 @@ onNet(
|
||||
const result = await createMessageGroupsFromPhoneNumbers(_identifier, phoneNumbers, label);
|
||||
|
||||
if (result.error && result.duplicate) {
|
||||
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
return emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
message: 'MESSAGES_MESSAGE_GROUP_DUPLICATE',
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
// if the phoneNumber is invalid
|
||||
} else if (result.error && result.phoneNumber) {
|
||||
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
// if the phoneNumber is invalid
|
||||
if (result.error && result.phoneNumber) {
|
||||
return emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
message: 'MESSAGES_INVALID_PHONE_NUMBER',
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
// if you are try to add yourself
|
||||
} else if (result.error && result.mine) {
|
||||
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
// if you are try to add yourself
|
||||
if (result.error && result.mine) {
|
||||
return emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
message: 'MESSAGES_MESSAGE_GROUP_CREATE_MINE',
|
||||
type: 'error',
|
||||
});
|
||||
} else if (result.error) {
|
||||
// if it just fails, welp
|
||||
}
|
||||
|
||||
// if it just fails, welp
|
||||
if (result.error) {
|
||||
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_FAILED, _source, result);
|
||||
emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
return emitNet(events.MESSAGES_ACTION_RESULT, _source, {
|
||||
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
|
||||
type: 'error',
|
||||
});
|
||||
} else {
|
||||
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_SUCCESS, _source, result);
|
||||
if (result.identifiers) {
|
||||
for (const participantId of result.identifiers) {
|
||||
// we don't broadcast to the source of the event.
|
||||
if (participantId !== _identifier) {
|
||||
const participantPlayer = getPlayerFromIdentifier(participantId);
|
||||
emitNet(events.MESSAGES_FETCH_MESSAGE_GROUPS, participantPlayer.source);
|
||||
}
|
||||
}
|
||||
|
||||
emitNet(events.MESSAGES_CREATE_MESSAGE_GROUP_SUCCESS, _source, result);
|
||||
if (result.identifiers) {
|
||||
for (const participantId of result.identifiers) {
|
||||
// we don't broadcast to the source of the event.
|
||||
if (participantId !== _identifier) {
|
||||
const participantPlayer = getPlayerFromIdentifier(participantId);
|
||||
emitNet(events.MESSAGES_FETCH_MESSAGE_GROUPS, participantPlayer.source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,6 @@ onNet(events.NOTE_UPDATE_NOTE, async (note: Note) => {
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
const pSource = (global as any).source;
|
||||
emitNet(events.NOTE_UPDATE_NOTE_FAILURE, pSource);
|
||||
notesLogger.error(`Failed to update note, ${e.message}`, {
|
||||
source: pSource,
|
||||
|
||||
@@ -14,8 +14,7 @@ async function uploadPhoto(identifier: string, image: string) {
|
||||
async function getPhotosByIdentifier(identifier: string): Promise<IPhoto[]> {
|
||||
const query = 'SELECT id, image FROM npwd_phone_gallery WHERE identifier = ? ORDER BY id DESC';
|
||||
const [results] = await pool.query(query, [identifier]);
|
||||
const photos = <IPhoto[]>results;
|
||||
return photos;
|
||||
return <IPhoto[]>results;
|
||||
}
|
||||
|
||||
async function deletePhoto(photo: IPhoto, identifier: string) {
|
||||
@@ -38,9 +37,15 @@ onNet(events.CAMERA_UPLOAD_PHOTO, async (image: string) => {
|
||||
|
||||
onNet(events.CAMERA_FETCH_PHOTOS, async () => {
|
||||
const _source = getSource();
|
||||
const identifier = getIdentifier(_source);
|
||||
const photos = await getPhotosByIdentifier(identifier);
|
||||
emitNet(events.CAMERA_SEND_PHOTOS, source, photos);
|
||||
try {
|
||||
const identifier = getIdentifier(_source);
|
||||
const photos = await getPhotosByIdentifier(identifier);
|
||||
emitNet(events.CAMERA_SEND_PHOTOS, _source, photos);
|
||||
} catch (e) {
|
||||
photoLogger.error(`Failed to fetch photos, ${e.message}`, {
|
||||
source: _source,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
onNet(events.CAMERA_DELETE_PHOTO, async (photo: IPhoto) => {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import events from '../utils/events';
|
||||
import { getIdentifier, getPlayer, getSource } from './functions';
|
||||
import { ESX } from './server';
|
||||
import { pool } from './db';
|
||||
import { mainLogger } from './sv_logger';
|
||||
import { MarketplaceListing } from '../../typings/marketplace';
|
||||
@@ -8,12 +9,10 @@ import { reportListingToDiscord } from './discord';
|
||||
const selloutLogger = mainLogger.child({ module: 'sellout' });
|
||||
|
||||
async function fetchAllListings(): Promise<MarketplaceListing[]> {
|
||||
const query = 'SELECT * FROM npwd_sellout_listings ORDER BY id DESC';
|
||||
const query = 'SELECT * FROM npwd_marketplace_listings ORDER BY id DESC';
|
||||
|
||||
const [results] = await pool.query(query);
|
||||
const listings = <MarketplaceListing[]>results;
|
||||
|
||||
return listings;
|
||||
return <MarketplaceListing[]>results;
|
||||
}
|
||||
|
||||
async function addListing(
|
||||
@@ -24,7 +23,7 @@ async function addListing(
|
||||
listing: MarketplaceListing,
|
||||
): Promise<void> {
|
||||
const query =
|
||||
'INSERT INTO npwd_sellout_listings (identifier, username, name, number, title, url, description) VALUES (?, ?, ?, ?, ?, ?, ?)';
|
||||
'INSERT INTO npwd_marketplace_listings (identifier, username, name, number, title, url, description) VALUES (?, ?, ?, ?, ?, ?, ?)';
|
||||
await pool.query(query, [
|
||||
identifier,
|
||||
username,
|
||||
@@ -37,17 +36,16 @@ async function addListing(
|
||||
}
|
||||
|
||||
async function deleteListing(listingId: number, identifier: string): Promise<void> {
|
||||
const query = 'DELETE FROM npwd_sellout_listings WHERE id = ? AND identifier = ?';
|
||||
const query = 'DELETE FROM npwd_marketplace_listings WHERE id = ? AND identifier = ?';
|
||||
|
||||
await pool.query(query, [listingId, identifier]);
|
||||
}
|
||||
|
||||
async function getListing(listingId: number): Promise<MarketplaceListing> {
|
||||
const query = `SELECT * FROM npwd_sellout_listings WHERE id = ?`;
|
||||
const query = `SELECT * FROM npwd_marketplace_listings WHERE id = ?`;
|
||||
const [results] = await pool.query(query, [listingId]);
|
||||
const listings = <MarketplaceListing[]>results;
|
||||
const listing = listings[0];
|
||||
return listing;
|
||||
return listings[0];
|
||||
}
|
||||
|
||||
async function reportListing(listingId: number, profile: string): Promise<void> {
|
||||
@@ -144,18 +142,19 @@ onNet(events.SELLOUT_REPORT_LISTING, async (listing: MarketplaceListing) => {
|
||||
if (reportExists) {
|
||||
// send an info alert
|
||||
selloutLogger.error(`This listing has already been reported`);
|
||||
emitNet(events.SELLOUT_ACTION_RESULT, pSource, {
|
||||
return emitNet(events.SELLOUT_ACTION_RESULT, pSource, {
|
||||
message: 'MARKETPLACE_REPORT_LISTING_FAILED',
|
||||
type: 'info',
|
||||
});
|
||||
} else {
|
||||
await reportListing(rListing.id, rListing.name);
|
||||
await reportListingToDiscord(rListing, reportingPlayer);
|
||||
emitNet(events.SELLOUT_ACTION_RESULT, pSource, {
|
||||
message: 'MARKETPLACE_REPORT_LISTING_SUCCESS',
|
||||
type: 'success',
|
||||
});
|
||||
}
|
||||
|
||||
await reportListing(rListing.id, rListing.name);
|
||||
await reportListingToDiscord(rListing, reportingPlayer);
|
||||
|
||||
emitNet(events.SELLOUT_ACTION_RESULT, pSource, {
|
||||
message: 'MARKETPLACE_REPORT_LISTING_SUCCESS',
|
||||
type: 'success',
|
||||
});
|
||||
} catch (e) {
|
||||
selloutLogger.error(`Failed to report listing ${e.message}`, {
|
||||
source: pSource,
|
||||
|
||||
@@ -5,6 +5,7 @@ import events from '../utils/events';
|
||||
import config from '../utils/config';
|
||||
import { reportTweetToDiscord } from './discord';
|
||||
import { mainLogger } from './sv_logger';
|
||||
import { ResultSetHeader } from 'mysql2';
|
||||
|
||||
const twitterLogger = mainLogger.child({ module: 'twitter' });
|
||||
|
||||
@@ -95,6 +96,7 @@ async function fetchTweetsFiltered(profileId: number, searchValue: string): Prom
|
||||
|
||||
/**
|
||||
* Retrieve a Tweet by ID
|
||||
* @param profileId Unique id for the twitter profile (NOT user identifier)
|
||||
* @param tweetId - primary key of the tweet ID
|
||||
*/
|
||||
async function getTweet(profileId: number, tweetId: number): Promise<Tweet> {
|
||||
@@ -131,7 +133,11 @@ async function createTweet(identifier: string, tweet: NewTweet): Promise<Tweet>
|
||||
tweet.images,
|
||||
tweet.retweet,
|
||||
]);
|
||||
const insertData = <any>results;
|
||||
// This should not be an any type and instead should be
|
||||
// a Tweet[] according to mysql2 documentation. But instead
|
||||
// this exec promise returns the row itself, not an array of rows like it states
|
||||
// Therefore type assertion doesn't work here for correctly typing this out.
|
||||
const insertData = <ResultSetHeader>results;
|
||||
return await getTweet(profile.id, insertData.insertId);
|
||||
}
|
||||
|
||||
@@ -189,7 +195,8 @@ async function createDefaultProfile(identifier: string): Promise<Profile> {
|
||||
INSERT INTO npwd_twitter_profiles (identifier, profile_name)
|
||||
VALUES (?, ?)
|
||||
`;
|
||||
const [result] = await pool.execute(query, [identifier, profileName]);
|
||||
|
||||
await pool.execute(query, [identifier, profileName]);
|
||||
return getProfile(identifier);
|
||||
}
|
||||
|
||||
@@ -251,7 +258,7 @@ async function deleteTweet(identifier: string, tweetId: number): Promise<void> {
|
||||
DELETE FROM npwd_twitter_tweets
|
||||
WHERE identifier = ? AND id = ?
|
||||
`;
|
||||
const [result] = await pool.execute(query, [identifier, tweetId]);
|
||||
await pool.execute(query, [identifier, tweetId]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -428,11 +435,10 @@ onNet(events.TWITTER_RETWEET, async (tweetId: number) => {
|
||||
// alert the player that they have already retweeted
|
||||
// this post (or that they are the original poster)
|
||||
if (await doesRetweetExist(tweetId, identifier)) {
|
||||
emitNet(events.TWITTER_RETWEET_EXISTS, _source, {
|
||||
return emitNet(events.TWITTER_RETWEET_EXISTS, _source, {
|
||||
message: 'TWITTER_RETWEET_EXISTS',
|
||||
type: 'error',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// our message for this row is blank because when we
|
||||
@@ -460,13 +466,14 @@ onNet(events.TWITTER_REPORT, async (tweetId: number) => {
|
||||
const tweet = await getTweet(profile.id, tweetId);
|
||||
|
||||
const reportExists = await doesReportExist(tweet.id, profile.id);
|
||||
|
||||
if (reportExists) {
|
||||
twitterLogger.warn('This profile has already reported this tweet');
|
||||
} else {
|
||||
await createTweetReport(tweet.id, profile.id);
|
||||
await reportTweetToDiscord(tweet, profile);
|
||||
return twitterLogger.warn('This profile has already reported this tweet');
|
||||
}
|
||||
|
||||
await createTweetReport(tweet.id, profile.id);
|
||||
await reportTweetToDiscord(tweet, profile);
|
||||
|
||||
emitNet(events.TWITTER_REPORT_SUCCESS, _source);
|
||||
} catch (e) {
|
||||
emitNet(events.TWITTER_REPORT_FAILURE, _source);
|
||||
|
||||
@@ -16,7 +16,6 @@ const server = {
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({ 'global.GENTLY': false }),
|
||||
new RemovePlugin({
|
||||
before: {
|
||||
include: [path.resolve(buildPath, 'server')],
|
||||
@@ -25,6 +24,8 @@ const server = {
|
||||
include: [path.resolve(buildPath, 'server')],
|
||||
},
|
||||
}),
|
||||
// Ignore cardinal as its optional
|
||||
new webpack.IgnorePlugin(/^cardinal$/, /./),
|
||||
],
|
||||
optimization: {
|
||||
minimize: true,
|
||||
|
||||
+1401
-1653
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user