mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
feat(bank/nui): Created modal for transferring money
This commit is contained in:
1 parent
9349e11e7f
commit
e516de9405
1 file changed
+50
-6
@@ -1,13 +1,44 @@
|
||||
import React, { useState } from 'react'
|
||||
import Modal from '../../../../ui/components/Modal';
|
||||
import { Button, List, ListItem, TextField } 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';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
input: {
|
||||
width: "60%",
|
||||
margin: 'auto',
|
||||
|
||||
},
|
||||
modalInput: {
|
||||
fontSize: 20
|
||||
},
|
||||
modalInputCenter: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
},
|
||||
transferButton: {
|
||||
background: "#2E7D32",
|
||||
width: 120,
|
||||
padding: 5,
|
||||
margin: "auto",
|
||||
fontSize: 16,
|
||||
marginBottom: 30
|
||||
},
|
||||
closeButton: {
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
width: "10%"
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
export const TransferModal = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const [ targetID, setTargetID ] = useState('');
|
||||
const [ amount, setAmount ] = useState('');
|
||||
const [ message, setMessage ] = useState('');
|
||||
@@ -24,14 +55,21 @@ export const TransferModal = () => {
|
||||
amount,
|
||||
message
|
||||
})
|
||||
setTimeout(() => {
|
||||
setShowBankModal(false)
|
||||
}, 200)
|
||||
|
||||
}
|
||||
|
||||
return (
|
||||
<Modal visible={showBankModal} handleClose={_handleClose}>
|
||||
<Button onClick={_handleClose}></Button>
|
||||
<List>
|
||||
<Button className={classes.closeButton} onClick={_handleClose}><CloseIcon /></Button>
|
||||
<List style={{ marginTop: 20 }}>
|
||||
<ListItem>
|
||||
<TextField
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
fullWidth
|
||||
type="number"
|
||||
placeholder="ID"
|
||||
value={targetID}
|
||||
onChange={e => setTargetID(e.target.value)}
|
||||
@@ -39,20 +77,26 @@ export const TransferModal = () => {
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder="Amount"
|
||||
fullWidth
|
||||
type="number"
|
||||
value={amount}
|
||||
onChange={e => setAmount(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder="Message"
|
||||
fullWidth
|
||||
value={message}
|
||||
multiline
|
||||
onChange={e => setMessage(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<Button onClick={addTransfer}>Transfer</Button>
|
||||
</List>
|
||||
<Button className={classes.transferButton} onClick={addTransfer}>Transfer</Button>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user