mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
inital message app
This commit is contained in:
1 parent
e6bb7f39a6
commit
374d4c9269
12 files changed
+284
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import React, { useState } from 'react'
|
||||
import { Paper, TextField, Button } from '@material-ui/core'
|
||||
import useStyles from './form.styles';
|
||||
import SendIcon from '@material-ui/icons/Send';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
export const MessageInput = ({ name }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
const [ message, setMessage ] = useState('')
|
||||
|
||||
Nui.send('phone:sendMessage', {
|
||||
name,
|
||||
message
|
||||
})
|
||||
|
||||
return (
|
||||
<Paper
|
||||
className={classes.form}
|
||||
variant="outlined"
|
||||
>
|
||||
<TextField
|
||||
value={message}
|
||||
onChange={e => setMessage(e.target.value)}
|
||||
placeholder="Message..."
|
||||
className={classes.input}
|
||||
inputProps={{
|
||||
className: classes.messagesInput
|
||||
}}
|
||||
/>
|
||||
<Button className={classes.sendButton}><SendIcon /></Button>
|
||||
</Paper>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
sendButton: {
|
||||
float: 'right'
|
||||
},
|
||||
form: {
|
||||
position: 'absolute',
|
||||
bottom: 0,
|
||||
display: 'flex',
|
||||
width: '100%',
|
||||
},
|
||||
input: {
|
||||
width: '100%',
|
||||
margin: 10
|
||||
},
|
||||
messagesInput: {
|
||||
fontSize: 20
|
||||
}
|
||||
}))
|
||||
|
||||
export default useStyles;
|
||||
Reference in new issue
Block a user