styling: Enforced styling across all files (#55)

This commit is contained in:
Taso authored and GitHub committed 2021-01-12 21:31:03 -05:00
1 parent c9b3174505
commit 54daa42454
165 files changed
+1879 -1725

No files matched your search

@@ -1,24 +1,24 @@
import React, { FormEvent, useState } from "react";
import { useTranslation } from "react-i18next";
import { TextField, Button } from "@material-ui/core";
import React, { FormEvent, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { TextField, Button } from '@material-ui/core';
import useStyles from "./form.styles";
import useModals from "../../hooks/useModals";
import Nui from "../../../../os/nui-events/utils/Nui";
import useStyles from './form.styles';
import useModals from '../../hooks/useModals';
import Nui from '../../../../os/nui-events/utils/Nui';
const NewMessageGroupForm = () => {
const classes = useStyles();
const { t } = useTranslation();
const { setShowNewMessageGroup } = useModals();
const [participants, setParticipants] = useState("");
const [label, setLabel] = useState("");
const [participants, setParticipants] = useState('');
const [label, setLabel] = useState('');
// handles phone numbers in a csv format and strips all spaces and
// external characters out of them:
// 123-4567, 987-6543, 333-4444
const parts = participants
.split(",")
.map((part) => part.replace(/[^0-9]/g, ""));
.split(',')
.map((part) => part.replace(/[^0-9]/g, ''));
const isGroupChat = parts.length > 1;
const handleSubmit = (event: FormEvent) => {
@@ -26,11 +26,11 @@ const NewMessageGroupForm = () => {
if (parts.length > 0) {
const labelValue = label.trim();
Nui.send("phone:createMessageGroup", {
Nui.send('phone:createMessageGroup', {
phoneNumbers: parts,
label: isGroupChat && labelValue ? labelValue : null,
});
setParticipants("");
setParticipants('');
setShowNewMessageGroup(false); // close modal after submission
}
};
@@ -40,7 +40,7 @@ const NewMessageGroupForm = () => {
<TextField
value={participants}
onChange={(e) => setParticipants(e.target.value)}
placeholder={t("APPS_MESSAGES_NEW_MESSAGE_GROUP")}
placeholder={t('APPS_MESSAGES_NEW_MESSAGE_GROUP')}
className={classes.newGroupinput}
autoFocus
inputProps={{
@@ -52,7 +52,7 @@ const NewMessageGroupForm = () => {
<TextField
value={label}
onChange={(e) => setLabel(e.target.value)}
placeholder={t("APPS_MESSAGES_GROUP_CHAT_LABEL")}
placeholder={t('APPS_MESSAGES_GROUP_CHAT_LABEL')}
className={classes.newGroupinput}
inputProps={{
className: classes.messagesInput,
@@ -60,12 +60,12 @@ const NewMessageGroupForm = () => {
/>
)}
<Button
variant="contained"
variant='contained'
className={classes.newGroupSubmitButton}
color="primary"
type="submit"
color='primary'
type='submit'
>
{t("APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT")}
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
</Button>
</form>
);