mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
styling: Enforced styling across all files (#55)
This commit is contained in:
165 files changed
+1879
-1725
No files matched your search
@@ -1,11 +1,11 @@
|
||||
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 SendIcon from "@material-ui/icons/Send";
|
||||
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 SendIcon from '@material-ui/icons/Send';
|
||||
import ImageIcon from '@material-ui/icons/Image';
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useImageModal } from "../../hooks/useImageModal";
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useImageModal } from '../../hooks/useImageModal';
|
||||
|
||||
interface IProps {
|
||||
messageGroupId: string | undefined;
|
||||
@@ -15,33 +15,33 @@ const MessageInput = ({ messageGroupId }: IProps) => {
|
||||
const { setImageModal } = useImageModal();
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const [message, setMessage] = useState("");
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
const handleSubmit = (event: FormEvent) => {
|
||||
event.preventDefault();
|
||||
if (message.trim()) {
|
||||
// don't allow the user to submit white space
|
||||
Nui.send("phone:sendMessage", {
|
||||
Nui.send('phone:sendMessage', {
|
||||
groupId: messageGroupId,
|
||||
message,
|
||||
});
|
||||
setMessage("");
|
||||
setMessage('');
|
||||
}
|
||||
};
|
||||
|
||||
const openImageModal = () => {
|
||||
setImageModal(true);
|
||||
}
|
||||
};
|
||||
|
||||
if (!messageGroupId) return null;
|
||||
|
||||
return (
|
||||
<Paper className={classes.paper} variant="outlined">
|
||||
<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")}
|
||||
placeholder={t('APPS_MESSAGES_NEW_MESSAGE')}
|
||||
className={classes.input}
|
||||
inputRef={(input) => input && input.focus()}
|
||||
inputProps={{
|
||||
@@ -51,7 +51,7 @@ const MessageInput = ({ messageGroupId }: IProps) => {
|
||||
<Button className={classes.sendButton} onClick={openImageModal}>
|
||||
<ImageIcon />
|
||||
</Button>
|
||||
<Button className={classes.sendButton} type="submit">
|
||||
<Button className={classes.sendButton} type='submit'>
|
||||
<SendIcon />
|
||||
</Button>
|
||||
</form>
|
||||
|
||||
Reference in new issue
Block a user