mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Autocomplete contacts + improve messages ui a bit
This commit is contained in:
6 files changed
+233
-212
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import React, { FormEvent, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Paper, TextField, Button } from '@material-ui/core';
|
||||
import useStyles from './form.styles';
|
||||
import { Paper, TextField, Button, Box } from '@material-ui/core';
|
||||
import SendIcon from '@material-ui/icons/Send';
|
||||
import ImageIcon from '@material-ui/icons/Image';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
@@ -12,7 +11,6 @@ interface IProps {
|
||||
}
|
||||
|
||||
const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
@@ -31,24 +29,28 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
|
||||
if (!messageGroupId) return null;
|
||||
|
||||
return (
|
||||
<Paper className={classes.paper} variant='outlined'>
|
||||
<form className={classes.form} onSubmit={handleSubmit}>
|
||||
<TextField
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
placeholder={t('APPS_MESSAGES_NEW_MESSAGE')}
|
||||
className={classes.input}
|
||||
inputRef={(input) => input && input.focus()}
|
||||
inputProps={{
|
||||
className: classes.messagesInput,
|
||||
}}
|
||||
/>
|
||||
<Button className={classes.sendButton} onClick={onAddImageClick}>
|
||||
<ImageIcon />
|
||||
</Button>
|
||||
<Button className={classes.sendButton} type='submit'>
|
||||
<SendIcon />
|
||||
</Button>
|
||||
<Paper variant='outlined' style={{ position: 'absolute', bottom: 0, width: '100%' }}>
|
||||
<form onSubmit={handleSubmit}>
|
||||
<Box display='flex'>
|
||||
<Box pl={1} flexGrow={1}>
|
||||
<TextField
|
||||
fullWidth
|
||||
inputProps={{ style: { fontSize: '1.3em' } }}
|
||||
value={message}
|
||||
onChange={(e) => setMessage(e.target.value)}
|
||||
placeholder={t('APPS_MESSAGES_NEW_MESSAGE')}
|
||||
inputRef={(input) => input && input.focus()}
|
||||
/>
|
||||
</Box>
|
||||
<Box>
|
||||
<Button onClick={onAddImageClick}>
|
||||
<ImageIcon />
|
||||
</Button>
|
||||
<Button type='submit'>
|
||||
<SendIcon />
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</form>
|
||||
</Paper>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user