mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 06:28:51 +00:00
Merge pull request #37 from Re-Ignited-Development/cleanup/bank
Cleanup/bank
This commit is contained in:
19 files changed
+464
-435
No files matched your search
+48
-23
@@ -49,6 +49,44 @@ if (process.env.NODE_ENV === 'development') {
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
data: {
|
||||
app: 'BANK',
|
||||
method: 'setCredentials',
|
||||
data: {
|
||||
name: 'Firstname Lastname',
|
||||
balance: 2000,
|
||||
},
|
||||
},
|
||||
})
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
data: {
|
||||
app: 'CONTACTS',
|
||||
method: 'setContacts',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
display: 'Ruqen',
|
||||
number: '43534444',
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
display: 'Taso',
|
||||
number: '43534444',
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
@@ -97,16 +135,18 @@ if (process.env.NODE_ENV === 'development') {
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
new MessageEvent('messsage', {
|
||||
data: {
|
||||
app: 'BANK',
|
||||
method: 'setNotification',
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
data: {
|
||||
id: 1,
|
||||
message: 'ahhaha',
|
||||
app: 'BANK',
|
||||
method: 'setNotification',
|
||||
data: {
|
||||
id: 1,
|
||||
message: 'ahhaha',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
@@ -122,21 +162,6 @@ if (process.env.NODE_ENV === 'development') {
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
data: {
|
||||
app: 'BANK',
|
||||
method: 'setCredentials',
|
||||
data: {
|
||||
name: 'Firstname Lastname',
|
||||
balance: 2000,
|
||||
},
|
||||
},
|
||||
})
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
import React from "react";
|
||||
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
||||
import { BankTitle } from "./BankTitle";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { AppContent } from "../../../ui/components/AppContent";
|
||||
import { Button } from "../../../ui/components/Button";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTransactions } from "../hooks/useTransactions";
|
||||
import "./BankApp.css";
|
||||
import { TransferModal } from "./transfers/TransferModal";
|
||||
import React from 'react';
|
||||
import { makeStyles, Paper, Typography } from '@material-ui/core';
|
||||
import { BankTitle } from './BankTitle';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { Button } from '../../../ui/components/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useTransactions } from '../hooks/useTransactions';
|
||||
import './BankApp.css';
|
||||
import { TransferModal } from './transfers/TransferModal';
|
||||
|
||||
import { useBankModal } from "../hooks/useBankModal";
|
||||
import { useCredentials } from "../hooks/useCredentials";
|
||||
import { useBankModal } from '../hooks/useBankModal';
|
||||
import { useCredentials } from '../hooks/useCredentials';
|
||||
|
||||
import { Switch, Route } from "react-router-dom";
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
// image
|
||||
import CreditCard from '../img/credit-card.png'
|
||||
import { NavigationBar } from "./navigation/NavigationBar";
|
||||
import CreditCard from '../img/credit-card.png';
|
||||
import { NavigationBar } from './navigation/NavigationBar';
|
||||
|
||||
import { BankHome } from './home/BankHome';
|
||||
import { BankHome } from './home/BankHome';
|
||||
import { BankAccount } from './account/BankAccount';
|
||||
import { TransactionList } from "./transactions/TransactionList";
|
||||
import { BankAlert } from "./alert/BankAlert";
|
||||
import { TransactionList } from './transactions/TransactionList';
|
||||
import { BankAlert } from './alert/BankAlert';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
height: "90px",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
backgroundColor: "#fb8c00",
|
||||
alignItems: "center",
|
||||
height: '90px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
backgroundColor: '#fb8c00',
|
||||
alignItems: 'center',
|
||||
},
|
||||
header: {
|
||||
fontFamily: "'Bebas Neue', cursive",
|
||||
textAlign: "center",
|
||||
textAlign: 'center',
|
||||
fontSize: 50,
|
||||
},
|
||||
backgroundModal: {
|
||||
background: "black",
|
||||
opacity: "0.6",
|
||||
position: "absolute",
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
@@ -58,15 +58,15 @@ export const BankApp = () => {
|
||||
};
|
||||
|
||||
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>
|
||||
<BankAlert />
|
||||
</AppContent>
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
import React from "react";
|
||||
import Paper from "@material-ui/core/Paper";
|
||||
import { Typography ,makeStyles } from "@material-ui/core";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import React from 'react';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import { Typography, makeStyles } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
import './BankApp.css'
|
||||
import './BankApp.css';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
height: "90px",
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
height: '90px',
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
margin: 0,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
background: "#424242",
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
background: '#424242',
|
||||
},
|
||||
icon: {
|
||||
color: "#f44336",
|
||||
color: '#f44336',
|
||||
fontSize: 40,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
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">WhoDis Banking</Typography>
|
||||
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||
<Typography id='bank-title' style={{ margin: 0 }} variant='h4'>
|
||||
WhoDis Banking
|
||||
</Typography>
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
@@ -1,67 +1,8 @@
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { makeStyles, Paper, Typography, Button } from "@material-ui/core";
|
||||
import { useTransactions } from "../../hooks/useTransactions";
|
||||
import { red } from "@material-ui/core/colors";
|
||||
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",
|
||||
},
|
||||
}));
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { makeStyles, Paper, Typography, Button } from '@material-ui/core';
|
||||
import { useTransactions } from '../../hooks/useTransactions';
|
||||
import useStyles from './account.styles';
|
||||
|
||||
export const AccountTransactions = (): any => {
|
||||
const classes = useStyles();
|
||||
@@ -69,17 +10,17 @@ export const AccountTransactions = (): any => {
|
||||
const TransactionTypes = {
|
||||
Deposit: classes.depositType,
|
||||
Withdraw: classes.withdrawType,
|
||||
Transfer: classes.depositType
|
||||
Transfer: classes.depositType,
|
||||
};
|
||||
|
||||
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>
|
||||
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||
<Button className={classes.seeAll}>
|
||||
{t("APPS_BANK_ACCOUNT_SEE_TRANSACTION")}
|
||||
{t('APPS_BANK_ACCOUNT_SEE_TRANSACTION')}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -92,7 +33,7 @@ export const AccountTransactions = (): any => {
|
||||
</div>
|
||||
<div>
|
||||
<p className={TransactionTypes[transaction.type]}>
|
||||
{transaction.type == "Withdraw" ? "-" : "+"}
|
||||
{transaction.type == 'Withdraw' ? '-' : '+'}
|
||||
{transaction.amount}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react'
|
||||
import { Button } from "../../../../ui/components/Button";
|
||||
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React from 'react';
|
||||
import { Button } from '../../../../ui/components/Button';
|
||||
import { makeStyles, Paper, Typography } from '@material-ui/core';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BankCard } from './BankCard';
|
||||
import { AccountTransactions } from './AccountTransactions';
|
||||
import { useCredentials } from '../../hooks/useCredentials';
|
||||
@@ -9,13 +9,13 @@ import { useCredentials } from '../../hooks/useCredentials';
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: '100%',
|
||||
fontFamily: 'Bahnschrift Regular'
|
||||
fontFamily: 'Bahnschrift Regular',
|
||||
},
|
||||
title: {
|
||||
fontSize: '30px',
|
||||
marginLeft: '29px'
|
||||
}
|
||||
}))
|
||||
marginLeft: '29px',
|
||||
},
|
||||
}));
|
||||
|
||||
export const BankAccount = () => {
|
||||
const classes = useStyles();
|
||||
@@ -24,10 +24,14 @@ export const BankAccount = () => {
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<div>
|
||||
<h1 className={classes.title} >{t("APPS_BANK_ACCOUNT_TITLE")}</h1>
|
||||
<h1 className={classes.title}>{t('APPS_BANK_ACCOUNT_TITLE')}</h1>
|
||||
</div>
|
||||
<BankCard name={credentials.name} account="Checking" balance={credentials.balance} />
|
||||
<BankCard
|
||||
name={credentials.name}
|
||||
account='Checking'
|
||||
balance={credentials.balance}
|
||||
/>
|
||||
<AccountTransactions />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -1,46 +1,6 @@
|
||||
import React from 'react'
|
||||
import { makeStyles, Box, Typography } from "@material-ui/core";
|
||||
import { shadows } from '@material-ui/system';
|
||||
|
||||
/*
|
||||
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'
|
||||
}
|
||||
}))
|
||||
import React from 'react';
|
||||
import { Box } from '@material-ui/core';
|
||||
import useStyles from './card.styles';
|
||||
|
||||
export const BankCard = (props) => {
|
||||
const classes = useStyles();
|
||||
@@ -51,8 +11,11 @@ export const BankCard = (props) => {
|
||||
<p className={classes.cardAccount}>{props.account}</p>
|
||||
</div>
|
||||
<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>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
const useStyles = makeStyles((theme: 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 default useStyles;
|
||||
@@ -0,0 +1,35 @@
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
const useStyles = makeStyles((theme: 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 default useStyles;
|
||||
@@ -1,15 +1,15 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useBankAlert } from "../../hooks/useBankAlert";
|
||||
import Snackbar from "@material-ui/core/Snackbar";
|
||||
import Alert from "./Alert";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useBankAlert } from '../../hooks/useBankAlert';
|
||||
import Snackbar from '@material-ui/core/Snackbar';
|
||||
import Alert from './Alert';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const BankAlert = () => {
|
||||
const { t } = useTranslation();
|
||||
const [open, setOpen] = useState(false);
|
||||
const { bankAlert, setBankAlert } = useBankAlert();
|
||||
const [ message, setMessage ] = useState(null);
|
||||
const [severity, setSeverity] = useState("");
|
||||
const [message, setMessage] = useState(null);
|
||||
const [severity, setSeverity] = useState('');
|
||||
|
||||
const _handleClose = () => {
|
||||
setOpen(false);
|
||||
@@ -17,20 +17,20 @@ export const BankAlert = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (bankAlert === true ) {
|
||||
if (bankAlert === true) {
|
||||
setOpen(true);
|
||||
setMessage(t("APPS_BANK_ALERT_TRANSFER_SUCCESS"));
|
||||
setSeverity("success")
|
||||
setMessage(t('APPS_BANK_ALERT_TRANSFER_SUCCESS'));
|
||||
setSeverity('success');
|
||||
} else if (bankAlert === false) {
|
||||
setOpen(true);
|
||||
setMessage(t("APPS_BANK_ALERT_TRANSFER_FAILURE"));
|
||||
setSeverity("error")
|
||||
setMessage(t('APPS_BANK_ALERT_TRANSFER_FAILURE'));
|
||||
setSeverity('error');
|
||||
}
|
||||
}, [bankAlert])
|
||||
}, [bankAlert]);
|
||||
|
||||
return (
|
||||
<Snackbar
|
||||
style={{ width: "80%" }}
|
||||
style={{ width: '80%' }}
|
||||
open={open}
|
||||
autoHideDuration={6000}
|
||||
onClose={_handleClose}
|
||||
@@ -40,4 +40,4 @@ export const BankAlert = () => {
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
);
|
||||
};
|
||||
};
|
||||
@@ -1,85 +1,85 @@
|
||||
import { makeStyles } from "@material-ui/core";
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
paper: {
|
||||
padding: theme.spacing(1),
|
||||
textAlign: "center",
|
||||
width: "50%",
|
||||
backgroundColor: "#2d3436",
|
||||
textAlign: 'center',
|
||||
width: '50%',
|
||||
backgroundColor: '#2d3436',
|
||||
margin: 20,
|
||||
color: "#fff",
|
||||
color: '#fff',
|
||||
},
|
||||
table: {
|
||||
width: "100%",
|
||||
color: "#fff",
|
||||
width: '100%',
|
||||
color: '#fff',
|
||||
},
|
||||
cell: {
|
||||
color: "#fff",
|
||||
color: '#fff',
|
||||
},
|
||||
container: {
|
||||
maxHeight: 350,
|
||||
},
|
||||
list: {
|
||||
marginTop: "8.5em",
|
||||
marginTop: '8.5em',
|
||||
},
|
||||
root: {
|
||||
width: "100%",
|
||||
width: '100%',
|
||||
},
|
||||
header: {
|
||||
width: "90%",
|
||||
display: "flex",
|
||||
justifyItems: "center",
|
||||
justifyContent: "space-between",
|
||||
margin: "auto",
|
||||
width: '90%',
|
||||
display: 'flex',
|
||||
justifyItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
margin: 'auto',
|
||||
},
|
||||
title: {
|
||||
padding: 7,
|
||||
borderRadius: "10px",
|
||||
display: "flex",
|
||||
justifyItems: "center",
|
||||
justifyContent: "center",
|
||||
fontSize: "30px",
|
||||
borderRadius: '10px',
|
||||
display: 'flex',
|
||||
justifyItems: 'center',
|
||||
justifyContent: 'center',
|
||||
fontSize: '30px',
|
||||
},
|
||||
seeAll: {
|
||||
fontFamily: "Bahnschrift Regular",
|
||||
fontWeight: "bold",
|
||||
height: "auto",
|
||||
fontFamily: 'Bahnschrift Regular',
|
||||
fontWeight: 'bold',
|
||||
height: 'auto',
|
||||
},
|
||||
transcationDiv: {
|
||||
marginTop: "-30px",
|
||||
minHeight: 200,
|
||||
maxHeight: 240
|
||||
marginTop: '-30px',
|
||||
minHeight: 200,
|
||||
maxHeight: 240,
|
||||
},
|
||||
transactions: {
|
||||
marginLeft: "32px",
|
||||
display: "flex",
|
||||
justifyContent: "space-between",
|
||||
borderBottom: "2px solid #707070",
|
||||
width: "85%",
|
||||
margin: "auto",
|
||||
marginLeft: '32px',
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
borderBottom: '2px solid #707070',
|
||||
width: '85%',
|
||||
margin: 'auto',
|
||||
},
|
||||
tranSource: {
|
||||
fontSize: "22px",
|
||||
fontSize: '22px',
|
||||
},
|
||||
tranType: {
|
||||
fontSize: "18px",
|
||||
fontWeight: "bold",
|
||||
color: "#BFBFBF",
|
||||
marginTop: "-18px",
|
||||
width: "100%",
|
||||
fontSize: '18px',
|
||||
fontWeight: 'bold',
|
||||
color: '#BFBFBF',
|
||||
marginTop: '-18px',
|
||||
width: '100%',
|
||||
},
|
||||
|
||||
depositType: {
|
||||
color: "#55B452",
|
||||
marginRight: "32px",
|
||||
fontSize: "22px",
|
||||
fontWeight: "bold",
|
||||
color: '#55B452',
|
||||
marginRight: '32px',
|
||||
fontSize: '22px',
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
withdrawType: {
|
||||
color: "#FF5E5E",
|
||||
marginRight: "32px",
|
||||
fontSize: "22px",
|
||||
fontWeight: "bold",
|
||||
color: '#FF5E5E',
|
||||
marginRight: '32px',
|
||||
fontSize: '22px',
|
||||
fontWeight: 'bold',
|
||||
},
|
||||
pagination: {
|
||||
background: '#262525',
|
||||
@@ -88,8 +88,8 @@ const useStyles = makeStyles((theme) => ({
|
||||
bottom: 0,
|
||||
maxWidth: '100%',
|
||||
overflow: 'hidden',
|
||||
borderBottom: "2px solid #707070"
|
||||
}
|
||||
}))
|
||||
borderBottom: '2px solid #707070',
|
||||
},
|
||||
}));
|
||||
|
||||
export default useStyles
|
||||
export default useStyles;
|
||||
@@ -1,42 +1,47 @@
|
||||
import React from "react";
|
||||
import { makeStyles, Paper, Typography } from "@material-ui/core";
|
||||
import { BankTitle } from "../BankTitle";
|
||||
import { Button } from "../../../../ui/components/Button";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useTransactions } from "../../hooks/useTransactions";
|
||||
import { TransactionList } from "../transactions/TransactionList";
|
||||
import { TransferModal } from "../transfers/TransferModal";
|
||||
import React from 'react';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { Button } from '../../../../ui/components/Button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useBankModal } from "../../hooks/useBankModal";
|
||||
import { useCredentials } from "../../hooks/useCredentials";
|
||||
import { useBankModal } from '../../hooks/useBankModal';
|
||||
import { useCredentials } from '../../hooks/useCredentials';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
// image
|
||||
import CreditCard from '../img/credit-card.png'
|
||||
import useStyles from './home.styles';
|
||||
|
||||
export const BankHome = () => {
|
||||
const { showBankModal, setShowBankModal } = useBankModal();
|
||||
const { credentials } = useCredentials();
|
||||
const { transactionList } = useTransactions();
|
||||
const { t } = useTranslation();
|
||||
const classes = useStyles();
|
||||
const { setShowBankModal } = useBankModal();
|
||||
const { credentials } = useCredentials();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const openTransactionsModal = () => {
|
||||
setShowBankModal(true);
|
||||
};
|
||||
|
||||
if (!credentials) return <p>Could not load credentials</p>;
|
||||
|
||||
return (
|
||||
<div className={classes.root} >
|
||||
<Typography className={classes.headTitle}><span style={{ fontWeight: 'bold' }}>{t("APPS_BANK_HOME_TITLE")}</span>, {credentials.name}</Typography>
|
||||
<div className={classes.root}>
|
||||
<Typography className={classes.headTitle}>
|
||||
<span style={{ fontWeight: 'bold' }}>{t('APPS_BANK_HOME_TITLE')}</span>,{' '}
|
||||
{credentials.name}
|
||||
</Typography>
|
||||
<div className={classes.accounts}>
|
||||
<h2 className={classes.accountsType}>Checking:</h2>
|
||||
<p className={classes.accountBalance}>${credentials.balance}</p>
|
||||
<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>
|
||||
<Button onClick={openTransactionsModal} className={classes.actionButton}>{t("APPS_BANK_ACTIONS_TRANSFER")}</Button>
|
||||
<Button id='actionButton' className={classes.actionButton}>
|
||||
<NavLink to='/bank/account'>{t('APPS_BANK_ACCOUNT_LINK')}</NavLink>
|
||||
</Button>
|
||||
<Button
|
||||
onClick={openTransactionsModal}
|
||||
className={classes.actionButton}
|
||||
>
|
||||
{t('APPS_BANK_ACTIONS_TRANSFER')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
@@ -1,9 +1,9 @@
|
||||
import { makeStyles } from "@material-ui/core";
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: "100%",
|
||||
fontFamily: 'Bahnschrift Regular'
|
||||
width: '100%',
|
||||
fontFamily: 'Bahnschrift Regular',
|
||||
},
|
||||
headTitle: {
|
||||
textAlign: 'center',
|
||||
@@ -14,7 +14,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
width: '50%',
|
||||
display: 'block',
|
||||
margin: '0 auto',
|
||||
textAlign: 'center'
|
||||
textAlign: 'center',
|
||||
},
|
||||
actionButton: {
|
||||
background: '#388CF8',
|
||||
@@ -27,7 +27,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
fontWeight: 'bold',
|
||||
fontSize: '20px',
|
||||
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: {
|
||||
marginTop: 20,
|
||||
@@ -35,14 +35,10 @@ const useStyles = makeStyles((theme) => ({
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
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 { 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 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';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
width: "100%",
|
||||
width: '100%',
|
||||
},
|
||||
icon: {
|
||||
color: "#f44336",
|
||||
color: '#f44336',
|
||||
},
|
||||
}))
|
||||
}));
|
||||
|
||||
export const NavigationBar = () => {
|
||||
const classes = useStyles();
|
||||
const [activePage, setActivePage] = useState(0)
|
||||
const [activePage, setActivePage] = useState(0);
|
||||
return (
|
||||
<BottomNavigation
|
||||
style={{
|
||||
background: '#262525'
|
||||
background: '#262525',
|
||||
}}
|
||||
value={activePage}
|
||||
onChange={(event, newPage) => {
|
||||
@@ -34,18 +37,18 @@ 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>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -1,24 +1,24 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Notification from "../../../../ui/components/Notification";
|
||||
import { usePhone } from "../../../../os/phone/hooks/usePhone";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import Notification from '../../../../ui/components/Notification';
|
||||
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import useStyles from './notification.style';
|
||||
import { useBankNotification } from "../../hooks/useBankNotification";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faWonSign } from "@fortawesome/free-solid-svg-icons";
|
||||
import { useBankNotification } from '../../hooks/useBankNotification';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faWonSign } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
export const BankNotification = () => {
|
||||
const { notification } = useBankNotification()
|
||||
const classes = useStyles()
|
||||
const { notification } = useBankNotification();
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const [visible, setVisible ] = useState(false);
|
||||
const { config } = usePhone()
|
||||
const [visible, setVisible] = useState(false);
|
||||
const { config } = usePhone();
|
||||
|
||||
useEffect(() => {
|
||||
if (notification) {
|
||||
setVisible(true);
|
||||
}
|
||||
}, [notification?.id])
|
||||
}, [notification?.id]);
|
||||
|
||||
if (!config?.bank.showNotifications || !notification) return null;
|
||||
|
||||
@@ -36,10 +36,13 @@ export const BankNotification = () => {
|
||||
</div>
|
||||
<div className={classes.heading}>{notification.type}</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 className={classes.message}>{notification.source} sent you ${notification.transferAmount}. <br></br> {notification.message}</div>
|
||||
</div>
|
||||
</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({
|
||||
content: {
|
||||
padding: theme.spacing(2),
|
||||
overflowY: 'hidden'
|
||||
overflowY: 'hidden',
|
||||
},
|
||||
title: {
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
justifyContent: "space-between",
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
flexFlow: 'row nowrap',
|
||||
justifyContent: 'space-between',
|
||||
alignItems: 'center',
|
||||
},
|
||||
titleLeft: {
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
justifyContent: "flex-start",
|
||||
alignItems: "center",
|
||||
display: 'flex',
|
||||
flexFlow: 'row nowrap',
|
||||
justifyContent: 'flex-start',
|
||||
alignItems: 'center',
|
||||
},
|
||||
icon: {
|
||||
marginTop: "3px",
|
||||
marginRight: "5px",
|
||||
marginTop: '3px',
|
||||
marginRight: '5px',
|
||||
},
|
||||
heading: {
|
||||
marginBottom: "3px",
|
||||
marginBottom: '3px',
|
||||
},
|
||||
justNow: {
|
||||
fontSize: "18px",
|
||||
fontStyle: "italic",
|
||||
paddingRight: "3px",
|
||||
fontSize: '18px',
|
||||
fontStyle: 'italic',
|
||||
paddingRight: '3px',
|
||||
},
|
||||
message: {
|
||||
fontSize: "16px",
|
||||
overflow: "hidden",
|
||||
display: "-webkit-box",
|
||||
fontSize: '16px',
|
||||
overflow: 'hidden',
|
||||
display: '-webkit-box',
|
||||
WebkitLineClamp: 2,
|
||||
WebkitBoxOrient: "vertical",
|
||||
WebkitBoxOrient: 'vertical',
|
||||
},
|
||||
})
|
||||
)
|
||||
);
|
||||
|
||||
export default useStyles;
|
||||
export default useStyles;
|
||||
@@ -1,28 +1,8 @@
|
||||
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 React, { useState } from 'react';
|
||||
import useStyles from '../bank.styles';
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import TablePagination from '@material-ui/core/TablePagination';
|
||||
|
||||
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"),
|
||||
},
|
||||
];
|
||||
import { useTransactions } from '../../hooks/useTransactions';
|
||||
|
||||
export const TransactionList = () => {
|
||||
const { transactionList } = useTransactions();
|
||||
@@ -34,10 +14,9 @@ export const TransactionList = () => {
|
||||
const TransactionTypes = {
|
||||
Deposit: classes.depositType,
|
||||
Withdraw: classes.withdrawType,
|
||||
Transfer: classes.depositType
|
||||
Transfer: classes.depositType,
|
||||
};
|
||||
|
||||
|
||||
const handleChangePage = (event, newPage) => {
|
||||
setPage(newPage);
|
||||
};
|
||||
@@ -48,9 +27,9 @@ 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>
|
||||
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
|
||||
</div>
|
||||
|
||||
<div className={classes.transcationDiv}>
|
||||
@@ -64,22 +43,22 @@ export const TransactionList = () => {
|
||||
</div>
|
||||
<div>
|
||||
<p className={TransactionTypes[transaction.type]}>
|
||||
{transaction.type == "Withdraw" ? "-" : "+"}
|
||||
{transaction.type == 'Withdraw' ? '-' : '+'}
|
||||
{transaction.amount}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<TablePagination
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[3, 5]}
|
||||
className={classes.pagination}
|
||||
component="div"
|
||||
component='div'
|
||||
count={transactionList.length}
|
||||
rowsPerPage={rowsPerPage}
|
||||
page={page}
|
||||
onChangePage={handleChangePage}
|
||||
onChangeRowsPerPage={handleChangeRowsPerPage}
|
||||
/>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,101 +1,108 @@
|
||||
import React, { useState } from 'react'
|
||||
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 CloseIcon from '@material-ui/icons/Close';
|
||||
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
import { useBankModal} from '../../hooks/useBankModal';
|
||||
import { Message } from '@material-ui/icons';
|
||||
import { useBankModal } from '../../hooks/useBankModal';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
input: {
|
||||
width: "60%",
|
||||
width: '60%',
|
||||
margin: 'auto',
|
||||
|
||||
},
|
||||
modalInput: {
|
||||
fontSize: 20
|
||||
fontSize: 20,
|
||||
},
|
||||
modalInputCenter: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
},
|
||||
transferButton: {
|
||||
background: "#2E7D32",
|
||||
background: '#2E7D32',
|
||||
width: 120,
|
||||
padding: 5,
|
||||
margin: "auto",
|
||||
margin: 'auto',
|
||||
fontSize: 16,
|
||||
marginBottom: 30
|
||||
marginBottom: 30,
|
||||
},
|
||||
closeButton: {
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
width: "10%"
|
||||
}
|
||||
}))
|
||||
|
||||
width: '10%',
|
||||
},
|
||||
}));
|
||||
|
||||
export const TransferModal = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const [ targetID, setTargetID ] = useState('');
|
||||
const [ amount, setAmount ] = useState('');
|
||||
const [ message, setMessage ] = useState('');
|
||||
|
||||
const [targetID, setTargetID] = useState('');
|
||||
const [amount, setAmount] = useState('');
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
const { showBankModal, setShowBankModal } = useBankModal();
|
||||
|
||||
const _handleClose = () => {
|
||||
setShowBankModal(false)
|
||||
}
|
||||
setShowBankModal(false);
|
||||
};
|
||||
|
||||
const addTransfer = () => {
|
||||
const transferAmount = parseInt(amount);
|
||||
Nui.send('phone:addTransfer', {
|
||||
targetID,
|
||||
transferAmount,
|
||||
message
|
||||
})
|
||||
setShowBankModal(false)
|
||||
}
|
||||
targetID,
|
||||
transferAmount,
|
||||
message,
|
||||
});
|
||||
setShowBankModal(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<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 }}>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
fullWidth
|
||||
type="number"
|
||||
placeholder="ID"
|
||||
type='number'
|
||||
placeholder='ID'
|
||||
value={targetID}
|
||||
onChange={e => setTargetID(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder="Amount"
|
||||
fullWidth
|
||||
type="number"
|
||||
value={amount}
|
||||
onChange={e => setAmount(e.target.value)}
|
||||
onChange={(e) => setTargetID(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder="Message"
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder='Amount'
|
||||
fullWidth
|
||||
type='number'
|
||||
value={amount}
|
||||
onChange={(e) => setAmount(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder='Message'
|
||||
fullWidth
|
||||
value={message}
|
||||
multiline
|
||||
onChange={e => setMessage(e.target.value)}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
</List>
|
||||
<Button className={classes.transferButton} onClick={addTransfer}>Transfer</Button>
|
||||
<Button className={classes.transferButton} onClick={addTransfer}>
|
||||
Transfer
|
||||
</Button>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
@@ -1,7 +1,12 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { bankState } from './state';
|
||||
import { bankState } from './state';
|
||||
import { IBankCredentials } from '../../../common/interfaces/bank';
|
||||
|
||||
export const useCredentials = (): any => {
|
||||
interface ICredentialsHook {
|
||||
credentials: IBankCredentials;
|
||||
}
|
||||
|
||||
export const useCredentials = (): ICredentialsHook => {
|
||||
const credentials = useRecoilValue(bankState.bankCredentials);
|
||||
return { credentials };
|
||||
}
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
export interface Credentials {
|
||||
export interface IBankCredentials {
|
||||
name: string;
|
||||
balance: number;
|
||||
}
|
||||
@@ -11,4 +11,3 @@ export interface Transfer {
|
||||
transferAmount: number;
|
||||
message: string;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user