mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Refactoring of bank app component | moving components into folders
This commit is contained in:
1 parent
0b1aa3501d
commit
df6cca07be
1 file changed
+23
-18
@@ -1,19 +1,25 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { makeStyles } 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 { TransactionList } from './transactions/TransactionList';
|
|
||||||
import "./BankApp.css";
|
import "./BankApp.css";
|
||||||
import { useApp } from "../../../os/apps/hooks/useApps";
|
import { TransferModal } from "./transfers/TransferModal";
|
||||||
import { TransferModal } from './transfers/TransferModal';
|
|
||||||
|
|
||||||
import { useBankModal } from '../hooks/useBankModal';
|
import { useBankModal } from "../hooks/useBankModal";
|
||||||
import { useModal } from "../../twitter/hooks/useModal";
|
import { useCredentials } from "../hooks/useCredentials";
|
||||||
|
|
||||||
|
import { Switch, Route } from "react-router-dom";
|
||||||
|
|
||||||
|
// image
|
||||||
|
import CreditCard from '../img/credit-card.png'
|
||||||
|
import { NavigationBar } from "./navigation/NavigationBar";
|
||||||
|
|
||||||
|
import { BankHome } from './home/BankHome';
|
||||||
|
import { BankAccount } from './account/BankAccount';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -41,29 +47,28 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export const BankApp = () => {
|
export const BankApp = () => {
|
||||||
|
const { showBankModal, setShowBankModal } = useBankModal();
|
||||||
const { showBankModal, setShowBankModal } = useBankModal()
|
const { credentials } = useCredentials();
|
||||||
|
|
||||||
const { transactionList } = useTransactions();
|
const { transactionList } = useTransactions();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
|
|
||||||
const openTransactionsModal = () => {
|
const openTransactionsModal = () => {
|
||||||
setShowBankModal(true)
|
setShowBankModal(true);
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AppWrapper>
|
<AppWrapper id="bank-app">
|
||||||
<BankTitle />
|
<BankTitle />
|
||||||
<TransferModal />
|
<TransferModal />
|
||||||
<div className={showBankModal ? classes.backgroundModal : undefined} />
|
<div className={showBankModal ? classes.backgroundModal : undefined} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<div>
|
<Switch>
|
||||||
<Button onClick={openTransactionsModal} fullWidth>{t("APPS_BANK_TRANSFER")}</Button>
|
<Route path="/bank" exact component={BankHome} />
|
||||||
</div>
|
<Route path="/bank/account" exact component={BankAccount} />
|
||||||
<TransactionList transactions={transactionList}/>
|
</Switch>
|
||||||
</AppContent>
|
</AppContent>
|
||||||
|
<NavigationBar />
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user