mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
feat(bank/nui): Created modal for transferring money
This commit is contained in:
1 parent
9349e11e7f
commit
e516de9405
1 file changed
+48
-4
@@ -1,13 +1,44 @@
|
|||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import Modal from '../../../../ui/components/Modal';
|
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 Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
import { useBankModal} from '../../hooks/useBankModal';
|
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 = () => {
|
export const TransferModal = () => {
|
||||||
|
const classes = useStyles();
|
||||||
|
|
||||||
const [ targetID, setTargetID ] = useState('');
|
const [ targetID, setTargetID ] = useState('');
|
||||||
const [ amount, setAmount ] = useState('');
|
const [ amount, setAmount ] = useState('');
|
||||||
const [ message, setMessage ] = useState('');
|
const [ message, setMessage ] = useState('');
|
||||||
@@ -24,14 +55,21 @@ export const TransferModal = () => {
|
|||||||
amount,
|
amount,
|
||||||
message
|
message
|
||||||
})
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
setShowBankModal(false)
|
||||||
|
}, 200)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal visible={showBankModal} handleClose={_handleClose}>
|
<Modal visible={showBankModal} handleClose={_handleClose}>
|
||||||
<Button onClick={_handleClose}></Button>
|
<Button className={classes.closeButton} onClick={_handleClose}><CloseIcon /></Button>
|
||||||
<List>
|
<List style={{ marginTop: 20 }}>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
|
inputProps={{ className: classes.modalInputCenter }}
|
||||||
|
fullWidth
|
||||||
|
type="number"
|
||||||
placeholder="ID"
|
placeholder="ID"
|
||||||
value={targetID}
|
value={targetID}
|
||||||
onChange={e => setTargetID(e.target.value)}
|
onChange={e => setTargetID(e.target.value)}
|
||||||
@@ -39,20 +77,26 @@ export const TransferModal = () => {
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
|
inputProps={{ className: classes.modalInputCenter }}
|
||||||
placeholder="Amount"
|
placeholder="Amount"
|
||||||
|
fullWidth
|
||||||
|
type="number"
|
||||||
value={amount}
|
value={amount}
|
||||||
onChange={e => setAmount(e.target.value)}
|
onChange={e => setAmount(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<ListItem>
|
<ListItem>
|
||||||
<TextField
|
<TextField
|
||||||
|
inputProps={{ className: classes.modalInput }}
|
||||||
placeholder="Message"
|
placeholder="Message"
|
||||||
|
fullWidth
|
||||||
value={message}
|
value={message}
|
||||||
|
multiline
|
||||||
onChange={e => setMessage(e.target.value)}
|
onChange={e => setMessage(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
<Button onClick={addTransfer}>Transfer</Button>
|
|
||||||
</List>
|
</List>
|
||||||
|
<Button className={classes.transferButton} onClick={addTransfer}>Transfer</Button>
|
||||||
</Modal>
|
</Modal>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user