Skip to content

Commit

Permalink
Add sub-modal for picking account.
Browse files Browse the repository at this point in the history
  • Loading branch information
okcodes committed Oct 16, 2020
1 parent 3ef1830 commit 76f9d7e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/views/FlowOperationList/components/AccountPicker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import React from 'react';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import {createStyles, makeStyles, Theme} from '@material-ui/core/styles';
import {CashAccountModel} from "../../../models/CashAccountModel";
import {Transition} from "../../../components/common/Transition";

const useStyles = makeStyles((theme: Theme) =>
createStyles({
root: {},
}),
);

type Props = {
open: boolean,
handleClose: () => void,
dropDownDataForCashAccounts: CashAccountModel[],
};

export const AccountPicker = ({open, handleClose, dropDownDataForCashAccounts}: Props) => {
const classes = useStyles();

return (
<Dialog open={open} onClose={handleClose} TransitionComponent={Transition} className={classes.root}>
<DialogTitle>Account</DialogTitle>
<DialogContent>
xxxxxxxxxxxxxxxxxx
</DialogContent>
<DialogActions>
<Button onClick={handleClose} color="primary">
OK
</Button>
</DialogActions>
</Dialog>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {notStonksTextColor, stonksTextColor} from '../../../theme/colors';
import Card from '@material-ui/core/Card';
import CardContent from '@material-ui/core/CardContent';
import Typography from '@material-ui/core/Typography';
import {AccountPicker} from './AccountPicker';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
Expand Down Expand Up @@ -160,6 +161,11 @@ export const FlowOperationFormDialog = ({open, handleClose, dropDownDataForCashA
</Typography>
</CardContent>
</Card>
<AccountPicker
open={showAccountPicker}
handleClose={() => setShowAccountPicker(false)}
dropDownDataForCashAccounts={dropDownDataForCashAccounts}
/>
<FormControl className={classes.formControl}>
<InputLabel id="FlowOperationFromDialog-IssuerCashAccountId-Label">Account</InputLabel>
<Select
Expand Down

0 comments on commit 76f9d7e

Please sign in to comment.