mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
cleanup(bank): general cleanup for bank
This commit is contained in:
1 parent
319e5efac5
commit
eb506f0ab0
13 files changed
+282
-385
No files matched your search
@@ -1,101 +1,108 @@
|
||||
import React, { useState } from 'react'
|
||||
import React, { useState } from 'react';
|
||||
import Modal from '../../../../ui/components/Modal';
|
||||
import { Button, List, ListItem, TextField, makeStyles } 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';
|
||||
import { Message } from '@material-ui/icons';
|
||||
import { useBankModal } from '../../hooks/useBankModal';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
input: {
|
||||
width: "60%",
|
||||
width: '60%',
|
||||
margin: 'auto',
|
||||
|
||||
},
|
||||
modalInput: {
|
||||
fontSize: 20
|
||||
fontSize: 20,
|
||||
},
|
||||
modalInputCenter: {
|
||||
fontSize: 20,
|
||||
textAlign: 'center',
|
||||
},
|
||||
transferButton: {
|
||||
background: "#2E7D32",
|
||||
background: '#2E7D32',
|
||||
width: 120,
|
||||
padding: 5,
|
||||
margin: "auto",
|
||||
margin: 'auto',
|
||||
fontSize: 16,
|
||||
marginBottom: 30
|
||||
marginBottom: 30,
|
||||
},
|
||||
closeButton: {
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
width: "10%"
|
||||
}
|
||||
}))
|
||||
|
||||
width: '10%',
|
||||
},
|
||||
}));
|
||||
|
||||
export const TransferModal = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const [ targetID, setTargetID ] = useState('');
|
||||
const [ amount, setAmount ] = useState('');
|
||||
const [ message, setMessage ] = useState('');
|
||||
|
||||
const [targetID, setTargetID] = useState('');
|
||||
const [amount, setAmount] = useState('');
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
const { showBankModal, setShowBankModal } = useBankModal();
|
||||
|
||||
const _handleClose = () => {
|
||||
setShowBankModal(false)
|
||||
}
|
||||
setShowBankModal(false);
|
||||
};
|
||||
|
||||
const addTransfer = () => {
|
||||
const transferAmount = parseInt(amount);
|
||||
Nui.send('phone:addTransfer', {
|
||||
targetID,
|
||||
transferAmount,
|
||||
message
|
||||
})
|
||||
setShowBankModal(false)
|
||||
}
|
||||
targetID,
|
||||
transferAmount,
|
||||
message,
|
||||
});
|
||||
setShowBankModal(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal visible={showBankModal} handleClose={_handleClose}>
|
||||
<Button className={classes.closeButton} onClick={_handleClose}><CloseIcon /></Button>
|
||||
<Button className={classes.closeButton} onClick={_handleClose}>
|
||||
<CloseIcon />
|
||||
</Button>
|
||||
<List style={{ marginTop: 20 }}>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
fullWidth
|
||||
type="number"
|
||||
placeholder="ID"
|
||||
type='number'
|
||||
placeholder='ID'
|
||||
value={targetID}
|
||||
onChange={e => setTargetID(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder="Amount"
|
||||
fullWidth
|
||||
type="number"
|
||||
value={amount}
|
||||
onChange={e => setAmount(e.target.value)}
|
||||
onChange={(e) => setTargetID(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder="Message"
|
||||
inputProps={{ className: classes.modalInputCenter }}
|
||||
placeholder='Amount'
|
||||
fullWidth
|
||||
type='number'
|
||||
value={amount}
|
||||
onChange={(e) => setAmount(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<TextField
|
||||
inputProps={{ className: classes.modalInput }}
|
||||
placeholder='Message'
|
||||
fullWidth
|
||||
value={message}
|
||||
multiline
|
||||
onChange={e => setMessage(e.target.value)}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
</List>
|
||||
<Button className={classes.transferButton} onClick={addTransfer}>Transfer</Button>
|
||||
<Button className={classes.transferButton} onClick={addTransfer}>
|
||||
Transfer
|
||||
</Button>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user