mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
cleanup(bank): general cleanup for bank
This commit is contained in:
1 parent
319e5efac5
commit
eb506f0ab0
13 files changed
+265
-368
No files matched your search
@@ -1,45 +1,45 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
import { makeStyles, Paper, Typography } from '@material-ui/core';
|
||||||
import { BankTitle } from "./BankTitle";
|
import { BankTitle } from './BankTitle';
|
||||||
import { AppWrapper } from "../../../ui/components";
|
import { AppWrapper } from '../../../ui/components';
|
||||||
import { AppContent } from "../../../ui/components/AppContent";
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
import { Button } from "../../../ui/components/Button";
|
import { Button } from '../../../ui/components/Button';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useTransactions } from "../hooks/useTransactions";
|
import { useTransactions } from '../hooks/useTransactions';
|
||||||
import "./BankApp.css";
|
import './BankApp.css';
|
||||||
import { TransferModal } from "./transfers/TransferModal";
|
import { TransferModal } from './transfers/TransferModal';
|
||||||
|
|
||||||
import { useBankModal } from "../hooks/useBankModal";
|
import { useBankModal } from '../hooks/useBankModal';
|
||||||
import { useCredentials } from "../hooks/useCredentials";
|
import { useCredentials } from '../hooks/useCredentials';
|
||||||
|
|
||||||
import { Switch, Route } from "react-router-dom";
|
import { Switch, Route } from 'react-router-dom';
|
||||||
|
|
||||||
// image
|
// image
|
||||||
import CreditCard from '../img/credit-card.png'
|
import CreditCard from '../img/credit-card.png';
|
||||||
import { NavigationBar } from "./navigation/NavigationBar";
|
import { NavigationBar } from './navigation/NavigationBar';
|
||||||
|
|
||||||
import { BankHome } from './home/BankHome';
|
import { BankHome } from './home/BankHome';
|
||||||
import { BankAccount } from './account/BankAccount';
|
import { BankAccount } from './account/BankAccount';
|
||||||
import { TransactionList } from "./transactions/TransactionList";
|
import { TransactionList } from './transactions/TransactionList';
|
||||||
import { BankAlert } from "./alert/BankAlert";
|
import { BankAlert } from './alert/BankAlert';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
height: "90px",
|
height: '90px',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
backgroundColor: "#fb8c00",
|
backgroundColor: '#fb8c00',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
fontFamily: "'Bebas Neue', cursive",
|
fontFamily: "'Bebas Neue', cursive",
|
||||||
textAlign: "center",
|
textAlign: 'center',
|
||||||
fontSize: 50,
|
fontSize: 50,
|
||||||
},
|
},
|
||||||
backgroundModal: {
|
backgroundModal: {
|
||||||
background: "black",
|
background: 'black',
|
||||||
opacity: "0.6",
|
opacity: '0.6',
|
||||||
position: "absolute",
|
position: 'absolute',
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
@@ -58,15 +58,15 @@ export const BankApp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppWrapper id="bank-app">
|
<AppWrapper id='bank-app'>
|
||||||
<BankTitle />
|
<BankTitle />
|
||||||
<TransferModal />
|
<TransferModal />
|
||||||
<div className={showBankModal ? classes.backgroundModal : undefined} />
|
<div className={showBankModal ? classes.backgroundModal : undefined} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/bank" exact component={BankHome} />
|
<Route path='/bank' exact component={BankHome} />
|
||||||
<Route path="/bank/account" exact component={BankAccount} />
|
<Route path='/bank/account' exact component={BankAccount} />
|
||||||
<Route path="/bank/transactions" exact component={TransactionList} />
|
<Route path='/bank/transactions' exact component={TransactionList} />
|
||||||
</Switch>
|
</Switch>
|
||||||
<BankAlert />
|
<BankAlert />
|
||||||
</AppContent>
|
</AppContent>
|
||||||
|
|||||||
@@ -1,32 +1,33 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import Paper from "@material-ui/core/Paper";
|
import Paper from '@material-ui/core/Paper';
|
||||||
import { Typography ,makeStyles } from "@material-ui/core";
|
import { Typography, makeStyles } from '@material-ui/core';
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
|
|
||||||
import './BankApp.css'
|
import './BankApp.css';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
height: "90px",
|
height: '90px',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
margin: 0,
|
margin: 0,
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
background: "#424242",
|
background: '#424242',
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
color: "#f44336",
|
color: '#f44336',
|
||||||
fontSize: 40,
|
fontSize: 40,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
||||||
export const BankTitle = () => {
|
export const BankTitle = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||||
<Typography id="bank-title" style={{ margin: 0}} variant="h4">WhoDis Banking</Typography>
|
<Typography id='bank-title' style={{ margin: 0 }} variant='h4'>
|
||||||
|
WhoDis Banking
|
||||||
|
</Typography>
|
||||||
</Paper>
|
</Paper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,67 +1,8 @@
|
|||||||
import React from "react";
|
import React from 'react';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import { makeStyles, Paper, Typography, Button } from "@material-ui/core";
|
import { makeStyles, Paper, Typography, Button } from '@material-ui/core';
|
||||||
import { useTransactions } from "../../hooks/useTransactions";
|
import { useTransactions } from '../../hooks/useTransactions';
|
||||||
import { red } from "@material-ui/core/colors";
|
import useStyles from './account.styles';
|
||||||
const useStyles = makeStyles((theme) => ({
|
|
||||||
root: {
|
|
||||||
width: "100%",
|
|
||||||
},
|
|
||||||
header: {
|
|
||||||
width: "90%",
|
|
||||||
display: "flex",
|
|
||||||
justifyItems: "center",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
margin: "auto",
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
padding: 7,
|
|
||||||
borderRadius: "10px",
|
|
||||||
display: "flex",
|
|
||||||
justifyItems: "center",
|
|
||||||
justifyContent: "center",
|
|
||||||
fontSize: "24px",
|
|
||||||
},
|
|
||||||
seeAll: {
|
|
||||||
fontFamily: "Bahnschrift Regular",
|
|
||||||
fontWeight: "bold",
|
|
||||||
height: 'auto'
|
|
||||||
},
|
|
||||||
transcationDiv: {
|
|
||||||
marginTop: '-30px',
|
|
||||||
},
|
|
||||||
transactions: {
|
|
||||||
marginLeft: "32px",
|
|
||||||
display: "flex",
|
|
||||||
justifyContent: "space-between",
|
|
||||||
borderBottom: "2px solid #707070",
|
|
||||||
width: "85%",
|
|
||||||
margin: "auto",
|
|
||||||
},
|
|
||||||
tranSource: {
|
|
||||||
fontSize: "22px",
|
|
||||||
},
|
|
||||||
tranType: {
|
|
||||||
fontSize: "18px",
|
|
||||||
fontWeight: "bold",
|
|
||||||
color: "#BFBFBF",
|
|
||||||
marginTop: "-18px",
|
|
||||||
width: "100%",
|
|
||||||
},
|
|
||||||
|
|
||||||
depositType: {
|
|
||||||
color: "#55B452",
|
|
||||||
marginRight: "32px",
|
|
||||||
fontSize: "22px",
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
withdrawType: {
|
|
||||||
color: "#FF5E5E",
|
|
||||||
marginRight: "32px",
|
|
||||||
fontSize: "22px",
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const AccountTransactions = (): any => {
|
export const AccountTransactions = (): any => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
@@ -69,17 +10,17 @@ export const AccountTransactions = (): any => {
|
|||||||
const TransactionTypes = {
|
const TransactionTypes = {
|
||||||
Deposit: classes.depositType,
|
Deposit: classes.depositType,
|
||||||
Withdraw: classes.withdrawType,
|
Withdraw: classes.withdrawType,
|
||||||
Transfer: classes.depositType
|
Transfer: classes.depositType,
|
||||||
};
|
};
|
||||||
|
|
||||||
const { transactionList } = useTransactions();
|
const { transactionList } = useTransactions();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
return (
|
return (
|
||||||
<div id="account-section">
|
<div id='account-section'>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
<h2 className={classes.title}>{t("APPS_BANK_ACCOUNT_TRANSACTIONS")}</h2>
|
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||||
<Button className={classes.seeAll}>
|
<Button className={classes.seeAll}>
|
||||||
{t("APPS_BANK_ACCOUNT_SEE_TRANSACTION")}
|
{t('APPS_BANK_ACCOUNT_SEE_TRANSACTION')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -92,7 +33,7 @@ export const AccountTransactions = (): any => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className={TransactionTypes[transaction.type]}>
|
<p className={TransactionTypes[transaction.type]}>
|
||||||
{transaction.type == "Withdraw" ? "-" : "+"}
|
{transaction.type == 'Withdraw' ? '-' : '+'}
|
||||||
{transaction.amount}
|
{transaction.amount}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react';
|
||||||
import { Button } from "../../../../ui/components/Button";
|
import { Button } from '../../../../ui/components/Button';
|
||||||
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
import { makeStyles, Paper, Typography } from '@material-ui/core';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import { BankCard } from './BankCard';
|
import { BankCard } from './BankCard';
|
||||||
import { AccountTransactions } from './AccountTransactions';
|
import { AccountTransactions } from './AccountTransactions';
|
||||||
import { useCredentials } from '../../hooks/useCredentials';
|
import { useCredentials } from '../../hooks/useCredentials';
|
||||||
@@ -9,13 +9,13 @@ import { useCredentials } from '../../hooks/useCredentials';
|
|||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
fontFamily: 'Bahnschrift Regular'
|
fontFamily: 'Bahnschrift Regular',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
fontSize: '30px',
|
fontSize: '30px',
|
||||||
marginLeft: '29px'
|
marginLeft: '29px',
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
export const BankAccount = () => {
|
export const BankAccount = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
@@ -24,10 +24,14 @@ export const BankAccount = () => {
|
|||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
<div>
|
<div>
|
||||||
<h1 className={classes.title} >{t("APPS_BANK_ACCOUNT_TITLE")}</h1>
|
<h1 className={classes.title}>{t('APPS_BANK_ACCOUNT_TITLE')}</h1>
|
||||||
</div>
|
</div>
|
||||||
<BankCard name={credentials.name} account="Checking" balance={credentials.balance} />
|
<BankCard
|
||||||
|
name={credentials.name}
|
||||||
|
account='Checking'
|
||||||
|
balance={credentials.balance}
|
||||||
|
/>
|
||||||
<AccountTransactions />
|
<AccountTransactions />
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
@@ -1,46 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react';
|
||||||
import { makeStyles, Box, Typography } from "@material-ui/core";
|
import { Box } from '@material-ui/core';
|
||||||
import { shadows } from '@material-ui/system';
|
import useStyles from './card.styles';
|
||||||
|
|
||||||
/*
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
word-wrap: break-word;
|
|
||||||
display: block;
|
|
||||||
line-height: 1em;
|
|
||||||
max-height: 2em; */
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
|
||||||
root: {
|
|
||||||
background: '#388CF8',
|
|
||||||
height: '179px',
|
|
||||||
width: '350px',
|
|
||||||
margin: 'auto',
|
|
||||||
borderRadius: '15px',
|
|
||||||
fontFamily: 'Bahnschrift Regular'
|
|
||||||
},
|
|
||||||
cardName: {
|
|
||||||
margin: 10,
|
|
||||||
paddingTop: 15,
|
|
||||||
fontSize: '24px',
|
|
||||||
},
|
|
||||||
cardAccount: {
|
|
||||||
margin: '10px',
|
|
||||||
marginTop: '10px',
|
|
||||||
color: '#DFDFDF',
|
|
||||||
fontWeight: 'bold',
|
|
||||||
borderBottom: '2px solid #D8D1D1',
|
|
||||||
paddingBottom: 5
|
|
||||||
},
|
|
||||||
balance: {
|
|
||||||
position: "absolute",
|
|
||||||
bottom: '53%',
|
|
||||||
left: '10%'
|
|
||||||
},
|
|
||||||
balanceFont: {
|
|
||||||
fontSize: '29px'
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
|
|
||||||
export const BankCard = (props) => {
|
export const BankCard = (props) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
@@ -51,8 +11,11 @@ export const BankCard = (props) => {
|
|||||||
<p className={classes.cardAccount}>{props.account}</p>
|
<p className={classes.cardAccount}>{props.account}</p>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.balance}>
|
<div className={classes.balance}>
|
||||||
<h3 className={classes.balanceFont}><span style={{ fontSize: '30px'}}>$</span>{props.balance}</h3>
|
<h3 className={classes.balanceFont}>
|
||||||
|
<span style={{ fontSize: '30px' }}>$</span>
|
||||||
|
{props.balance}
|
||||||
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useBankAlert } from "../../hooks/useBankAlert";
|
import { useBankAlert } from '../../hooks/useBankAlert';
|
||||||
import Snackbar from "@material-ui/core/Snackbar";
|
import Snackbar from '@material-ui/core/Snackbar';
|
||||||
import Alert from "./Alert";
|
import Alert from './Alert';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
export const BankAlert = () => {
|
export const BankAlert = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const { bankAlert, setBankAlert } = useBankAlert();
|
const { bankAlert, setBankAlert } = useBankAlert();
|
||||||
const [ message, setMessage ] = useState(null);
|
const [message, setMessage] = useState(null);
|
||||||
const [severity, setSeverity] = useState("");
|
const [severity, setSeverity] = useState('');
|
||||||
|
|
||||||
const _handleClose = () => {
|
const _handleClose = () => {
|
||||||
setOpen(false);
|
setOpen(false);
|
||||||
@@ -17,20 +17,20 @@ export const BankAlert = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (bankAlert === true ) {
|
if (bankAlert === true) {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
setMessage(t("APPS_BANK_ALERT_TRANSFER_SUCCESS"));
|
setMessage(t('APPS_BANK_ALERT_TRANSFER_SUCCESS'));
|
||||||
setSeverity("success")
|
setSeverity('success');
|
||||||
} else if (bankAlert === false) {
|
} else if (bankAlert === false) {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
setMessage(t("APPS_BANK_ALERT_TRANSFER_FAILURE"));
|
setMessage(t('APPS_BANK_ALERT_TRANSFER_FAILURE'));
|
||||||
setSeverity("error")
|
setSeverity('error');
|
||||||
}
|
}
|
||||||
}, [bankAlert])
|
}, [bankAlert]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Snackbar
|
<Snackbar
|
||||||
style={{ width: "80%" }}
|
style={{ width: '80%' }}
|
||||||
open={open}
|
open={open}
|
||||||
autoHideDuration={6000}
|
autoHideDuration={6000}
|
||||||
onClose={_handleClose}
|
onClose={_handleClose}
|
||||||
|
|||||||
@@ -1,85 +1,85 @@
|
|||||||
import { makeStyles } from "@material-ui/core";
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
paper: {
|
paper: {
|
||||||
padding: theme.spacing(1),
|
padding: theme.spacing(1),
|
||||||
textAlign: "center",
|
textAlign: 'center',
|
||||||
width: "50%",
|
width: '50%',
|
||||||
backgroundColor: "#2d3436",
|
backgroundColor: '#2d3436',
|
||||||
margin: 20,
|
margin: 20,
|
||||||
color: "#fff",
|
color: '#fff',
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
color: "#fff",
|
color: '#fff',
|
||||||
},
|
},
|
||||||
cell: {
|
cell: {
|
||||||
color: "#fff",
|
color: '#fff',
|
||||||
},
|
},
|
||||||
container: {
|
container: {
|
||||||
maxHeight: 350,
|
maxHeight: 350,
|
||||||
},
|
},
|
||||||
list: {
|
list: {
|
||||||
marginTop: "8.5em",
|
marginTop: '8.5em',
|
||||||
},
|
},
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
width: "90%",
|
width: '90%',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
justifyItems: "center",
|
justifyItems: 'center',
|
||||||
justifyContent: "space-between",
|
justifyContent: 'space-between',
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
padding: 7,
|
padding: 7,
|
||||||
borderRadius: "10px",
|
borderRadius: '10px',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
justifyItems: "center",
|
justifyItems: 'center',
|
||||||
justifyContent: "center",
|
justifyContent: 'center',
|
||||||
fontSize: "30px",
|
fontSize: '30px',
|
||||||
},
|
},
|
||||||
seeAll: {
|
seeAll: {
|
||||||
fontFamily: "Bahnschrift Regular",
|
fontFamily: 'Bahnschrift Regular',
|
||||||
fontWeight: "bold",
|
fontWeight: 'bold',
|
||||||
height: "auto",
|
height: 'auto',
|
||||||
},
|
},
|
||||||
transcationDiv: {
|
transcationDiv: {
|
||||||
marginTop: "-30px",
|
marginTop: '-30px',
|
||||||
minHeight: 200,
|
minHeight: 200,
|
||||||
maxHeight: 240
|
maxHeight: 240,
|
||||||
},
|
},
|
||||||
transactions: {
|
transactions: {
|
||||||
marginLeft: "32px",
|
marginLeft: '32px',
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
justifyContent: "space-between",
|
justifyContent: 'space-between',
|
||||||
borderBottom: "2px solid #707070",
|
borderBottom: '2px solid #707070',
|
||||||
width: "85%",
|
width: '85%',
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
},
|
},
|
||||||
tranSource: {
|
tranSource: {
|
||||||
fontSize: "22px",
|
fontSize: '22px',
|
||||||
},
|
},
|
||||||
tranType: {
|
tranType: {
|
||||||
fontSize: "18px",
|
fontSize: '18px',
|
||||||
fontWeight: "bold",
|
fontWeight: 'bold',
|
||||||
color: "#BFBFBF",
|
color: '#BFBFBF',
|
||||||
marginTop: "-18px",
|
marginTop: '-18px',
|
||||||
width: "100%",
|
width: '100%',
|
||||||
},
|
},
|
||||||
|
|
||||||
depositType: {
|
depositType: {
|
||||||
color: "#55B452",
|
color: '#55B452',
|
||||||
marginRight: "32px",
|
marginRight: '32px',
|
||||||
fontSize: "22px",
|
fontSize: '22px',
|
||||||
fontWeight: "bold",
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
withdrawType: {
|
withdrawType: {
|
||||||
color: "#FF5E5E",
|
color: '#FF5E5E',
|
||||||
marginRight: "32px",
|
marginRight: '32px',
|
||||||
fontSize: "22px",
|
fontSize: '22px',
|
||||||
fontWeight: "bold",
|
fontWeight: 'bold',
|
||||||
},
|
},
|
||||||
pagination: {
|
pagination: {
|
||||||
background: '#262525',
|
background: '#262525',
|
||||||
@@ -88,8 +88,8 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
bottom: 0,
|
bottom: 0,
|
||||||
maxWidth: '100%',
|
maxWidth: '100%',
|
||||||
overflow: 'hidden',
|
overflow: 'hidden',
|
||||||
borderBottom: "2px solid #707070"
|
borderBottom: '2px solid #707070',
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
export default useStyles
|
export default useStyles;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { makeStyles } from "@material-ui/core";
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
fontFamily: 'Bahnschrift Regular'
|
fontFamily: 'Bahnschrift Regular',
|
||||||
},
|
},
|
||||||
headTitle: {
|
headTitle: {
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
@@ -14,7 +14,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
width: '50%',
|
width: '50%',
|
||||||
display: 'block',
|
display: 'block',
|
||||||
margin: '0 auto',
|
margin: '0 auto',
|
||||||
textAlign: 'center'
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
actionButton: {
|
actionButton: {
|
||||||
background: '#388CF8',
|
background: '#388CF8',
|
||||||
@@ -27,7 +27,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
fontWeight: 'bold',
|
fontWeight: 'bold',
|
||||||
fontSize: '20px',
|
fontSize: '20px',
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
boxShadow: '0px 2px 7px -2px rgba(0,0,0,0.75)'
|
boxShadow: '0px 2px 7px -2px rgba(0,0,0,0.75)',
|
||||||
},
|
},
|
||||||
accounts: {
|
accounts: {
|
||||||
marginTop: 20,
|
marginTop: 20,
|
||||||
@@ -35,14 +35,10 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
margin: 30,
|
margin: 30,
|
||||||
borderBottom: '1px solid #707070'
|
borderBottom: '1px solid #707070',
|
||||||
},
|
},
|
||||||
accountsType: {
|
accountsType: {},
|
||||||
|
accountBalance: {},
|
||||||
},
|
}));
|
||||||
accountBalance: {
|
|
||||||
|
|
||||||
},
|
|
||||||
}))
|
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
@@ -1,28 +1,31 @@
|
|||||||
import React, { useState } from 'react'
|
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 { 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';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
width: "100%",
|
width: '100%',
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
color: "#f44336",
|
color: '#f44336',
|
||||||
},
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
export const NavigationBar = () => {
|
export const NavigationBar = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const [activePage, setActivePage] = useState(0)
|
const [activePage, setActivePage] = useState(0);
|
||||||
return (
|
return (
|
||||||
<BottomNavigation
|
<BottomNavigation
|
||||||
style={{
|
style={{
|
||||||
background: '#262525'
|
background: '#262525',
|
||||||
}}
|
}}
|
||||||
value={activePage}
|
value={activePage}
|
||||||
onChange={(event, newPage) => {
|
onChange={(event, newPage) => {
|
||||||
@@ -34,18 +37,18 @@ export const NavigationBar = () => {
|
|||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<FontAwesomeIcon icon={faHome} />}
|
icon={<FontAwesomeIcon icon={faHome} />}
|
||||||
to="/bank"
|
to='/bank'
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
||||||
to="/bank/account"
|
to='/bank/account'
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<FontAwesomeIcon icon={faList} />}
|
icon={<FontAwesomeIcon icon={faList} />}
|
||||||
to="/bank/transactions"
|
to='/bank/transactions'
|
||||||
/>
|
/>
|
||||||
</BottomNavigation>
|
</BottomNavigation>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
@@ -1,24 +1,24 @@
|
|||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from 'react';
|
||||||
import Notification from "../../../../ui/components/Notification";
|
import Notification from '../../../../ui/components/Notification';
|
||||||
import { usePhone } from "../../../../os/phone/hooks/usePhone";
|
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from 'react-i18next';
|
||||||
import useStyles from './notification.style';
|
import useStyles from './notification.style';
|
||||||
import { useBankNotification } from "../../hooks/useBankNotification";
|
import { useBankNotification } from '../../hooks/useBankNotification';
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||||
import { faWonSign } from "@fortawesome/free-solid-svg-icons";
|
import { faWonSign } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
|
||||||
export const BankNotification = () => {
|
export const BankNotification = () => {
|
||||||
const { notification } = useBankNotification()
|
const { notification } = useBankNotification();
|
||||||
const classes = useStyles()
|
const classes = useStyles();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [visible, setVisible ] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
const { config } = usePhone()
|
const { config } = usePhone();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
}
|
}
|
||||||
}, [notification?.id])
|
}, [notification?.id]);
|
||||||
|
|
||||||
if (!config?.bank.showNotifications || !notification) return null;
|
if (!config?.bank.showNotifications || !notification) return null;
|
||||||
|
|
||||||
@@ -36,10 +36,13 @@ export const BankNotification = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className={classes.heading}>{notification.type}</div>
|
<div className={classes.heading}>{notification.type}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.justNow}>{t("APPS_BANK_TIME_JUST_NOW")}</div>
|
<div className={classes.justNow}>{t('APPS_BANK_TIME_JUST_NOW')}</div>
|
||||||
|
</div>
|
||||||
|
<div className={classes.message}>
|
||||||
|
{notification.source} sent you ${notification.transferAmount}.{' '}
|
||||||
|
<br></br> {notification.message}
|
||||||
</div>
|
</div>
|
||||||
<div className={classes.message}>{notification.source} sent you ${notification.transferAmount}. <br></br> {notification.message}</div>
|
|
||||||
</div>
|
</div>
|
||||||
</Notification>
|
</Notification>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
@@ -1,43 +1,43 @@
|
|||||||
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) =>
|
const useStyles = makeStyles((theme: Theme) =>
|
||||||
createStyles({
|
createStyles({
|
||||||
content: {
|
content: {
|
||||||
padding: theme.spacing(2),
|
padding: theme.spacing(2),
|
||||||
overflowY: 'hidden'
|
overflowY: 'hidden',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexFlow: "row nowrap",
|
flexFlow: 'row nowrap',
|
||||||
justifyContent: "space-between",
|
justifyContent: 'space-between',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
titleLeft: {
|
titleLeft: {
|
||||||
display: "flex",
|
display: 'flex',
|
||||||
flexFlow: "row nowrap",
|
flexFlow: 'row nowrap',
|
||||||
justifyContent: "flex-start",
|
justifyContent: 'flex-start',
|
||||||
alignItems: "center",
|
alignItems: 'center',
|
||||||
},
|
},
|
||||||
icon: {
|
icon: {
|
||||||
marginTop: "3px",
|
marginTop: '3px',
|
||||||
marginRight: "5px",
|
marginRight: '5px',
|
||||||
},
|
},
|
||||||
heading: {
|
heading: {
|
||||||
marginBottom: "3px",
|
marginBottom: '3px',
|
||||||
},
|
},
|
||||||
justNow: {
|
justNow: {
|
||||||
fontSize: "18px",
|
fontSize: '18px',
|
||||||
fontStyle: "italic",
|
fontStyle: 'italic',
|
||||||
paddingRight: "3px",
|
paddingRight: '3px',
|
||||||
},
|
},
|
||||||
message: {
|
message: {
|
||||||
fontSize: "16px",
|
fontSize: '16px',
|
||||||
overflow: "hidden",
|
overflow: 'hidden',
|
||||||
display: "-webkit-box",
|
display: '-webkit-box',
|
||||||
WebkitLineClamp: 2,
|
WebkitLineClamp: 2,
|
||||||
WebkitBoxOrient: "vertical",
|
WebkitBoxOrient: 'vertical',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
);
|
||||||
|
|
||||||
export default useStyles;
|
export default useStyles;
|
||||||
@@ -1,28 +1,8 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from 'react';
|
||||||
import { List } from "../../../../ui/components/List";
|
|
||||||
import { ListItem } from "../../../../ui/components/ListItem";
|
|
||||||
import ListItemText from "@material-ui/core/ListItemText";
|
|
||||||
import { Typography, makeStyles, Button } from "@material-ui/core";
|
|
||||||
|
|
||||||
import useStyles from '../bank.styles';
|
import useStyles from '../bank.styles';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useTranslation } from "react-i18next";
|
|
||||||
|
|
||||||
import TablePagination from '@material-ui/core/TablePagination';
|
import TablePagination from '@material-ui/core/TablePagination';
|
||||||
|
import { useTransactions } from '../../hooks/useTransactions';
|
||||||
import { useTransactions } from "../../hooks/useTransactions";
|
|
||||||
|
|
||||||
const columns = [
|
|
||||||
{ id: "type", label: "Type", minWidth: 100 },
|
|
||||||
{ id: "amount", label: "Amount", minWidth: 100 },
|
|
||||||
{
|
|
||||||
id: "message",
|
|
||||||
label: "Message",
|
|
||||||
minWidth: 170,
|
|
||||||
align: "left",
|
|
||||||
format: (value: number) => value.toLocaleString("en-US"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const TransactionList = () => {
|
export const TransactionList = () => {
|
||||||
const { transactionList } = useTransactions();
|
const { transactionList } = useTransactions();
|
||||||
@@ -34,10 +14,9 @@ export const TransactionList = () => {
|
|||||||
const TransactionTypes = {
|
const TransactionTypes = {
|
||||||
Deposit: classes.depositType,
|
Deposit: classes.depositType,
|
||||||
Withdraw: classes.withdrawType,
|
Withdraw: classes.withdrawType,
|
||||||
Transfer: classes.depositType
|
Transfer: classes.depositType,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleChangePage = (event, newPage) => {
|
const handleChangePage = (event, newPage) => {
|
||||||
setPage(newPage);
|
setPage(newPage);
|
||||||
};
|
};
|
||||||
@@ -48,9 +27,9 @@ export const TransactionList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="transaction-section">
|
<div id='transaction-section'>
|
||||||
<div className={classes.header}>
|
<div className={classes.header}>
|
||||||
<h2 className={classes.title}>{t("APPS_BANK_ACCOUNT_TRANSACTIONS")}</h2>
|
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={classes.transcationDiv}>
|
<div className={classes.transcationDiv}>
|
||||||
@@ -64,22 +43,22 @@ export const TransactionList = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p className={TransactionTypes[transaction.type]}>
|
<p className={TransactionTypes[transaction.type]}>
|
||||||
{transaction.type == "Withdraw" ? "-" : "+"}
|
{transaction.type == 'Withdraw' ? '-' : '+'}
|
||||||
{transaction.amount}
|
{transaction.amount}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
<TablePagination
|
<TablePagination
|
||||||
rowsPerPageOptions={[3, 5]}
|
rowsPerPageOptions={[3, 5]}
|
||||||
className={classes.pagination}
|
className={classes.pagination}
|
||||||
component="div"
|
component='div'
|
||||||
count={transactionList.length}
|
count={transactionList.length}
|
||||||
rowsPerPage={rowsPerPage}
|
rowsPerPage={rowsPerPage}
|
||||||
page={page}
|
page={page}
|
||||||
onChangePage={handleChangePage}
|
onChangePage={handleChangePage}
|
||||||
onChangeRowsPerPage={handleChangeRowsPerPage}
|
onChangeRowsPerPage={handleChangeRowsPerPage}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,101 +1,108 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react';
|
||||||
import Modal from '../../../../ui/components/Modal';
|
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 CloseIcon from '@material-ui/icons/Close';
|
import CloseIcon from '@material-ui/icons/Close';
|
||||||
|
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
import { useBankModal} from '../../hooks/useBankModal';
|
import { useBankModal } from '../../hooks/useBankModal';
|
||||||
import { Message } from '@material-ui/icons';
|
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
input: {
|
input: {
|
||||||
width: "60%",
|
width: '60%',
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
|
|
||||||
},
|
},
|
||||||
modalInput: {
|
modalInput: {
|
||||||
fontSize: 20
|
fontSize: 20,
|
||||||
},
|
},
|
||||||
modalInputCenter: {
|
modalInputCenter: {
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
},
|
},
|
||||||
transferButton: {
|
transferButton: {
|
||||||
background: "#2E7D32",
|
background: '#2E7D32',
|
||||||
width: 120,
|
width: 120,
|
||||||
padding: 5,
|
padding: 5,
|
||||||
margin: "auto",
|
margin: 'auto',
|
||||||
fontSize: 16,
|
fontSize: 16,
|
||||||
marginBottom: 30
|
marginBottom: 30,
|
||||||
},
|
},
|
||||||
closeButton: {
|
closeButton: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
right: 0,
|
right: 0,
|
||||||
width: "10%"
|
width: '10%',
|
||||||
}
|
},
|
||||||
}))
|
}));
|
||||||
|
|
||||||
|
|
||||||
export const TransferModal = () => {
|
export const TransferModal = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const [ targetID, setTargetID ] = useState('');
|
const [targetID, setTargetID] = useState('');
|
||||||
const [ amount, setAmount ] = useState('');
|
const [amount, setAmount] = useState('');
|
||||||
const [ message, setMessage ] = useState('');
|
const [message, setMessage] = useState('');
|
||||||
|
|
||||||
const { showBankModal, setShowBankModal } = useBankModal();
|
const { showBankModal, setShowBankModal } = useBankModal();
|
||||||
|
|
||||||
const _handleClose = () => {
|
const _handleClose = () => {
|
||||||
setShowBankModal(false)
|
setShowBankModal(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
const addTransfer = () => {
|
const addTransfer = () => {
|
||||||
const transferAmount = parseInt(amount);
|
const transferAmount = parseInt(amount);
|
||||||
Nui.send('phone:addTransfer', {
|
Nui.send('phone:addTransfer', {
|
||||||
targetID,
|
targetID,
|
||||||
transferAmount,
|
transferAmount,
|
||||||
message
|
message,
|
||||||
})
|
});
|
||||||
setShowBankModal(false)
|
setShowBankModal(false);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal visible={showBankModal} handleClose={_handleClose}>
|
<Modal visible={showBankModal} handleClose={_handleClose}>
|
||||||
<Button className={classes.closeButton} onClick={_handleClose}><CloseIcon /></Button>
|
<Button className={classes.closeButton} onClick={_handleClose}>
|
||||||
|
<CloseIcon />
|
||||||
|
</Button>
|
||||||
<List style={{ marginTop: 20 }}>
|
<List style={{ marginTop: 20 }}>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
inputProps={{ className: classes.modalInputCenter }}
|
inputProps={{ className: classes.modalInputCenter }}
|
||||||
fullWidth
|
fullWidth
|
||||||
type="number"
|
type='number'
|
||||||
placeholder="ID"
|
placeholder='ID'
|
||||||
value={targetID}
|
value={targetID}
|
||||||
onChange={e => setTargetID(e.target.value)}
|
onChange={(e) => setTargetID(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
inputProps={{ className: classes.modalInputCenter }}
|
inputProps={{ className: classes.modalInputCenter }}
|
||||||
placeholder="Amount"
|
placeholder='Amount'
|
||||||
fullWidth
|
fullWidth
|
||||||
type="number"
|
type='number'
|
||||||
value={amount}
|
value={amount}
|
||||||
onChange={e => setAmount(e.target.value)}
|
onChange={(e) => setAmount(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
inputProps={{ className: classes.modalInput }}
|
inputProps={{ className: classes.modalInput }}
|
||||||
placeholder="Message"
|
placeholder='Message'
|
||||||
fullWidth
|
fullWidth
|
||||||
value={message}
|
value={message}
|
||||||
multiline
|
multiline
|
||||||
onChange={e => setMessage(e.target.value)}
|
onChange={(e) => setMessage(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
</List>
|
</List>
|
||||||
<Button className={classes.transferButton} onClick={addTransfer}>Transfer</Button>
|
<Button className={classes.transferButton} onClick={addTransfer}>
|
||||||
|
Transfer
|
||||||
|
</Button>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
);
|
||||||
}
|
};
|
||||||
Reference in new issue
Block a user