diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index 2d4c540..eb8c65a 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -19,6 +19,7 @@ import { useApps } from "./os/apps/hooks/useApps"; import { useContactsService } from "./apps/contacts/hooks/useContactsService"; import { useTwitterService } from "./apps/twitter/hooks/useTwitterService"; import { useSelloutService } from "./apps/sellout/hooks/useSelloutService"; +import { useBankService } from './apps/bank/hooks/useBankService'; //These events are just for testing. Comment it out before building. setTimeout(() => { @@ -33,6 +34,24 @@ setTimeout(() => { ); }, 1000); +setTimeout(() => { + window.dispatchEvent( + new MessageEvent("message", { + data: { + app: 'BANK', + method: 'setTransaction', + data: [ + { + id: 1, + amount: 200, + type: 'transfer' + } + ] + } + }) + ) +}) + setTimeout(() => { window.dispatchEvent( new MessageEvent("message", { @@ -116,6 +135,7 @@ function Phone() { useTwitterService(); useInitKeyboard(); useSelloutService(); + useBankService(); if (visibility === false) { return null; diff --git a/phone/src/apps/bank/components/BankApp.tsx b/phone/src/apps/bank/components/BankApp.tsx index bd2be6e..58a3d81 100644 --- a/phone/src/apps/bank/components/BankApp.tsx +++ b/phone/src/apps/bank/components/BankApp.tsx @@ -1,14 +1,19 @@ import React from "react"; import { makeStyles } from "@material-ui/core"; -import { AppTitle } from "../../../ui/components/AppTitle"; +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 { useBank } from "../hooks/useBank"; -import { TransactionList } from "./transactionList"; +import { useTransactions } from "../hooks/useTransactions"; +import { TransactionList } from './transactions/TransactionList'; import "./BankApp.css"; import { useApp } from "../../../os/apps/hooks/useApps"; +import { TransferModal } from './transfers/TransferModal'; + +import { useBankModal } from '../hooks/useBankModal'; +import { useModal } from "../../twitter/hooks/useModal"; + const useStyles = makeStyles((theme) => ({ root: { @@ -23,23 +28,41 @@ const useStyles = makeStyles((theme) => ({ textAlign: "center", fontSize: 50, }, + backgroundModal: { + background: "black", + opacity: "0.6", + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + zIndex: 5, + }, })); export const BankApp = () => { - const { transactionList } = useBank(); + + const { showBankModal, setShowBankModal } = useBankModal() + + const { transactionList } = useTransactions(); const { t } = useTranslation(); const classes = useStyles(); - const bank = useApp("BANK"); + + + const openTransactionsModal = () => { + setShowBankModal(true) + } + return ( - + + +
- - - +
- +
);