mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-01 14:38:47 +00:00
more formatting
This commit is contained in:
1 parent
046447b0fb
commit
f552c1212c
157 files changed
+635
-1579
No files matched your search
+3
-1
@@ -4,4 +4,6 @@ coverage
|
||||
node_modules
|
||||
.idea
|
||||
.github
|
||||
.vscode
|
||||
.vscode
|
||||
resources/html
|
||||
resources/dist
|
||||
@@ -1,2 +0,0 @@
|
||||
build
|
||||
node_modules
|
||||
+1
-10
@@ -65,8 +65,6 @@
|
||||
"file-loader": "^3.0.1",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^4.3.0",
|
||||
"lint-staged": "^10.5.3",
|
||||
"prettier": "^2.0.5",
|
||||
"react-devtools": "^4.10.1",
|
||||
"react-test-renderer": "^16.13.1",
|
||||
"style-loader": "^0.23.1",
|
||||
@@ -82,22 +80,15 @@
|
||||
"copy:config": "cp-cli ../config.json ./src/config.autogen.json",
|
||||
"start": "yarn copy:config && react-scripts start",
|
||||
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
|
||||
"format": "prettier --write src/**/*.{js,jsx,ts,tsx,json,css,scss,md}",
|
||||
"build": "yarn copy:config && cross-env NODE_ENV=production webpack --config webpack/prod.config.js --color -p --progress --hide-modules --display-optimization-bailout",
|
||||
"build:dev": "cross-env NODE_ENV=development webpack --config webpack/dev.config.js --color -p --progress --hide-modules --display-optimization-bailout --analyze",
|
||||
"test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}",
|
||||
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.{ts,js,tsx}",
|
||||
"eject": "react-scripts eject",
|
||||
"precommit": "npm run test && lint-staged"
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*": [
|
||||
"prettier --write src/**/*.{js,jsx,ts,tsx,json,css,scss,md}"
|
||||
]
|
||||
},
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// Taso: Including some default values for clarity sake
|
||||
module.exports = {
|
||||
trailingComma: 'es5',
|
||||
tabWidth: 2,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
jsxSingleQuote: true,
|
||||
jsxBracketSameLine: false,
|
||||
bracketSpacing: true,
|
||||
};
|
||||
@@ -7,6 +7,6 @@ it('renders Phone', () => {
|
||||
shallow(
|
||||
<RecoilRoot>
|
||||
<Phone />
|
||||
</RecoilRoot>
|
||||
</RecoilRoot>,
|
||||
);
|
||||
});
|
||||
+9
-11
@@ -52,11 +52,11 @@ function Phone() {
|
||||
const { bottom, visibility } = usePhoneVisibility();
|
||||
|
||||
return (
|
||||
<Slide direction='up' in={visibility}>
|
||||
<div className='PhoneWrapper'>
|
||||
<Slide direction="up" in={visibility}>
|
||||
<div className="PhoneWrapper">
|
||||
<div>
|
||||
<div
|
||||
className='Phone'
|
||||
className="Phone"
|
||||
style={{
|
||||
transformOrigin: 'right bottom',
|
||||
transform: `scale(${settings.zoom}`,
|
||||
@@ -64,26 +64,24 @@ function Phone() {
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className='PhoneFrame'
|
||||
className="PhoneFrame"
|
||||
style={{
|
||||
backgroundImage: `url(./media/frames/${settings.frame})`,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
id='phone'
|
||||
className='PhoneScreen'
|
||||
id="phone"
|
||||
className="PhoneScreen"
|
||||
style={{
|
||||
backgroundImage: `url(./media/backgrounds/${settings.wallpaper})`,
|
||||
}}
|
||||
>
|
||||
<>
|
||||
<NotificationBar />
|
||||
<div className='PhoneAppContainer'>
|
||||
<div className="PhoneAppContainer">
|
||||
<>
|
||||
<Route exact path='/' component={HomeApp} />
|
||||
{callModal && (
|
||||
<Route exact path='/call' component={CallModal} />
|
||||
)}
|
||||
<Route exact path="/" component={HomeApp} />
|
||||
{callModal && <Route exact path="/call" component={CallModal} />}
|
||||
{apps.map((App) => (
|
||||
<App.Route key={App.id} />
|
||||
))}
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
font-family: 'Bahnschrift Regular';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: local('Bahnschrift Regular'),
|
||||
url('../fonts/BAHNSCHRIFT.woff') format('woff');
|
||||
src: local('Bahnschrift Regular'), url('../fonts/BAHNSCHRIFT.woff') format('woff');
|
||||
}
|
||||
|
||||
#account-section,
|
||||
|
||||
@@ -99,15 +99,15 @@ export const BankApp = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<AppWrapper id='bank-app'>
|
||||
<AppWrapper id="bank-app">
|
||||
<BankTitle />
|
||||
<TransferModal />
|
||||
<div className={showBankModal ? classes.backgroundModal : undefined} />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path='/bank' exact component={BankHome} />
|
||||
<Route path='/bank/account' exact component={BankAccount} />
|
||||
<Route path='/bank/transactions' exact component={TransactionList} />
|
||||
<Route path="/bank" exact component={BankHome} />
|
||||
<Route path="/bank/account" exact component={BankAccount} />
|
||||
<Route path="/bank/transactions" exact component={TransactionList} />
|
||||
</Switch>
|
||||
</AppContent>
|
||||
<NavigationBar />
|
||||
|
||||
@@ -23,8 +23,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
export const BankTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||
<Typography id='bank-title' style={{ margin: 0 }} variant='h4'>
|
||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||
<Typography id="bank-title" style={{ margin: 0 }} variant="h4">
|
||||
WhoDis Banking
|
||||
</Typography>
|
||||
</Paper>
|
||||
|
||||
@@ -16,7 +16,7 @@ export const AccountTransactions = (): any => {
|
||||
const { transactionList } = useTransactions();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div id='account-section'>
|
||||
<div id="account-section">
|
||||
<div className={classes.header}>
|
||||
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||
<Button className={classes.seeAll}>
|
||||
|
||||
@@ -27,7 +27,7 @@ export const BankAccount = () => {
|
||||
</div>
|
||||
<BankCard
|
||||
name={credentials.name}
|
||||
account='Checking'
|
||||
account="Checking"
|
||||
balance={credentials.balance}
|
||||
/>
|
||||
<AccountTransactions />
|
||||
|
||||
@@ -32,13 +32,10 @@ export const BankHome = () => {
|
||||
<p className={classes.accountBalance}>{credentials.balance}</p>
|
||||
</div>
|
||||
<div className={classes.actions}>
|
||||
<Button id='actionButton' className={classes.actionButton}>
|
||||
<NavLink to='/bank/account'>{t('APPS_BANK_ACCOUNT_LINK')}</NavLink>
|
||||
<Button id="actionButton" className={classes.actionButton}>
|
||||
<NavLink to="/bank/account">{t('APPS_BANK_ACCOUNT_LINK')}</NavLink>
|
||||
</Button>
|
||||
<Button
|
||||
onClick={openTransactionsModal}
|
||||
className={classes.actionButton}
|
||||
>
|
||||
<Button onClick={openTransactionsModal} className={classes.actionButton}>
|
||||
{t('APPS_BANK_ACTIONS_TRANSFER')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -4,11 +4,7 @@ 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 { faHome, faList, faMoneyCheck } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -37,17 +33,17 @@ export const NavigationBar = () => {
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to='/bank'
|
||||
to="/bank"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
||||
to='/bank/account'
|
||||
to="/bank/account"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faList} />}
|
||||
to='/bank/transactions'
|
||||
to="/bank/transactions"
|
||||
/>
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
@@ -27,7 +27,7 @@ export const TransactionList = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<div id='transaction-section'>
|
||||
<div id="transaction-section">
|
||||
<div className={classes.header}>
|
||||
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||
</div>
|
||||
@@ -52,7 +52,7 @@ export const TransactionList = () => {
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[3, 5]}
|
||||
className={classes.pagination}
|
||||
component='div'
|
||||
component="div"
|
||||
count={transactionList.length}
|
||||
rowsPerPage={rowsPerPage}
|
||||
page={page}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import Modal from '../../../../ui/components/Modal';
|
||||
import {
|
||||
Button,
|
||||
List,
|
||||
ListItem,
|
||||
TextField,
|
||||
makeStyles,
|
||||
} from '@material-ui/core';
|
||||
import { Button, List, ListItem, TextField, makeStyles } from '@material-ui/core';
|
||||
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
@@ -64,8 +58,8 @@ export const TransferModal = () => {
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
fullWidth
|
||||
type='number'
|
||||
placeholder='ID'
|
||||
type="number"
|
||||
placeholder="ID"
|
||||
value={targetID}
|
||||
onChange={(e) => setTargetID(e.target.value)}
|
||||
/>
|
||||
@@ -73,9 +67,9 @@ export const TransferModal = () => {
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder='Amount'
|
||||
placeholder="Amount"
|
||||
fullWidth
|
||||
type='number'
|
||||
type="number"
|
||||
value={amount}
|
||||
onChange={(e) => setAmount(e.target.value)}
|
||||
/>
|
||||
@@ -83,7 +77,7 @@ export const TransferModal = () => {
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder='Message'
|
||||
placeholder="Message"
|
||||
fullWidth
|
||||
value={message}
|
||||
multiline
|
||||
|
||||
@@ -56,14 +56,14 @@ export const Calculator = ({ ...props }) => {
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 4,
|
||||
}),
|
||||
[result]
|
||||
[result],
|
||||
);
|
||||
|
||||
return (
|
||||
<Box display='flex' flexDirection='column'>
|
||||
<Box display="flex" flexDirection="column">
|
||||
<Box flexGrow={1} component={Paper} p={4} className={classes.result}>
|
||||
<Fab
|
||||
size='small'
|
||||
size="small"
|
||||
onClick={() => {
|
||||
setClipboard(resultStr);
|
||||
addAlert({ message: 'CALCULATOR_COPIED', type: 'info' });
|
||||
@@ -75,7 +75,7 @@ export const Calculator = ({ ...props }) => {
|
||||
{resultStr}
|
||||
</Box>
|
||||
<Box>
|
||||
<Grid container justify='space-around'>
|
||||
<Grid container justify="space-around">
|
||||
<CalcButton button={clear} className={classes.button} />
|
||||
<CalcButton button={clearAll} className={classes.button} />
|
||||
<CalcButton button={divider} className={classes.button} />
|
||||
|
||||
@@ -5,37 +5,37 @@ export const CalculatorIcon = ({ ...props }: SvgIconProps) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<svg
|
||||
xmlns='http://www.w3.org/2000/svg'
|
||||
x='0'
|
||||
y='0'
|
||||
enableBackground='new 0 0 56 56'
|
||||
version='1.1'
|
||||
viewBox='0 0 56 56'
|
||||
xmlSpace='preserve'
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
x="0"
|
||||
y="0"
|
||||
enableBackground="new 0 0 56 56"
|
||||
version="1.1"
|
||||
viewBox="0 0 56 56"
|
||||
xmlSpace="preserve"
|
||||
>
|
||||
<path fill='#EBBA16' d='M0 0H28V28H0z'></path>
|
||||
<path fill='#ED8A19' d='M28 0H56V28H28z'></path>
|
||||
<path fill='#ED8A19' d='M0 28H28V56H0z'></path>
|
||||
<path fill='#556080' d='M28 28H56V56H28z'></path>
|
||||
<path fill="#EBBA16" d="M0 0H28V28H0z"></path>
|
||||
<path fill="#ED8A19" d="M28 0H56V28H28z"></path>
|
||||
<path fill="#ED8A19" d="M0 28H28V56H0z"></path>
|
||||
<path fill="#556080" d="M28 28H56V56H28z"></path>
|
||||
<path
|
||||
fill='#FFF'
|
||||
d='M48 46H36a1 1 0 110-2h12a1 1 0 110 2zM48 40H36a1 1 0 110-2h12a1 1 0 110 2zM14 43a.999.999 0 01-.707-1.707l5-5a.999.999 0 111.414 1.414l-5 5A.997.997 0 0114 43z'
|
||||
fill="#FFF"
|
||||
d="M48 46H36a1 1 0 110-2h12a1 1 0 110 2zM48 40H36a1 1 0 110-2h12a1 1 0 110 2zM14 43a.999.999 0 01-.707-1.707l5-5a.999.999 0 111.414 1.414l-5 5A.997.997 0 0114 43z"
|
||||
></path>
|
||||
<path
|
||||
fill='#FFF'
|
||||
d='M9 48a.999.999 0 01-.707-1.707l5-5a.999.999 0 111.414 1.414l-5 5A.997.997 0 019 48z'
|
||||
fill="#FFF"
|
||||
d="M9 48a.999.999 0 01-.707-1.707l5-5a.999.999 0 111.414 1.414l-5 5A.997.997 0 019 48z"
|
||||
></path>
|
||||
<path
|
||||
fill='#FFF'
|
||||
d='M19 48a.997.997 0 01-.707-.293l-5-5a.999.999 0 111.414-1.414l5 5A.999.999 0 0119 48z'
|
||||
fill="#FFF"
|
||||
d="M19 48a.997.997 0 01-.707-.293l-5-5a.999.999 0 111.414-1.414l5 5A.999.999 0 0119 48z"
|
||||
></path>
|
||||
<path
|
||||
fill='#FFF'
|
||||
d='M14 43a.997.997 0 01-.707-.293l-5-5a.999.999 0 111.414-1.414l5 5A.999.999 0 0114 43zM20 15H8a1 1 0 110-2h12a1 1 0 110 2z'
|
||||
fill="#FFF"
|
||||
d="M14 43a.997.997 0 01-.707-.293l-5-5a.999.999 0 111.414-1.414l5 5A.999.999 0 0114 43zM20 15H8a1 1 0 110-2h12a1 1 0 110 2z"
|
||||
></path>
|
||||
<path
|
||||
fill='#FFF'
|
||||
d='M14 21a1 1 0 01-1-1V8a1 1 0 112 0v12a1 1 0 01-1 1zM48 15H36a1 1 0 110-2h12a1 1 0 110 2z'
|
||||
fill="#FFF"
|
||||
d="M14 21a1 1 0 01-1-1V8a1 1 0 112 0v12a1 1 0 01-1 1zM48 15H36a1 1 0 110-2h12a1 1 0 110 2z"
|
||||
></path>
|
||||
</svg>
|
||||
</SvgIcon>
|
||||
|
||||
@@ -25,11 +25,11 @@ InjectDebugData([
|
||||
|
||||
const CameraApp = () => {
|
||||
return (
|
||||
<AppWrapper id='camera-app'>
|
||||
<AppWrapper id="camera-app">
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path='/camera' exact component={GalleryGrid} />
|
||||
<Route path='/camera/image' exact component={GalleryModal} />
|
||||
<Route path="/camera" exact component={GalleryGrid} />
|
||||
<Route path="/camera/image" exact component={GalleryModal} />
|
||||
</Switch>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
|
||||
@@ -14,9 +14,7 @@ export const GalleryGrid = () => {
|
||||
const history = useHistory();
|
||||
const query = useQueryParams();
|
||||
|
||||
const referal = query.referal
|
||||
? decodeURIComponent(query.referal)
|
||||
: '/camera/image';
|
||||
const referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image';
|
||||
|
||||
const photos = usePhotos();
|
||||
|
||||
@@ -25,17 +23,15 @@ export const GalleryGrid = () => {
|
||||
};
|
||||
|
||||
const handlePhotoOpen = (photo) => {
|
||||
history.push(
|
||||
addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image)
|
||||
);
|
||||
history.push(addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image));
|
||||
};
|
||||
|
||||
if (!photos)
|
||||
return (
|
||||
<Box
|
||||
display='flex'
|
||||
flexWrap='wrap'
|
||||
alignContent='flex-start'
|
||||
display="flex"
|
||||
flexWrap="wrap"
|
||||
alignContent="flex-start"
|
||||
className={classes.root}
|
||||
>
|
||||
<Box>
|
||||
@@ -44,7 +40,7 @@ export const GalleryGrid = () => {
|
||||
style={{ borderRadius: 0 }}
|
||||
className={classes.photo}
|
||||
>
|
||||
<AddIcon fontSize='large' />
|
||||
<AddIcon fontSize="large" />
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
@@ -53,9 +49,9 @@ export const GalleryGrid = () => {
|
||||
return (
|
||||
<div>
|
||||
<Box
|
||||
display='flex'
|
||||
flexWrap='wrap'
|
||||
alignContent='flex-start'
|
||||
display="flex"
|
||||
flexWrap="wrap"
|
||||
alignContent="flex-start"
|
||||
className={classes.root}
|
||||
>
|
||||
<Box>
|
||||
@@ -64,7 +60,7 @@ export const GalleryGrid = () => {
|
||||
style={{ borderRadius: 0 }}
|
||||
className={classes.photo}
|
||||
>
|
||||
<AddIcon fontSize='large' />
|
||||
<AddIcon fontSize="large" />
|
||||
</Button>
|
||||
</Box>
|
||||
{photos.map((photo) => (
|
||||
|
||||
@@ -20,7 +20,7 @@ export const GalleryModal = () => {
|
||||
|
||||
const meta: ICameraPhoto = useMemo(
|
||||
() => ({ id: query.id as string, image: query.image as string }),
|
||||
[query]
|
||||
[query],
|
||||
);
|
||||
|
||||
const _handleClose = () => {
|
||||
@@ -42,11 +42,7 @@ export const GalleryModal = () => {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ShareModal
|
||||
referal={referal}
|
||||
meta={shareOpen}
|
||||
onClose={() => setShareOpen(null)}
|
||||
/>
|
||||
<ShareModal referal={referal} meta={shareOpen} onClose={() => setShareOpen(null)} />
|
||||
<Paper className={classes.modal}>
|
||||
<div className={shareOpen ? classes.backgroundModal : null} />
|
||||
<Button onClick={_handleClose}>
|
||||
@@ -58,10 +54,10 @@ export const GalleryModal = () => {
|
||||
/>
|
||||
<div className={classes.actionDiv}>
|
||||
<Button onClick={handleDeletePhoto}>
|
||||
<DeleteIcon fontSize='large' />
|
||||
<DeleteIcon fontSize="large" />
|
||||
</Button>
|
||||
<Button onClick={handleSharePhoto}>
|
||||
<ShareIcon fontSize='large' />
|
||||
<ShareIcon fontSize="large" />
|
||||
</Button>
|
||||
</div>
|
||||
</Paper>
|
||||
|
||||
@@ -33,7 +33,7 @@ export const ShareModal = ({ meta, onClose, referal }: IShareModalProps) => {
|
||||
</h4>
|
||||
<Button>{<MessageIcon />} Message</Button>
|
||||
<h4>Or just copy the image here:</h4>
|
||||
<Button onClick={handleCopyImage} variant='contained'>
|
||||
<Button onClick={handleCopyImage} variant="contained">
|
||||
Copy image
|
||||
</Button>
|
||||
</>
|
||||
|
||||
@@ -15,11 +15,11 @@ export const ContactsApp = () => {
|
||||
|
||||
return (
|
||||
<ContactsThemeProvider>
|
||||
<AppWrapper id='contact-app'>
|
||||
<AppWrapper id="contact-app">
|
||||
<AppTitle app={contacts} />
|
||||
<AppContent>
|
||||
<Route path='/contacts/' exact component={ContactPage} />
|
||||
<Route path='/contacts/:id' exact component={ContactsInfoPage} />
|
||||
<Route path="/contacts/" exact component={ContactPage} />
|
||||
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
</ContactsThemeProvider>
|
||||
|
||||
@@ -56,8 +56,7 @@ export const ContactList = () => {
|
||||
{contacts
|
||||
.filter(
|
||||
(contact) =>
|
||||
contact.display.match(filteredRegEx) ||
|
||||
contact.number.match(filteredRegEx)
|
||||
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
|
||||
)
|
||||
.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
@@ -65,25 +64,17 @@ export const ContactList = () => {
|
||||
{contact.avatar ? (
|
||||
<MuiAvatar src={contact.avatar} />
|
||||
) : (
|
||||
<MuiAvatar>
|
||||
{contact.display.slice(0, 1).toUpperCase()}
|
||||
</MuiAvatar>
|
||||
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
|
||||
)}
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary={contact.display}
|
||||
secondary={contact.number}
|
||||
/>
|
||||
<ListItemText primary={contact.display} secondary={contact.number} />
|
||||
<Button onClick={() => startCall(contact.number)}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button onClick={() => handleMessage(contact.number)}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
<Button
|
||||
style={{ margin: -15 }}
|
||||
onClick={() => openContactInfo(contact.id)}
|
||||
>
|
||||
<Button style={{ margin: -15 }} onClick={() => openContactInfo(contact.id)}>
|
||||
<MoreVertIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
|
||||
@@ -53,7 +53,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
export const SearchContacts = () => {
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Avatar as MuiAvatar,
|
||||
Box,
|
||||
Button,
|
||||
Paper,
|
||||
TextField,
|
||||
} from '@material-ui/core';
|
||||
import { Avatar as MuiAvatar, Box, Button, Paper, TextField } from '@material-ui/core';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory, useParams } from 'react-router-dom';
|
||||
@@ -123,7 +117,7 @@ const ContactsInfoPage = () => {
|
||||
return (
|
||||
<Paper className={classes.root} square>
|
||||
<Button style={{ margin: 10 }} onClick={() => history.goBack()}>
|
||||
<ArrowBackIcon fontSize='large' />
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
</Button>
|
||||
<div className={classes.listContainer}>
|
||||
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||
@@ -161,21 +155,13 @@ const ContactsInfoPage = () => {
|
||||
{/* Display if fetched contact */}
|
||||
{contact && (
|
||||
<>
|
||||
<Box py={1} display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactSave}
|
||||
>
|
||||
<Box py={1} display="block">
|
||||
<Button color="primary" variant="contained" onClick={handleContactSave}>
|
||||
{t('GENERIC_UPDATE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box py={1} display='block'>
|
||||
<Button
|
||||
variant='contained'
|
||||
color='secondary'
|
||||
onClick={handleContactDelete}
|
||||
>
|
||||
<Box py={1} display="block">
|
||||
<Button variant="contained" color="secondary" onClick={handleContactDelete}>
|
||||
{t('GENERIC_DELETE')}
|
||||
</Button>
|
||||
</Box>
|
||||
@@ -183,12 +169,8 @@ const ContactsInfoPage = () => {
|
||||
)}
|
||||
{/* Display if no fetched contact */}
|
||||
{!contact && (
|
||||
<Box display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactAdd}
|
||||
>
|
||||
<Box display="block">
|
||||
<Button color="primary" variant="contained" onClick={handleContactAdd}>
|
||||
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -26,7 +26,7 @@ export const ContactPage = () => {
|
||||
<>
|
||||
<ContactList />
|
||||
<Fab
|
||||
color='primary'
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
|
||||
@@ -17,7 +17,7 @@ export const useContacts = (): IUseContacts => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.display : number;
|
||||
},
|
||||
[contacts]
|
||||
[contacts],
|
||||
);
|
||||
const getContact = useCallback(
|
||||
(id: number): Contact | null => {
|
||||
@@ -25,7 +25,7 @@ export const useContacts = (): IUseContacts => {
|
||||
if (contact.id === id) return contact;
|
||||
}
|
||||
},
|
||||
[contacts]
|
||||
[contacts],
|
||||
);
|
||||
return { contacts, getDisplayByNumber, getContact };
|
||||
};
|
||||
@@ -8,7 +8,7 @@ interface FilterdContactsProps {
|
||||
|
||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||
const [filteredContacts, setFilteredContacts] = useRecoilState(
|
||||
contactsState.filterContacts
|
||||
contactsState.filterContacts,
|
||||
);
|
||||
return { filteredContacts, setFilteredContacts };
|
||||
};
|
||||
@@ -19,12 +19,7 @@ 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>
|
||||
@@ -35,8 +30,8 @@ export const DialGrid = () => {
|
||||
const { add, removeOne, clear } = useContext(DialInputCtx);
|
||||
|
||||
return (
|
||||
<Box height='100%'>
|
||||
<Grid container justify='space-around'>
|
||||
<Box height="100%">
|
||||
<Grid container justify="space-around">
|
||||
<ButtonItem label={1} onClick={() => add(1)} />
|
||||
<ButtonItem label={2} onClick={() => add(2)} />
|
||||
<ButtonItem label={3} onClick={() => add(3)} />
|
||||
@@ -46,10 +41,10 @@ export const DialGrid = () => {
|
||||
<ButtonItem label={7} onClick={() => add(7)} />
|
||||
<ButtonItem label={8} onClick={() => add(8)} />
|
||||
<ButtonItem label={9} onClick={() => add(9)} />
|
||||
<ButtonItem label='*' onClick={clear} />
|
||||
<ButtonItem label="*" onClick={clear} />
|
||||
<ButtonItem label={0} onClick={() => add(0)} />
|
||||
<ButtonItem label='#' onClick={removeOne} />
|
||||
<ButtonItem label='-' onClick={() => add('-')} />
|
||||
<ButtonItem label="#" onClick={removeOne} />
|
||||
<ButtonItem label="-" onClick={() => add('-')} />
|
||||
</Grid>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -22,13 +22,13 @@ export const DialerApp = () => {
|
||||
<AppTitle app={dialer} />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path='/phone/dial'>
|
||||
<Route path="/phone/dial">
|
||||
<DialPage />
|
||||
</Route>
|
||||
<Route exact path='/phone'>
|
||||
<Route exact path="/phone">
|
||||
<DialerHistory calls={history} />
|
||||
</Route>
|
||||
<Route path='/phone/contacts' component={ContactList}></Route>
|
||||
<Route path="/phone/contacts" component={ContactList}></Route>
|
||||
</Switch>
|
||||
</AppContent>
|
||||
<DialerNavBar />
|
||||
|
||||
@@ -45,18 +45,15 @@ export const DialerInput = () => {
|
||||
return (
|
||||
<Box component={Paper} className={classes.root}>
|
||||
<InputBase
|
||||
placeholder='Enter a number'
|
||||
placeholder="Enter a number"
|
||||
className={classes.input}
|
||||
value={inputVal}
|
||||
/>
|
||||
<IconButton color='primary' className={classes.iconBtn}>
|
||||
<PhoneIcon fontSize='large' onClick={() => handleCall(inputVal)} />
|
||||
<IconButton color="primary" className={classes.iconBtn}>
|
||||
<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>
|
||||
);
|
||||
|
||||
@@ -33,27 +33,27 @@ const DialerNavBar = () => {
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction
|
||||
label='History'
|
||||
value='/phone'
|
||||
label="History"
|
||||
value="/phone"
|
||||
component={NavLink}
|
||||
icon={<HistoryIcon />}
|
||||
to='/phone'
|
||||
to="/phone"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label='Dial'
|
||||
value='/phone/dial'
|
||||
color='secondary'
|
||||
label="Dial"
|
||||
value="/phone/dial"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
icon={<PhoneIcon />}
|
||||
to='/phone/dial'
|
||||
to="/phone/dial"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label='Contacts'
|
||||
value='/phone/contacts'
|
||||
color='secondary'
|
||||
label="Contacts"
|
||||
value="/phone/contacts"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
icon={<PersonIcon />}
|
||||
to='/phone/contacts'
|
||||
to="/phone/contacts"
|
||||
/>
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
@@ -42,15 +42,10 @@ export const DialerHistory = ({ calls }) => {
|
||||
|
||||
if (!calls?.length) {
|
||||
return (
|
||||
<Box
|
||||
display='flex'
|
||||
justifyContent='center'
|
||||
alignItems='center'
|
||||
paddingTop={35}
|
||||
>
|
||||
<Box display="flex" justifyContent="center" alignItems="center" paddingTop={35}>
|
||||
<p>
|
||||
You got no friends!
|
||||
<span role='img' aria-label='deal with it'>
|
||||
<span role="img" aria-label="deal with it">
|
||||
😎
|
||||
</span>
|
||||
</p>
|
||||
@@ -79,7 +74,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
history.push(
|
||||
`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`
|
||||
`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`,
|
||||
)
|
||||
}
|
||||
>
|
||||
@@ -105,7 +100,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
history.push(
|
||||
`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`
|
||||
`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`,
|
||||
)
|
||||
}
|
||||
>
|
||||
@@ -113,7 +108,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
</IconButton>
|
||||
) : null}
|
||||
</ListItem>
|
||||
)
|
||||
),
|
||||
)}
|
||||
</List>
|
||||
);
|
||||
|
||||
@@ -32,7 +32,7 @@ export const ExampleApp = () => {
|
||||
<AppTitle app={example} />
|
||||
<AppContent>
|
||||
<h1>This is an example</h1>
|
||||
<Button color='primary'>{example.id}</Button>
|
||||
<Button color="primary">{example.id}</Button>
|
||||
{/* Here we are using the value in a h3 tag */}
|
||||
<h3>{exampleString}</h3>
|
||||
<IconButton onClick={() => (playing ? stop() : play())}>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -22,17 +22,14 @@ export const MessagesApp = () => {
|
||||
|
||||
return (
|
||||
<MessagesThemeProvider>
|
||||
<AppWrapper id='messages-app'>
|
||||
<AppWrapper id="messages-app">
|
||||
<AppTitle app={messages} />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route
|
||||
path='/messages/conversations/:groupId'
|
||||
component={MessageModal}
|
||||
/>
|
||||
<Route path="/messages/conversations/:groupId" component={MessageModal} />
|
||||
<Route
|
||||
exact
|
||||
path='/messages'
|
||||
path="/messages"
|
||||
render={() => (
|
||||
<>
|
||||
<MessagesList />
|
||||
|
||||
@@ -34,9 +34,9 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
if (!messageGroupId) return null;
|
||||
|
||||
return (
|
||||
<Paper variant='outlined' className={classes.root}>
|
||||
<Paper variant="outlined" className={classes.root}>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Box display='flex'>
|
||||
<Box display="flex">
|
||||
<Box pl={1} flexGrow={1}>
|
||||
<TextField
|
||||
fullWidth
|
||||
@@ -51,7 +51,7 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
<Button onClick={onAddImageClick}>
|
||||
<ImageIcon />
|
||||
</Button>
|
||||
<Button type='submit'>
|
||||
<Button type="submit">
|
||||
<SendIcon />
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -15,13 +15,11 @@ interface INewMessageGroupButtonProps {
|
||||
onClick(): void;
|
||||
}
|
||||
|
||||
export function NewMessageGroupButton({
|
||||
onClick,
|
||||
}: INewMessageGroupButtonProps) {
|
||||
export function NewMessageGroupButton({ onClick }: INewMessageGroupButtonProps) {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<Fab className={classes.root} color='primary' onClick={onClick}>
|
||||
<Fab className={classes.root} color="primary" onClick={onClick}>
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
);
|
||||
|
||||
@@ -33,7 +33,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
// external characters out of them:
|
||||
// 123-4567, 987-6543, 333-4444
|
||||
const phoneNumbers = participants.map(({ number }) =>
|
||||
number.replace(/[^0-9]/g, '')
|
||||
number.replace(/[^0-9]/g, ''),
|
||||
);
|
||||
const labelValue = isGroupChat ? label.trim() : null;
|
||||
|
||||
@@ -46,7 +46,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
history.push('/messages');
|
||||
}
|
||||
},
|
||||
[history, label, participants, isGroupChat]
|
||||
[history, label, participants, isGroupChat],
|
||||
);
|
||||
|
||||
const onAutocompleteChange = useCallback((_e, value: any) => {
|
||||
@@ -71,7 +71,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
}}
|
||||
/>
|
||||
),
|
||||
[t]
|
||||
[t],
|
||||
);
|
||||
|
||||
const submitDisabled = !participants.length || (isGroupChat && !label);
|
||||
@@ -103,10 +103,10 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
<Box px={2} py={3}>
|
||||
<Button
|
||||
disabled={submitDisabled}
|
||||
variant='contained'
|
||||
variant="contained"
|
||||
fullWidth
|
||||
color='primary'
|
||||
type='submit'
|
||||
color="primary"
|
||||
type="submit"
|
||||
>
|
||||
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
|
||||
</Button>
|
||||
|
||||
@@ -24,9 +24,7 @@ const MessageGroupItem = ({ messageGroup, handleClick }: IProps): any => {
|
||||
<ListItemAvatar>
|
||||
<MuiAvatar src={messageGroup?.avatar} />
|
||||
</ListItemAvatar>
|
||||
<ListItemText>
|
||||
{messageGroup.label || messageGroup.groupDisplay}
|
||||
</ListItemText>
|
||||
<ListItemText>{messageGroup.label || messageGroup.groupDisplay}</ListItemText>
|
||||
</ListItem>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@ import useStyles from './list.styles';
|
||||
interface IProps {
|
||||
value: string;
|
||||
handleChange: (
|
||||
event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>
|
||||
event: React.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>,
|
||||
) => void;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ const MessageSearch = ({ value, handleChange }: IProps) => {
|
||||
const { t } = useTranslation();
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper elevation={24} variant='outlined' className={classes.bg}>
|
||||
<Paper elevation={24} variant="outlined" className={classes.bg}>
|
||||
<div className={classes.search}>
|
||||
<div className={classes.searchIcon}>
|
||||
<SearchIcon />
|
||||
|
||||
@@ -24,17 +24,15 @@ const MessagesList = (): any => {
|
||||
const goToConversation = useCallback(
|
||||
(messageGroup) =>
|
||||
history.push(
|
||||
`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(
|
||||
messageGroup
|
||||
)}`
|
||||
`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`,
|
||||
),
|
||||
[history]
|
||||
[history],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (createMessageGroupResult?.groupId) {
|
||||
const findGroup = messageGroups.find(
|
||||
(g) => g.groupId === createMessageGroupResult.groupId
|
||||
(g) => g.groupId === createMessageGroupResult.groupId,
|
||||
);
|
||||
clearMessageGroupResult();
|
||||
if (findGroup) {
|
||||
@@ -53,9 +51,7 @@ const MessagesList = (): any => {
|
||||
const handleClick = (messageGroup: MessageGroup) => () => {
|
||||
Nui.send('phone:fetchMessages', { groupId: messageGroup.groupId });
|
||||
history.push(
|
||||
`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(
|
||||
messageGroup
|
||||
)}`
|
||||
`/messages/conversations/${messageGroup.groupId}/?${qs.stringify(messageGroup)}`,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ const Conversation = ({ activeMessageGroup, messages }: IProps) => {
|
||||
/>
|
||||
<Box
|
||||
id={CONVERSATION_ELEMENT_ID}
|
||||
height='90%'
|
||||
display='flex'
|
||||
flexDirection='column'
|
||||
height="90%"
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
pb={4}
|
||||
className={classes.overflowAutoY}
|
||||
>
|
||||
|
||||
@@ -51,23 +51,20 @@ export const MessageBubble = ({
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<div>
|
||||
<Paper
|
||||
className={message.isMine ? classes.mySms : classes.sms}
|
||||
variant='outlined'
|
||||
>
|
||||
<Paper className={message.isMine ? classes.mySms : classes.sms} variant="outlined">
|
||||
<Box>
|
||||
{isImage(message.message) ? (
|
||||
<img
|
||||
src={message.message}
|
||||
className={classes.imageMessage}
|
||||
alt='multimedia'
|
||||
alt="multimedia"
|
||||
/>
|
||||
) : (
|
||||
<div>{message.message}</div>
|
||||
)}
|
||||
</Box>
|
||||
<Box>
|
||||
<Typography variant='subtitle1' color='secondary'>
|
||||
<Typography variant="subtitle1" color="secondary">
|
||||
{isGroupChat && !message.isMine
|
||||
? message.display || message.phone_number
|
||||
: null}
|
||||
|
||||
@@ -14,10 +14,10 @@ const MessageGroupModal = () => {
|
||||
const params = useParams<{ phoneNumber?: string }>();
|
||||
|
||||
return (
|
||||
<Slide direction='left' in>
|
||||
<Slide direction="left" in>
|
||||
<Paper className={classes.modalRoot}>
|
||||
<Button onClick={handleClose}>
|
||||
<ArrowBackIcon fontSize='large' />
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
</Button>
|
||||
<NewMessageGroupForm phoneNumber={params.phoneNumber} />
|
||||
</Paper>
|
||||
|
||||
@@ -18,12 +18,7 @@ interface IProps {
|
||||
image?: string;
|
||||
}
|
||||
|
||||
export const MessageImageModal = ({
|
||||
isOpen,
|
||||
messageGroupId,
|
||||
onClose,
|
||||
image,
|
||||
}: IProps) => {
|
||||
export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IProps) => {
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const { pathname, search } = useLocation();
|
||||
@@ -45,7 +40,7 @@ export const MessageImageModal = ({
|
||||
});
|
||||
onClose();
|
||||
},
|
||||
[messageGroupId, onClose]
|
||||
[messageGroupId, onClose],
|
||||
);
|
||||
|
||||
const sendFromQueryParam = useCallback(
|
||||
@@ -53,7 +48,7 @@ export const MessageImageModal = ({
|
||||
sendImageMessage(image);
|
||||
removeQueryParamImage();
|
||||
},
|
||||
[removeQueryParamImage, sendImageMessage]
|
||||
[removeQueryParamImage, sendImageMessage],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -81,20 +76,17 @@ export const MessageImageModal = ({
|
||||
history.push(
|
||||
`/camera?${qs.stringify({
|
||||
referal: encodeURIComponent(pathname + search),
|
||||
})}`
|
||||
})}`,
|
||||
),
|
||||
},
|
||||
],
|
||||
[history, pathname, search]
|
||||
[history, pathname, search],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ContextMenu open={isOpen} options={menuOptions} onClose={onClose} />
|
||||
<Modal
|
||||
visible={queryParamImagePreview}
|
||||
handleClose={removeQueryParamImage}
|
||||
>
|
||||
<Modal visible={queryParamImagePreview} handleClose={removeQueryParamImage}>
|
||||
<Box py={1}>
|
||||
<Typography paragraph>Do you want to share this image?</Typography>
|
||||
<PictureResponsive
|
||||
@@ -103,8 +95,8 @@ export const MessageImageModal = ({
|
||||
/>
|
||||
<Button
|
||||
fullWidth
|
||||
variant='contained'
|
||||
color='primary'
|
||||
variant="contained"
|
||||
color="primary"
|
||||
onClick={() => sendFromQueryParam(queryParamImagePreview)}
|
||||
>
|
||||
Share
|
||||
@@ -114,7 +106,7 @@ export const MessageImageModal = ({
|
||||
<Modal visible={pasteVisible} handleClose={() => setPasteVisible(false)}>
|
||||
<Box p={1}>
|
||||
<TextField
|
||||
placeholder='A link to your image or gif'
|
||||
placeholder="A link to your image or gif"
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
value={message}
|
||||
fullWidth
|
||||
|
||||
@@ -81,26 +81,21 @@ export const MessageModal = () => {
|
||||
: header;
|
||||
|
||||
const headerClass =
|
||||
header.length > LARGE_HEADER_CHARS
|
||||
? classes.largeGroupDisplay
|
||||
: classes.groupdisplay;
|
||||
header.length > LARGE_HEADER_CHARS ? classes.largeGroupDisplay : classes.groupdisplay;
|
||||
|
||||
return (
|
||||
<Slide direction='left' in={!!activeMessageGroup}>
|
||||
<Slide direction="left" in={!!activeMessageGroup}>
|
||||
<Paper className={classes.modalRoot}>
|
||||
<Paper className={classes.topContainer}>
|
||||
<Button onClick={closeModal}>
|
||||
<ArrowBackIcon fontSize='large' />
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
</Button>
|
||||
<Typography variant='h5' className={headerClass}>
|
||||
<Typography variant="h5" className={headerClass}>
|
||||
{header}
|
||||
</Typography>
|
||||
</Paper>
|
||||
{hasLoaded ? (
|
||||
<Conversation
|
||||
messages={messages}
|
||||
activeMessageGroup={activeMessageGroup}
|
||||
/>
|
||||
<Conversation messages={messages} activeMessageGroup={activeMessageGroup} />
|
||||
) : (
|
||||
<MessageSkeletonList />
|
||||
)}
|
||||
|
||||
@@ -18,12 +18,7 @@ export default function MessageSkeleton({ height, isMine = false }) {
|
||||
const marginLeft = isMine ? '60px' : '8px';
|
||||
return (
|
||||
<div className={classes.root} style={{ marginLeft, height: `${height}px` }}>
|
||||
<Skeleton
|
||||
className={classes.skeleton}
|
||||
variant='text'
|
||||
width={325}
|
||||
height={height}
|
||||
/>
|
||||
<Skeleton className={classes.skeleton} variant="text" width={325} height={height} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -7,21 +7,13 @@ export const useMessagesService = () => {
|
||||
const setMessageGroups = useSetRecoilState(messageState.messageGroups);
|
||||
const setMessages = useSetRecoilState(messageState.messages);
|
||||
const setCreateMessageGroupResult = useSetRecoilState(
|
||||
messageState.createMessageGroupResult
|
||||
messageState.createMessageGroupResult,
|
||||
);
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
useNuiEvent('MESSAGES', 'phone:fetchMessageGroupsSuccess', setMessageGroups);
|
||||
useNuiEvent('MESSAGES', 'phone:fetchMessagesSuccess', setMessages);
|
||||
useNuiEvent(
|
||||
'MESSAGES',
|
||||
'phone:createMessageGroupSuccess',
|
||||
setCreateMessageGroupResult
|
||||
);
|
||||
useNuiEvent(
|
||||
'MESSAGES',
|
||||
'phone:createMessageGroupFailed',
|
||||
setCreateMessageGroupResult
|
||||
);
|
||||
useNuiEvent('MESSAGES', 'phone:createMessageGroupSuccess', setCreateMessageGroupResult);
|
||||
useNuiEvent('MESSAGES', 'phone:createMessageGroupFailed', setCreateMessageGroupResult);
|
||||
useNuiEvent('MESSAGES', 'phone:setMessagesAlert', addAlert);
|
||||
};
|
||||
@@ -15,18 +15,14 @@ interface IUseMessages {
|
||||
}
|
||||
|
||||
export default (): IUseMessages => {
|
||||
const [messages, setMessages] = useRecoilState<Message[] | null>(
|
||||
messageState.messages
|
||||
);
|
||||
const messageGroups = useRecoilValue<MessageGroup[] | null>(
|
||||
messageState.messageGroups
|
||||
);
|
||||
const [messages, setMessages] = useRecoilState<Message[] | null>(messageState.messages);
|
||||
const messageGroups = useRecoilValue<MessageGroup[] | null>(messageState.messageGroups);
|
||||
|
||||
const [
|
||||
createMessageGroupResult,
|
||||
setCreateMessageGroupResult,
|
||||
] = useRecoilState<CreateMessageGroupResult | null>(
|
||||
messageState.createMessageGroupResult
|
||||
messageState.createMessageGroupResult,
|
||||
);
|
||||
|
||||
const clearMessageGroupResult = () => setCreateMessageGroupResult(null);
|
||||
|
||||
@@ -26,16 +26,12 @@ export const NotesApp = () => {
|
||||
|
||||
return (
|
||||
<NotesThemeProvider>
|
||||
<AppWrapper id='notes-app'>
|
||||
<AppWrapper id="notes-app">
|
||||
<AppTitle app={notesApp} />
|
||||
<Route path='/notes/detail' component={NoteModal} />
|
||||
<Route path="/notes/detail" component={NoteModal} />
|
||||
<AppContent>
|
||||
<Route path='/notes' component={NoteList} />
|
||||
<Fab
|
||||
className={classes.absolute}
|
||||
onClick={onClickCreate}
|
||||
color='primary'
|
||||
>
|
||||
<Route path="/notes" component={NoteList} />
|
||||
<Fab className={classes.absolute} onClick={onClickCreate} color="primary">
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</AppContent>
|
||||
|
||||
@@ -23,8 +23,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
const NotesTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper elevation={24} square variant='outlined' className={classes.header}>
|
||||
<FontAwesomeIcon icon={faStickyNote} className={classes.icon} size='lg' />
|
||||
<Paper elevation={24} square variant="outlined" className={classes.header}>
|
||||
<FontAwesomeIcon icon={faStickyNote} className={classes.icon} size="lg" />
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -19,12 +19,7 @@ const NoteList = () => {
|
||||
return (
|
||||
<List disablePadding>
|
||||
{notes.map((note) => (
|
||||
<ListItem
|
||||
key={note.id}
|
||||
button
|
||||
divider
|
||||
onClick={() => handleNoteModal(note)}
|
||||
>
|
||||
<ListItem key={note.id} button divider onClick={() => handleNoteModal(note)}>
|
||||
<ListItemText>{note.title}</ListItemText>
|
||||
</ListItem>
|
||||
))}
|
||||
|
||||
@@ -52,7 +52,7 @@ export const NoteModal = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Slide direction='left' in={!!detail}>
|
||||
<Slide direction="left" in={!!detail}>
|
||||
<Paper className={classes.modalRoot}>
|
||||
{!detail ? (
|
||||
<CircularProgress />
|
||||
@@ -61,9 +61,9 @@ export const NoteModal = () => {
|
||||
<Box>
|
||||
<Box py={2}>
|
||||
<Button
|
||||
color='primary'
|
||||
size='large'
|
||||
startIcon={<ArrowBackIcon fontSize='large' />}
|
||||
color="primary"
|
||||
size="large"
|
||||
startIcon={<ArrowBackIcon fontSize="large" />}
|
||||
onClick={_handleClose}
|
||||
>
|
||||
{t('APPS_NOTES')}
|
||||
@@ -79,9 +79,7 @@ export const NoteModal = () => {
|
||||
}}
|
||||
fullWidth
|
||||
value={detail.title}
|
||||
onChange={(e) =>
|
||||
setDetail((d) => ({ ...d, title: e.target.value }))
|
||||
}
|
||||
onChange={(e) => setDetail((d) => ({ ...d, title: e.target.value }))}
|
||||
/>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
@@ -93,29 +91,27 @@ export const NoteModal = () => {
|
||||
multiline
|
||||
fullWidth
|
||||
rows={16}
|
||||
variant='outlined'
|
||||
variant="outlined"
|
||||
value={detail.content}
|
||||
onChange={(e) =>
|
||||
setDetail((d) => ({ ...d, content: e.target.value }))
|
||||
}
|
||||
onChange={(e) => setDetail((d) => ({ ...d, content: e.target.value }))}
|
||||
/>
|
||||
<Typography paragraph>{detail.content.length}/250</Typography>
|
||||
{!detail.id ? (
|
||||
<>
|
||||
<Box display='inline' p={1}>
|
||||
<Box display="inline" p={1}>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
color="primary"
|
||||
variant="contained"
|
||||
disabled={detail.title.length > 0 ? false : true}
|
||||
onClick={handleNoteSave}
|
||||
>
|
||||
{t('GENERIC_SAVE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box display='inline' p={1}>
|
||||
<Box display="inline" p={1}>
|
||||
<StatusButton
|
||||
color='error'
|
||||
variant='contained'
|
||||
color="error"
|
||||
variant="contained"
|
||||
onClick={_handleClose}
|
||||
>
|
||||
{t('GENERIC_CANCEL')}
|
||||
@@ -124,19 +120,19 @@ export const NoteModal = () => {
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Box display='inline' p={1}>
|
||||
<Box display="inline" p={1}>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
color="primary"
|
||||
variant="contained"
|
||||
onClick={handleUpdateNote}
|
||||
>
|
||||
{t('GENERIC_UPDATE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box display='inline' p={1}>
|
||||
<Box display="inline" p={1}>
|
||||
<StatusButton
|
||||
color='error'
|
||||
variant='contained'
|
||||
color="error"
|
||||
variant="contained"
|
||||
onClick={handleDeleteNote}
|
||||
>
|
||||
{t('GENERIC_DELETE')}
|
||||
|
||||
@@ -12,12 +12,12 @@ import { SelloutThemeProvider } from '../providers/SelloutThemeProvider';
|
||||
export const SelloutApp = () => {
|
||||
return (
|
||||
<SelloutThemeProvider>
|
||||
<AppWrapper id='sellout-app'>
|
||||
<AppWrapper id="sellout-app">
|
||||
<SelloutTitle />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path='/sellout' exact component={SelloutListContainer} />
|
||||
<Route path='/sellout/new' component={ListingFormContainer} />
|
||||
<Route path="/sellout" exact component={SelloutListContainer} />
|
||||
<Route path="/sellout/new" component={ListingFormContainer} />
|
||||
</Switch>
|
||||
</AppContent>
|
||||
<NavigationBar />
|
||||
|
||||
@@ -51,7 +51,7 @@ export const SelloutItem = (listing) => {
|
||||
<div className={classes.content}>
|
||||
<Paper elevation={2} className={classes.paper}>
|
||||
<div className={classes.header}>
|
||||
<Typography className={classes.headerTypo} variant='h5'>
|
||||
<Typography className={classes.headerTypo} variant="h5">
|
||||
{listing.name}
|
||||
</Typography>
|
||||
<Typography
|
||||
@@ -60,24 +60,21 @@ export const SelloutItem = (listing) => {
|
||||
>
|
||||
{listing.number}
|
||||
</Typography>
|
||||
<Typography variant='h5' style={{ padding: 5 }}>
|
||||
<Typography variant="h5" style={{ padding: 5 }}>
|
||||
{listing.title}
|
||||
</Typography>
|
||||
</div>
|
||||
{listing.url ? (
|
||||
<PictureResponsive
|
||||
src={listing.url}
|
||||
alt={`${listing.name} image`}
|
||||
/>
|
||||
<PictureResponsive src={listing.url} alt={`${listing.name} image`} />
|
||||
) : (
|
||||
<Typography style={{ margin: 10 }}>
|
||||
No image provided{' '}
|
||||
<span role='img' aria-label='emoji'>
|
||||
<span role="img" aria-label="emoji">
|
||||
🙁
|
||||
</span>
|
||||
</Typography>
|
||||
)}
|
||||
<Typography variant='h6' className={classes.desc}>
|
||||
<Typography variant="h6" className={classes.desc}>
|
||||
{listing.description}
|
||||
</Typography>
|
||||
<div>
|
||||
|
||||
@@ -23,7 +23,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
export const SelloutTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||
<FontAwesomeIcon icon={faAd} className={classes.icon} />
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@@ -47,32 +47,32 @@ export const ListingForm = () => {
|
||||
<TextField
|
||||
className={classes.input}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
placeholder='Title on listing..'
|
||||
placeholder="Title on listing.."
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: '80%' }}
|
||||
size='medium'
|
||||
size="medium"
|
||||
/>
|
||||
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder='Image URL'
|
||||
placeholder="Image URL"
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: '80%' }}
|
||||
size='medium'
|
||||
variant='outlined'
|
||||
size="medium"
|
||||
variant="outlined"
|
||||
/>
|
||||
|
||||
<TextField
|
||||
className={classes.input}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
placeholder='Description'
|
||||
placeholder="Description"
|
||||
inputProps={{ className: classes.multilineFieldInput }}
|
||||
style={{ width: '80%' }}
|
||||
size='medium'
|
||||
size="medium"
|
||||
multiline
|
||||
rows={4}
|
||||
variant='outlined'
|
||||
variant="outlined"
|
||||
/>
|
||||
|
||||
<Button onClick={addListing} className={classes.postButton}>
|
||||
|
||||
@@ -31,12 +31,12 @@ export const NavigationBar = () => {
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to='/sellout'
|
||||
to="/sellout"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<AddCircleIcon />}
|
||||
to='/sellout/new'
|
||||
to="/sellout/new"
|
||||
/>
|
||||
</BottomNavigation>
|
||||
);
|
||||
|
||||
@@ -9,13 +9,7 @@ interface IProps {
|
||||
icon: JSX.Element;
|
||||
}
|
||||
|
||||
export const SettingItem = ({
|
||||
options,
|
||||
label,
|
||||
value,
|
||||
onClick,
|
||||
icon,
|
||||
}: IProps) => {
|
||||
export const SettingItem = ({ options, label, value, onClick, icon }: IProps) => {
|
||||
return (
|
||||
<ListItem divider onClick={() => onClick?.(options)} button>
|
||||
<ListItemIcon>{icon}</ListItemIcon>
|
||||
|
||||
@@ -2,10 +2,7 @@ import React, { useEffect, useState } from 'react';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import {
|
||||
useContextMenu,
|
||||
MapStringOptions,
|
||||
} from '../../../ui/hooks/useContextMenu';
|
||||
import { useContextMenu, MapStringOptions } from '../../../ui/hooks/useContextMenu';
|
||||
import { useConfig } from '../../../config/hooks/useConfig';
|
||||
import { List } from '../../../ui/components/List';
|
||||
import { useSimcard } from '../../../os/simcard/hooks/useSimcard';
|
||||
@@ -36,7 +33,7 @@ import { useRecoilState } from 'recoil';
|
||||
import { settingsState } from '../hooks/useSettings';
|
||||
|
||||
const SubHeaderComp = (props: { text: string }) => (
|
||||
<ListSubheader color='primary' component='div' disableSticky>
|
||||
<ListSubheader color="primary" component="div" disableSticky>
|
||||
{props.text}
|
||||
</ListSubheader>
|
||||
);
|
||||
@@ -64,11 +61,7 @@ export const SettingsApp = () => {
|
||||
}
|
||||
return curr;
|
||||
});
|
||||
}, [
|
||||
settings.notificationVol,
|
||||
settings.ringtoneVol,
|
||||
settings.TWITTER_notificationVol,
|
||||
]);
|
||||
}, [settings.notificationVol, settings.ringtoneVol, settings.TWITTER_notificationVol]);
|
||||
|
||||
const handleSliderChange = (idx) => (_e: any, value: number | number[]) => {
|
||||
setSliders((curr) => {
|
||||
@@ -82,39 +75,33 @@ export const SettingsApp = () => {
|
||||
|
||||
const wallpapers = config.wallpapers.map(
|
||||
MapStringOptions(settings.wallpaper, (val: string) =>
|
||||
handleSettingChange('wallpaper', val)
|
||||
)
|
||||
handleSettingChange('wallpaper', val),
|
||||
),
|
||||
);
|
||||
const frames = config.frames.map(
|
||||
MapStringOptions(settings.frame, (val: string) =>
|
||||
handleSettingChange('frame', val)
|
||||
)
|
||||
MapStringOptions(settings.frame, (val: string) => handleSettingChange('frame', val)),
|
||||
);
|
||||
const themes = Object.keys(config.themes).map(
|
||||
MapStringOptions(settings.theme, (val: string) =>
|
||||
handleSettingChange('theme', val)
|
||||
)
|
||||
MapStringOptions(settings.theme, (val: string) => handleSettingChange('theme', val)),
|
||||
);
|
||||
const zoomOptions = config.zoomOptions.map(
|
||||
MapStringOptions(settings.zoom, (val: string) =>
|
||||
handleSettingChange('zoom', val)
|
||||
)
|
||||
MapStringOptions(settings.zoom, (val: string) => handleSettingChange('zoom', val)),
|
||||
);
|
||||
const ringtones = config.ringtones.map(
|
||||
MapStringOptions(settings.ringtone, (val: string) =>
|
||||
handleSettingChange('ringtone', val)
|
||||
)
|
||||
handleSettingChange('ringtone', val),
|
||||
),
|
||||
);
|
||||
const notifications = config.notifications.map(
|
||||
MapStringOptions(settings.notification, (val: string) =>
|
||||
handleSettingChange('notification', val)
|
||||
)
|
||||
handleSettingChange('notification', val),
|
||||
),
|
||||
);
|
||||
|
||||
const twitterNotifications = config.notifications.map(
|
||||
MapStringOptions(settings.notification, (val: string) =>
|
||||
handleSettingChange('TWITTER_notification', val)
|
||||
)
|
||||
handleSettingChange('TWITTER_notification', val),
|
||||
),
|
||||
);
|
||||
|
||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||
@@ -122,7 +109,7 @@ export const SettingsApp = () => {
|
||||
<AppWrapper>
|
||||
<AppTitle app={settingsApp} />
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List disablePadding subheader={<SubHeaderComp text='Phone' />}>
|
||||
<List disablePadding subheader={<SubHeaderComp text="Phone" />}>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_PHONE_NUMBER')}
|
||||
value={simcard.number}
|
||||
@@ -150,9 +137,7 @@ export const SettingsApp = () => {
|
||||
min={0}
|
||||
max={100}
|
||||
onChange={handleSliderChange(0)}
|
||||
onChangeCommitted={() =>
|
||||
handleSettingChange('ringtoneVol', sliders[0])
|
||||
}
|
||||
onChangeCommitted={() => handleSettingChange('ringtoneVol', sliders[0])}
|
||||
/>
|
||||
</Box>
|
||||
</ListItemSecondaryAction>
|
||||
@@ -187,7 +172,7 @@ export const SettingsApp = () => {
|
||||
</ListItemSecondaryAction>
|
||||
</ListItem>
|
||||
</List>
|
||||
<List disablePadding subheader={<SubHeaderComp text='Appearance' />}>
|
||||
<List disablePadding subheader={<SubHeaderComp text="Appearance" />}>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_THEME')}
|
||||
value={settings.theme}
|
||||
@@ -217,10 +202,7 @@ export const SettingsApp = () => {
|
||||
icon={<ZoomIn />}
|
||||
/>
|
||||
</List>
|
||||
<List
|
||||
disablePadding
|
||||
subheader={<SubHeaderComp text={t('APPS_TWITTER')} />}
|
||||
>
|
||||
<List disablePadding subheader={<SubHeaderComp text={t('APPS_TWITTER')} />}>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_NOTIFICATION')}
|
||||
value={settings.TWITTER_notification}
|
||||
|
||||
@@ -86,9 +86,7 @@ export const AddTweetModal = () => {
|
||||
|
||||
const handleimageChange = useCallback((link) => setLink(link), []);
|
||||
|
||||
const handleMessageChange = useCallback((message) => setMessage(message), [
|
||||
setMessage,
|
||||
]);
|
||||
const handleMessageChange = useCallback((message) => setMessage(message), [setMessage]);
|
||||
|
||||
useEffect(() => {
|
||||
window.addEventListener('keydown', _handleEscape, true);
|
||||
@@ -138,8 +136,7 @@ export const AddTweetModal = () => {
|
||||
setShowImagePrompt(false);
|
||||
setLink('');
|
||||
};
|
||||
const removeImage = (id) =>
|
||||
setImages(images.filter((image) => id !== image.id));
|
||||
const removeImage = (id) => setImages(images.filter((image) => id !== image.id));
|
||||
|
||||
const toggleShowImagePrompt = () => {
|
||||
setShowEmoji(false); // clear the emoji so we can switch between emoji/images
|
||||
@@ -180,9 +177,7 @@ export const AddTweetModal = () => {
|
||||
<div className={classes.buttonsContainer}>
|
||||
<IconButtons
|
||||
onImageClick={
|
||||
images.length < config.twitter.maxImages
|
||||
? toggleShowImagePrompt
|
||||
: null
|
||||
images.length < config.twitter.maxImages ? toggleShowImagePrompt : null
|
||||
}
|
||||
onEmojiClick={toggleShowEmoji}
|
||||
/>
|
||||
|
||||
@@ -30,14 +30,14 @@ function Avatar({ avatarUrl, showInvalidImage, height, width }) {
|
||||
<img
|
||||
className={classes.img}
|
||||
src={showInvalidImage ? IMG_INVALID_AVATAR : IMG_DEFAULT_AVATAR}
|
||||
alt='Invalid avatar'
|
||||
alt="Invalid avatar"
|
||||
style={{ height, width }}
|
||||
/>
|
||||
)}
|
||||
<img
|
||||
className={classes.img}
|
||||
src={avatarUrl || IMG_DEFAULT_AVATAR}
|
||||
alt='Your profile avatar'
|
||||
alt="Your profile avatar"
|
||||
onError={handleImageError}
|
||||
onLoad={handleImageLoad}
|
||||
style={{ display: showImageError ? 'none' : 'block', height, width }}
|
||||
|
||||
@@ -16,24 +16,16 @@ export function TwitterBottomNavigation({ activePage, handleChange }) {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<BottomNavigation
|
||||
value={activePage}
|
||||
onChange={handleChange}
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigation value={activePage} onChange={handleChange} className={classes.root}>
|
||||
<BottomNavigationAction component={Link} to="/twitter" icon={<HomeIcon />} />
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
to='/twitter'
|
||||
icon={<HomeIcon />}
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
to='/twitter/search'
|
||||
to="/twitter/search"
|
||||
icon={<SearchIcon />}
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
to='/twitter/profile'
|
||||
to="/twitter/profile"
|
||||
icon={<ProfileIcon />}
|
||||
/>
|
||||
</BottomNavigation>
|
||||
|
||||
@@ -4,14 +4,7 @@ import { Picker } from 'emoji-mart';
|
||||
export const EmojiSelect = ({ visible, onEmojiClick }) => {
|
||||
if (!visible) return null;
|
||||
|
||||
return (
|
||||
<Picker
|
||||
onClick={onEmojiClick}
|
||||
set='google'
|
||||
theme='dark'
|
||||
showPreview={false}
|
||||
/>
|
||||
);
|
||||
return <Picker onClick={onEmojiClick} set="google" theme="dark" showPreview={false} />;
|
||||
};
|
||||
|
||||
export default memo(EmojiSelect); // The picker is an expensive render
|
||||
@@ -67,7 +67,7 @@ export const TwitterApp = () => {
|
||||
const showTweetButton = !promptProfileName && activePage === 0;
|
||||
|
||||
return (
|
||||
<AppWrapper id='twitter-app'>
|
||||
<AppWrapper id="twitter-app">
|
||||
<AddTweetModal />
|
||||
<div className={modalVisible ? classes.backgroundModal : undefined} />
|
||||
<TwitterTitle />
|
||||
@@ -76,18 +76,15 @@ export const TwitterApp = () => {
|
||||
<ProfilePrompt />
|
||||
) : (
|
||||
<Switch>
|
||||
<Route path='/twitter' exact component={TweetListContainer} />
|
||||
<Route path='/twitter/search' component={TwitterSearch} />
|
||||
<Route path='/twitter/profile' component={TwitterProfile} />
|
||||
<Route path="/twitter" exact component={TweetListContainer} />
|
||||
<Route path="/twitter/search" component={TwitterSearch} />
|
||||
<Route path="/twitter/profile" component={TwitterProfile} />
|
||||
</Switch>
|
||||
)}
|
||||
</AppContent>
|
||||
{showTweetButton && <TweetButton openModal={openModal} />}
|
||||
{!promptProfileName && (
|
||||
<BottomNavigation
|
||||
activePage={activePage}
|
||||
handleChange={handlePageChange}
|
||||
/>
|
||||
<BottomNavigation activePage={activePage} handleChange={handlePageChange} />
|
||||
)}
|
||||
</AppWrapper>
|
||||
);
|
||||
@@ -191,5 +188,5 @@ InjectDebugData(
|
||||
},
|
||||
},
|
||||
],
|
||||
3000
|
||||
3000,
|
||||
);
|
||||
@@ -47,7 +47,7 @@ function TwitterSearch() {
|
||||
label={t('APPS_TWITTER_SEARCH_TWEETS')}
|
||||
value={searchValue}
|
||||
onChange={handleChange}
|
||||
size='medium'
|
||||
size="medium"
|
||||
inputRef={(input) => input && input.focus()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
export function TwitterTitle() {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper elevation={24} variant='outlined' square className={classes.root}>
|
||||
<Paper elevation={24} variant="outlined" square className={classes.root}>
|
||||
<TwitterIcon className={classes.icon} />
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@@ -33,14 +33,14 @@ export const ControlButtons = ({
|
||||
|
||||
return (
|
||||
<div className={classes.buttons}>
|
||||
<Button variant='contained' color='primary' onClick={onPrimaryClick}>
|
||||
<Button variant="contained" color="primary" onClick={onPrimaryClick}>
|
||||
{primaryButtonText}
|
||||
</Button>
|
||||
{showCloseButton && (
|
||||
<Button
|
||||
className={classes.close}
|
||||
variant='contained'
|
||||
color='secondary'
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
onClick={onCloseClick}
|
||||
>
|
||||
{t('APPS_TWITTER_CLOSE_IMAGE')}
|
||||
|
||||
@@ -29,12 +29,12 @@ export const IconButtons = ({ onImageClick, onEmojiClick }) => {
|
||||
<div className={classes.buttons}>
|
||||
{enableImages && (
|
||||
<Button className={classes.button} onClick={onImageClick}>
|
||||
<InsertPhotoIcon color='action' />
|
||||
<InsertPhotoIcon color="action" />
|
||||
</Button>
|
||||
)}
|
||||
{enableEmojis && (
|
||||
<Button className={classes.button} onClick={onEmojiClick}>
|
||||
<EmojiIcon color='action' />
|
||||
<EmojiIcon color="action" />
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ export function ProfileUpdateButton({ handleClick }) {
|
||||
<div className={classes.root}>
|
||||
<Fab
|
||||
className={classes.button}
|
||||
color='primary'
|
||||
color="primary"
|
||||
onClick={handleClick}
|
||||
disabled={isLoading}
|
||||
>
|
||||
|
||||
@@ -32,7 +32,7 @@ function ReportButton({ handleClose, tweetId, isReported }) {
|
||||
if (loading) {
|
||||
return (
|
||||
<Button disabled>
|
||||
<CircularProgress id='twitter-report-progress' size={22} />
|
||||
<CircularProgress id="twitter-report-progress" size={22} />
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function ProfileUpdateButton({ handleClick }) {
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Fab className={classes.button} color='primary' onClick={handleClick}>
|
||||
<Fab className={classes.button} color="primary" onClick={handleClick}>
|
||||
<SearchIcon />
|
||||
</Fab>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@ export function TweetButton({ openModal }) {
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Fab className={classes.button} color='primary' onClick={openModal}>
|
||||
<Fab className={classes.button} color="primary" onClick={openModal}>
|
||||
<CreateIcon />
|
||||
</Fab>
|
||||
</div>
|
||||
|
||||
@@ -41,16 +41,12 @@ export const Image = ({ link, handleClick, small }) => {
|
||||
return (
|
||||
<div className={classes.imageContainer}>
|
||||
{handleClick && (
|
||||
<IconButton
|
||||
className={classes.imgButton}
|
||||
onClick={handleClick}
|
||||
size='small'
|
||||
>
|
||||
<IconButton className={classes.imgButton} onClick={handleClick} size="small">
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
)}
|
||||
<img
|
||||
alt='small avatar'
|
||||
alt="small avatar"
|
||||
className={small ? classes.imgSmall : classes.img}
|
||||
src={link}
|
||||
/>
|
||||
|
||||
@@ -35,7 +35,7 @@ export const ImagePrompt = ({ visible, value, handleChange }) => {
|
||||
className={classes.textField}
|
||||
onChange={handleImageChange}
|
||||
multiline
|
||||
size='small'
|
||||
size="small"
|
||||
placeholder={t('APPS_TWITTER_IMAGE_PLACEHOLDER')}
|
||||
inputRef={textFieldRef}
|
||||
/>
|
||||
|
||||
@@ -12,14 +12,7 @@ const useStyles = makeStyles({
|
||||
},
|
||||
});
|
||||
|
||||
function ProfileField({
|
||||
label,
|
||||
value,
|
||||
handleChange,
|
||||
allowChange,
|
||||
multiline,
|
||||
inputRef,
|
||||
}) {
|
||||
function ProfileField({ label, value, handleChange, allowChange, multiline, inputRef }) {
|
||||
const classes = useStyles();
|
||||
const _handleChange = (e) => handleChange(e.target.value);
|
||||
|
||||
|
||||
@@ -58,20 +58,15 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
|
||||
// if the user cannot perform any actions in show more then don't
|
||||
// allow them to interact with it
|
||||
let _handleClick =
|
||||
allowedToDelete || allowedToReport ? handleClick : () => null;
|
||||
let _handleClick = allowedToDelete || allowedToReport ? handleClick : () => null;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Button
|
||||
aria-controls='simple-menu'
|
||||
aria-haspopup='true'
|
||||
onClick={_handleClick}
|
||||
>
|
||||
<Button aria-controls="simple-menu" aria-haspopup="true" onClick={_handleClick}>
|
||||
<MoreIcon />
|
||||
</Button>
|
||||
<Menu
|
||||
id='simple-menu'
|
||||
id="simple-menu"
|
||||
anchorEl={anchorEl}
|
||||
keepMounted
|
||||
open={Boolean(anchorEl)}
|
||||
@@ -82,16 +77,10 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
}}
|
||||
>
|
||||
{allowedToDelete && (
|
||||
<MenuItem onClick={handleDeleteTweet}>
|
||||
{t('APPS_TWITTER_DELETE')}
|
||||
</MenuItem>
|
||||
<MenuItem onClick={handleDeleteTweet}>{t('APPS_TWITTER_DELETE')}</MenuItem>
|
||||
)}
|
||||
{allowedToReport && (
|
||||
<ReportButton
|
||||
handleClose={handleClose}
|
||||
isReported={isReported}
|
||||
tweetId={id}
|
||||
/>
|
||||
<ReportButton handleClose={handleClose} isReported={isReported} tweetId={id} />
|
||||
)}
|
||||
</Menu>
|
||||
</>
|
||||
|
||||
@@ -98,7 +98,7 @@ export const Tweet = (tweet) => {
|
||||
{enableAvatars && (
|
||||
<ListItemAvatar>
|
||||
<MuiAvatar>
|
||||
<Avatar avatarUrl={avatar_url} height='40px' width='40px' />
|
||||
<Avatar avatarUrl={avatar_url} height="40px" width="40px" />
|
||||
</MuiAvatar>
|
||||
</ListItemAvatar>
|
||||
)}
|
||||
@@ -107,9 +107,9 @@ export const Tweet = (tweet) => {
|
||||
<div className={classes.profile}>{profileName}</div>
|
||||
<Typography
|
||||
className={classes.date}
|
||||
component='div'
|
||||
variant='body2'
|
||||
color='textSecondary'
|
||||
component="div"
|
||||
variant="body2"
|
||||
color="textSecondary"
|
||||
>
|
||||
{secondsToHumanReadable(t, seconds_since_tweet)}
|
||||
</Typography>
|
||||
|
||||
@@ -43,7 +43,7 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => {
|
||||
textFieldRef.current.scrollTop = textFieldRef.current.scrollHeight;
|
||||
handleChange(e.target.value);
|
||||
},
|
||||
[handleChange]
|
||||
[handleChange],
|
||||
);
|
||||
|
||||
if (!config) return null;
|
||||
@@ -52,12 +52,12 @@ export const TweetMessage = ({ modalVisible, message, handleChange }) => {
|
||||
|
||||
const overCharacterLimit = message.trim().length > characterLimit;
|
||||
const characterWarningPrompt = `${t(
|
||||
'APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT'
|
||||
'APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT',
|
||||
)} (${characterLimit})`;
|
||||
|
||||
const overNewLineLimit = getNewLineCount(message) > newLineLimit;
|
||||
const newLineWarningPrompt = `${t(
|
||||
'APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT'
|
||||
'APPS_TWITTER_TWEET_MESSAGE_NEW_LINE_LIMIT',
|
||||
)} (${newLineLimit})`;
|
||||
|
||||
if (overCharacterLimit) {
|
||||
|
||||
@@ -25,11 +25,11 @@ export default function TweetSkeleton() {
|
||||
<>
|
||||
<div className={classes.root}>
|
||||
<div className={classes.left}>
|
||||
<Skeleton variant='circle' width={60} height={60} />
|
||||
<Skeleton variant="circle" width={60} height={60} />
|
||||
</div>
|
||||
<div className={classes.right}>
|
||||
<Skeleton variant='text' />
|
||||
<Skeleton variant='rect' width={250} height={118} />
|
||||
<Skeleton variant="text" />
|
||||
<Skeleton variant="rect" width={250} height={118} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import { twitterState } from './state';
|
||||
|
||||
export const useModal = () => {
|
||||
const [modalVisible, setModalVisible] = useRecoilState(
|
||||
twitterState.showCreateTweetModal
|
||||
twitterState.showCreateTweetModal,
|
||||
);
|
||||
const [message, setMessage] = useRecoilState(twitterState.modalMessage);
|
||||
return { modalVisible, setModalVisible, message, setMessage };
|
||||
|
||||
@@ -18,11 +18,9 @@ interface IUseProfile {
|
||||
|
||||
export const useProfile = (): IUseProfile => {
|
||||
const profile = useRecoilValue(twitterState.profile);
|
||||
const updateProfileLoading = useRecoilValue(
|
||||
twitterState.updateProfileLoading
|
||||
);
|
||||
const updateProfileLoading = useRecoilValue(twitterState.updateProfileLoading);
|
||||
const [updateProfileSuccessful, setUpdateProfileSuccessful] = useRecoilState(
|
||||
twitterState.updateProfileSuccess
|
||||
twitterState.updateProfileSuccess,
|
||||
);
|
||||
return {
|
||||
profile,
|
||||
|
||||
@@ -5,7 +5,7 @@ import { twitterState } from './state';
|
||||
export const useTweetStatus = () => {
|
||||
const createTweetLoading = useRecoilValue(twitterState.createTweetLoading);
|
||||
const [createTweetSuccessful, setCreateTweetSuccessful] = useRecoilState(
|
||||
twitterState.createTweetSuccessful
|
||||
twitterState.createTweetSuccessful,
|
||||
);
|
||||
return {
|
||||
createTweetLoading,
|
||||
|
||||
@@ -14,9 +14,7 @@ export const useTwitterNotifications = () => {
|
||||
|
||||
const { icon, notificationIcon } = useApp('TWITTER');
|
||||
|
||||
const [unreadCount, setUnreadCount] = useRecoilState(
|
||||
twitterState.unreadTweetsCount
|
||||
);
|
||||
const [unreadCount, setUnreadCount] = useRecoilState(twitterState.unreadTweetsCount);
|
||||
|
||||
const setNotification = useCallback(
|
||||
({ profile_name, message }) => {
|
||||
@@ -38,12 +36,12 @@ export const useTwitterNotifications = () => {
|
||||
count: unread,
|
||||
}),
|
||||
content: null,
|
||||
}
|
||||
},
|
||||
);
|
||||
return unread;
|
||||
});
|
||||
},
|
||||
[setUnreadCount, addNotificationAlert, t, icon, notificationIcon, history]
|
||||
[setUnreadCount, addNotificationAlert, t, icon, notificationIcon, history],
|
||||
);
|
||||
|
||||
return { setNotification, setUnreadCount, unreadCount };
|
||||
|
||||
@@ -34,9 +34,7 @@ export const useTwitterService = () => {
|
||||
const { setNotification } = useTwitterNotifications();
|
||||
|
||||
const setProfile = useSetRecoilState(twitterState.profile);
|
||||
const setUpdateProfileLoading = useSetRecoilState(
|
||||
twitterState.updateProfileLoading
|
||||
);
|
||||
const setUpdateProfileLoading = useSetRecoilState(twitterState.updateProfileLoading);
|
||||
|
||||
const setTweets = useSetRecoilState(twitterState.tweets);
|
||||
const setFilteredTweets = useSetRecoilState(twitterState.filteredTweets);
|
||||
|
||||
@@ -14,7 +14,7 @@ const DAYS = 'APPS_TWITTER_TIME_DAYS';
|
||||
*/
|
||||
export function secondsToHumanReadable(
|
||||
t: (input: string) => string,
|
||||
seconds: number
|
||||
seconds: number,
|
||||
): string {
|
||||
if (seconds < 60) {
|
||||
return t(JUST_NOW);
|
||||
|
||||
@@ -10,9 +10,7 @@ import { useLocation } from 'react-router-dom';
|
||||
*
|
||||
* const { id, title } = useQueryParams<{ id: string, title: string }>();
|
||||
*/
|
||||
export function useQueryParams<T = Record<string, string>>(
|
||||
defaultValues: T = null
|
||||
) {
|
||||
export function useQueryParams<T = Record<string, string>>(defaultValues: T = null) {
|
||||
const query = qs.parse(useLocation().search, { ignoreQueryPrefix: true });
|
||||
if (!defaultValues) {
|
||||
return query as T & Partial<ParsedQs>;
|
||||
|
||||
@@ -9,7 +9,7 @@ interface IRouterLocation {
|
||||
export const addQueryToLocation = (
|
||||
{ pathname = '', search = '' }: Record<string, unknown> & IRouterLocation,
|
||||
key = '',
|
||||
value = ''
|
||||
value = '',
|
||||
) => {
|
||||
const { query } = url(pathname + search);
|
||||
return `${pathname}?${qs.stringify({
|
||||
|
||||
@@ -8,7 +8,7 @@ interface IRouterLocation {
|
||||
|
||||
export const deleteQueryFromLocation = (
|
||||
location: Record<string, unknown> & IRouterLocation,
|
||||
key = ''
|
||||
key = '',
|
||||
) => {
|
||||
const { query } = url(location.pathname + location.search);
|
||||
return `${location.pathname}/?${qs.stringify({
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
{
|
||||
"cellProvider": "AT&T",
|
||||
"language": "en",
|
||||
"wallpapers": [
|
||||
"beach.jpg",
|
||||
"minimal.jpg",
|
||||
"surf.jpg",
|
||||
"waves.jpg",
|
||||
"projecterror.jpg"
|
||||
],
|
||||
"wallpapers": ["beach.jpg", "minimal.jpg", "surf.jpg", "waves.jpg", "projecterror.jpg"],
|
||||
"defaultSettings": {
|
||||
"wallpaper": "projecterror.jpg",
|
||||
"frame": "default.png",
|
||||
|
||||
+2
-3
@@ -12,8 +12,7 @@ import { PhoneContainer } from './PhoneContainer';
|
||||
// Enable Sentry when config setting is true
|
||||
if (PhoneConfig.SentryErrorMetrics) {
|
||||
Sentry.init({
|
||||
dsn:
|
||||
'https://[email protected]/5581619',
|
||||
dsn: 'https://[email protected]/5581619',
|
||||
autoSessionTracking: true,
|
||||
integrations: [new Integrations.BrowserTracing()],
|
||||
// We recommend adjusting this value in production, or using tracesSampler
|
||||
@@ -28,5 +27,5 @@ ReactDOM.render(
|
||||
<PhoneContainer />
|
||||
</RecoilRoot>
|
||||
</HashRouter>,
|
||||
document.getElementById('root')
|
||||
document.getElementById('root'),
|
||||
);
|
||||
+3
-5
@@ -1,7 +1,6 @@
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
||||
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
||||
sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu',
|
||||
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
font-size: 20px;
|
||||
@@ -13,8 +12,7 @@ body {
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
|
||||
monospace;
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
|
||||
}
|
||||
|
||||
a,
|
||||
|
||||
@@ -65,115 +65,103 @@ export const APPS: IAppConfig[] = [
|
||||
id: 'DIALER',
|
||||
nameLocale: 'APPS_DIALER',
|
||||
icon: <FontAwesomeIcon icon={faPhoneAlt} />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faPhoneAlt} size='xs' />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faPhoneAlt} size="xs" />,
|
||||
backgroundColor: DIALER_APP_PRIMARY_COLOR,
|
||||
color: DIALER_APP_TEXT_COLOR,
|
||||
path: '/phone',
|
||||
Route: () => <AppRoute id='DIALER' path='/phone' component={DialerApp} />,
|
||||
Route: () => <AppRoute id="DIALER" path="/phone" component={DialerApp} />,
|
||||
},
|
||||
{
|
||||
id: 'MESSAGES',
|
||||
nameLocale: 'APPS_MESSAGES',
|
||||
icon: <MessageIcon fontSize='large' />,
|
||||
notificationIcon: <MessageIcon fontSize='small' />,
|
||||
icon: <MessageIcon fontSize="large" />,
|
||||
notificationIcon: <MessageIcon fontSize="small" />,
|
||||
backgroundColor: MESSAGES_APP_PRIMARY_COLOR,
|
||||
color: MESSAGES_APP_TEXT_COLOR,
|
||||
path: '/messages',
|
||||
Route: () => (
|
||||
<AppRoute id='MESSAGE' path='/messages' component={MessagesApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="MESSAGE" path="/messages" component={MessagesApp} />,
|
||||
},
|
||||
{
|
||||
id: 'CONTACTS',
|
||||
nameLocale: 'APPS_CONTACTS',
|
||||
icon: <ContactsIcon fontSize='large' />,
|
||||
notificationIcon: <ContactsIcon fontSize='small' />,
|
||||
icon: <ContactsIcon fontSize="large" />,
|
||||
notificationIcon: <ContactsIcon fontSize="small" />,
|
||||
backgroundColor: CONTACTS_APP_PRIMARY_COLOR,
|
||||
color: CONTACTS_APP_TEXT_COLOR,
|
||||
path: '/contacts',
|
||||
Route: () => (
|
||||
<AppRoute id='CONTACTS' path='/contacts' component={ContactsApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="CONTACTS" path="/contacts" component={ContactsApp} />,
|
||||
},
|
||||
{
|
||||
id: 'CALCULATOR',
|
||||
nameLocale: 'APPS_CALCULATOR',
|
||||
icon: <CalculatorIcon fontSize='large' />,
|
||||
notificationIcon: <CalculatorIcon fontSize='small' />,
|
||||
icon: <CalculatorIcon fontSize="large" />,
|
||||
notificationIcon: <CalculatorIcon fontSize="small" />,
|
||||
backgroundColor: purple[500],
|
||||
color: grey[50],
|
||||
path: '/calculator',
|
||||
Route: () => (
|
||||
<AppRoute id='CALCULATOR' path='/calculator' component={CalculatorApp} />
|
||||
<AppRoute id="CALCULATOR" path="/calculator" component={CalculatorApp} />
|
||||
),
|
||||
},
|
||||
{
|
||||
id: 'SETTINGS',
|
||||
nameLocale: 'APPS_SETTINGS',
|
||||
icon: <SettingsIcon fontSize='large' />,
|
||||
notificationIcon: <SettingsIcon fontSize='small' />,
|
||||
icon: <SettingsIcon fontSize="large" />,
|
||||
notificationIcon: <SettingsIcon fontSize="small" />,
|
||||
backgroundColor: '#383838',
|
||||
color: grey[50],
|
||||
path: '/settings',
|
||||
Route: () => (
|
||||
<AppRoute id='SETTINGS' path='/settings' component={SettingsApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="SETTINGS" path="/settings" component={SettingsApp} />,
|
||||
},
|
||||
{
|
||||
id: 'BANK',
|
||||
nameLocale: 'APPS_BANK',
|
||||
icon: <FontAwesomeIcon icon={faWonSign} />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faWonSign} size='xs' />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faWonSign} size="xs" />,
|
||||
backgroundColor: blue[900],
|
||||
color: common.white,
|
||||
path: '/bank',
|
||||
Route: () => <AppRoute id='BANK' path='/bank' component={BankApp} />,
|
||||
Route: () => <AppRoute id="BANK" path="/bank" component={BankApp} />,
|
||||
},
|
||||
{
|
||||
id: 'TWITTER',
|
||||
nameLocale: 'APPS_TWITTER',
|
||||
icon: <FontAwesomeIcon icon={faTwitter} fixedWidth />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faTwitter} fixedWidth size='xs' />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faTwitter} fixedWidth size="xs" />,
|
||||
backgroundColor: blue[600],
|
||||
color: common.white,
|
||||
path: '/twitter',
|
||||
Route: () => (
|
||||
<AppRoute id='TWITTER' path='/twitter' component={TwitterApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="TWITTER" path="/twitter" component={TwitterApp} />,
|
||||
},
|
||||
{
|
||||
id: 'SELLOUT',
|
||||
nameLocale: 'APPS_SELLOUT',
|
||||
icon: <FontAwesomeIcon icon={faAd} fixedWidth />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faAd} fixedWidth size='xs' />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faAd} fixedWidth size="xs" />,
|
||||
backgroundColor: SELLOUT_APP_PRIMARY_COLOR,
|
||||
color: SELLOUT_APP_ICON_COLOR,
|
||||
path: '/sellout',
|
||||
Route: () => (
|
||||
<AppRoute id='SELLOUT' path='/sellout' component={SelloutApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="SELLOUT" path="/sellout" component={SelloutApp} />,
|
||||
},
|
||||
{
|
||||
id: 'NOTES',
|
||||
nameLocale: 'APPS_NOTES',
|
||||
icon: <FontAwesomeIcon icon={faStickyNote} fixedWidth />,
|
||||
notificationIcon: (
|
||||
<FontAwesomeIcon icon={faStickyNote} fixedWidth size='xs' />
|
||||
),
|
||||
notificationIcon: <FontAwesomeIcon icon={faStickyNote} fixedWidth size="xs" />,
|
||||
backgroundColor: NOTES_APP_PRIMARY_COLOR,
|
||||
color: NOTES_APP_ICON_COLOR,
|
||||
path: '/notes',
|
||||
Route: () => <AppRoute id='NOTES' path='/notes' component={NotesApp} />,
|
||||
Route: () => <AppRoute id="NOTES" path="/notes" component={NotesApp} />,
|
||||
},
|
||||
{
|
||||
id: 'CAMERA',
|
||||
nameLocale: 'APPS_CAMERA',
|
||||
icon: <CameraAltIcon fontSize='large' />,
|
||||
notificationIcon: <CameraAltIcon fontSize='small' />,
|
||||
icon: <CameraAltIcon fontSize="large" />,
|
||||
notificationIcon: <CameraAltIcon fontSize="small" />,
|
||||
backgroundColor: grey['A400'],
|
||||
color: common.white,
|
||||
path: '/camera',
|
||||
Route: () => <AppRoute id='CAMERA' path='/camera' component={CameraApp} />,
|
||||
Route: () => <AppRoute id="CAMERA" path="/camera" component={CameraApp} />,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -182,13 +170,11 @@ if (process.env.NODE_ENV === 'development') {
|
||||
APPS.push({
|
||||
id: 'EXAMPLE',
|
||||
nameLocale: 'APPS_EXAMPLE',
|
||||
icon: <FontAwesomeIcon icon={faPlaneArrival} size='sm' />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faPlaneArrival} size='xs' />,
|
||||
icon: <FontAwesomeIcon icon={faPlaneArrival} size="sm" />,
|
||||
notificationIcon: <FontAwesomeIcon icon={faPlaneArrival} size="xs" />,
|
||||
backgroundColor: blue[500],
|
||||
color: blue[50],
|
||||
path: '/example',
|
||||
Route: () => (
|
||||
<AppRoute id='EXAMPLE' path='/example' component={ExampleApp} />
|
||||
),
|
||||
Route: () => <AppRoute id="EXAMPLE" path="/example" component={ExampleApp} />,
|
||||
});
|
||||
}
|
||||
@@ -10,11 +10,11 @@ export const useApps = () => {
|
||||
...a,
|
||||
notification: icons.find((i) => i.key === a.id),
|
||||
})),
|
||||
[icons]
|
||||
[icons],
|
||||
);
|
||||
const getApp = useCallback(
|
||||
(id: string): IAppConfig => apps.find((a) => a.id === id) || null,
|
||||
[apps]
|
||||
[apps],
|
||||
);
|
||||
return { apps, getApp };
|
||||
};
|
||||
|
||||
@@ -50,24 +50,20 @@ export const CallControls = ({ size }: { size?: 'small' | 'medium' }) => {
|
||||
|
||||
if (accepted || isTransmitter) {
|
||||
return (
|
||||
<StatusIconButton color='error' size={size} onClick={handleEndCall}>
|
||||
<StatusIconButton color="error" size={size} onClick={handleEndCall}>
|
||||
<CallEndIcon />
|
||||
</StatusIconButton>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<Box m={SIZES_SPACING[size] || 1} display='inline'>
|
||||
<StatusIconButton color='error' size={size} onClick={handleRejectCall}>
|
||||
<Box m={SIZES_SPACING[size] || 1} display="inline">
|
||||
<StatusIconButton color="error" size={size} onClick={handleRejectCall}>
|
||||
<CallEndIcon className={classes.icon} />
|
||||
</StatusIconButton>
|
||||
</Box>
|
||||
<Box m={SIZES_SPACING[size] || 1} display='inline'>
|
||||
<StatusIconButton
|
||||
color='success'
|
||||
size={size}
|
||||
onClick={handleAcceptCall}
|
||||
>
|
||||
<Box m={SIZES_SPACING[size] || 1} display="inline">
|
||||
<StatusIconButton color="success" size={size} onClick={handleAcceptCall}>
|
||||
<CallIcon className={classes.icon} />
|
||||
</StatusIconButton>
|
||||
</Box>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -18,17 +18,13 @@ const useStyles = makeStyles((theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const CallNotification = ({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) => {
|
||||
export const CallNotification = ({ children }: { children: React.ReactNode }) => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<Box>{children}</Box>
|
||||
<Box className={classes.controls}>
|
||||
<CallControls size='small' />
|
||||
<CallControls size="small" />
|
||||
</Box>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -12,11 +12,7 @@ const NOTIFICATION_ID = 'call:current';
|
||||
export const useCallNotifications = () => {
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
const {
|
||||
addNotificationAlert,
|
||||
removeId,
|
||||
addNotification,
|
||||
} = useNotifications();
|
||||
const { addNotificationAlert, removeId, addNotification } = useNotifications();
|
||||
|
||||
const { play, stop } = useRingtoneSound();
|
||||
|
||||
@@ -69,7 +65,7 @@ export const useCallNotifications = () => {
|
||||
</CallNotification>
|
||||
),
|
||||
},
|
||||
true
|
||||
true,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,10 +5,9 @@ import { callerState } from './state';
|
||||
export const useDuration = () => {
|
||||
const [duration, setDuration] = useRecoilState(callerState.callDuration);
|
||||
|
||||
const resetDuration = useCallback(
|
||||
() => setDuration({ ms: 0, s: 0, m: 0, h: 0 }),
|
||||
[setDuration]
|
||||
);
|
||||
const resetDuration = useCallback(() => setDuration({ ms: 0, s: 0, m: 0, h: 0 }), [
|
||||
setDuration,
|
||||
]);
|
||||
|
||||
return { duration, setDuration, resetDuration };
|
||||
};
|
||||
Loaded 100 of 157 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user