mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feats(contacts/nui): cleanup | esx.js | translation for contacts
This commit is contained in:
1 parent
4d6bc53eea
commit
74f43efddb
12 files changed
+265
-196
No files matched your search
@@ -1,71 +1,30 @@
|
||||
import React, { useState } from "react";
|
||||
import { makeStyles, Theme } from "@material-ui/core/styles";
|
||||
import { Button, TextField } from "@material-ui/core";
|
||||
import Nui from "../../../os/nui-events/utils/Nui";
|
||||
import List from "@material-ui/core/List";
|
||||
import ListItem from "@material-ui/core/ListItem";
|
||||
import Modal from "../../../ui/components/Modal";
|
||||
import { useModal } from "../hooks/useModal";
|
||||
import ClearIcon from "@material-ui/icons/Clear";
|
||||
import PersonIcon from "@material-ui/icons/Person";
|
||||
import PhoneIcon from "@material-ui/icons/Phone";
|
||||
import AccountCircleIcon from "@material-ui/icons/AccountCircle";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
button: {
|
||||
margin: 5,
|
||||
marginTop: 20,
|
||||
},
|
||||
root: {
|
||||
position: "fixed",
|
||||
bottom: 380,
|
||||
zIndex: 2,
|
||||
background: "#232323",
|
||||
marginLeft: "-4em",
|
||||
height: "20%",
|
||||
},
|
||||
clearButton: {
|
||||
width: "10%",
|
||||
position: "absolute",
|
||||
right: 0,
|
||||
},
|
||||
textInputField: {
|
||||
fontSize: 20,
|
||||
borderBottomColor: "red",
|
||||
},
|
||||
addBtn: {
|
||||
margin: "auto",
|
||||
fontSize: 16,
|
||||
width: 150,
|
||||
background: "#2196f3",
|
||||
marginBottom: 10,
|
||||
padding: 8,
|
||||
},
|
||||
cancelBtn: {
|
||||
margin: "auto",
|
||||
width: 150,
|
||||
background: "#232323",
|
||||
marginBottom: 20,
|
||||
padding: 8,
|
||||
},
|
||||
icons: {
|
||||
marginRight: 5,
|
||||
},
|
||||
}));
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import { Button, TextField } from '@material-ui/core';
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import List from '@material-ui/core/List';
|
||||
import ListItem from '@material-ui/core/ListItem';
|
||||
import Modal from '../../../ui/components/Modal';
|
||||
import { useModal } from '../hooks/useModal';
|
||||
import ClearIcon from '@material-ui/icons/Clear';
|
||||
import PersonIcon from '@material-ui/icons/Person';
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import AccountCircleIcon from '@material-ui/icons/AccountCircle';
|
||||
import useStyles from './styles.contactmodal';
|
||||
|
||||
export const AddContactModal = () => {
|
||||
const [name, setName] = useState("");
|
||||
const [number, setNumber] = useState("");
|
||||
const [avatar, setAvatar] = useState("");
|
||||
const [name, setName] = useState('');
|
||||
const [number, setNumber] = useState('');
|
||||
const [avatar, setAvatar] = useState('');
|
||||
const classes = useStyles();
|
||||
|
||||
const { showModal, setShowModal } = useModal();
|
||||
|
||||
const addContact = () => {
|
||||
if (name === "" || number === "") {
|
||||
console.log("You need to pass in values");
|
||||
if (name === '' || number === '') {
|
||||
console.log('You need to pass in values');
|
||||
} else {
|
||||
Nui.send("contacts:add", {
|
||||
Nui.send('contacts:add', {
|
||||
name,
|
||||
number,
|
||||
avatar,
|
||||
@@ -91,8 +50,8 @@ export const AddContactModal = () => {
|
||||
inputProps={{ className: classes.textInputField }}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
fullWidth
|
||||
variant="standard"
|
||||
placeholder="Name"
|
||||
variant='standard'
|
||||
placeholder='Name'
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
@@ -102,9 +61,9 @@ export const AddContactModal = () => {
|
||||
inputProps={{ className: classes.textInputField }}
|
||||
onChange={(e) => setNumber(e.target.value)}
|
||||
fullWidth
|
||||
placeholder="Number"
|
||||
variant="standard"
|
||||
type="text"
|
||||
placeholder='Number'
|
||||
variant='standard'
|
||||
type='text'
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
@@ -114,9 +73,9 @@ export const AddContactModal = () => {
|
||||
inputProps={{ className: classes.textInputField }}
|
||||
onChange={(e) => setAvatar(e.target.value)}
|
||||
fullWidth
|
||||
placeholder="Avatar URL"
|
||||
variant="standard"
|
||||
type="text"
|
||||
placeholder='Avatar URL'
|
||||
variant='standard'
|
||||
type='text'
|
||||
/>
|
||||
</ListItem>
|
||||
</List>
|
||||
|
||||
@@ -1,30 +1,12 @@
|
||||
import React from "react";
|
||||
import { makeStyles, createStyles, Theme } from "@material-ui/core/styles";
|
||||
import Paper from "@material-ui/core/Paper";
|
||||
import ContactsIcon from "@material-ui/icons/Contacts";
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
root: {
|
||||
height: "60px",
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
flexFlow: "row nowrap",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
background: "#424242",
|
||||
},
|
||||
icon: {
|
||||
color: "#fff",
|
||||
fontSize: 30,
|
||||
},
|
||||
})
|
||||
);
|
||||
import React from 'react';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import ContactsIcon from '@material-ui/icons/Contacts';
|
||||
import useStyles from './styles.contacts';
|
||||
|
||||
export const ContactTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||
<Paper className={classes.root} square variant='outlined' elevation={24}>
|
||||
<ContactsIcon className={classes.icon} />
|
||||
</Paper>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import React from 'react';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
|
||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { ContactList } from './List/ContactList';
|
||||
@@ -10,30 +9,11 @@ import { useModal } from '../hooks/useModal';
|
||||
import { SearchContacts } from './List/SearchContacts';
|
||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||
import Fab from '@material-ui/core/Fab';
|
||||
import { useContactModal } from '../hooks/useContactModal';
|
||||
import { InfoModal } from './modal/InfoModal';
|
||||
import { useContactDetail } from '../hooks/useContactDetail';
|
||||
import { ContactAlert } from './alert/ContactAlert';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
backgroundModal: {
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 5,
|
||||
},
|
||||
absolute: {
|
||||
position: 'sticky',
|
||||
bottom: theme.spacing(2),
|
||||
left: theme.spacing(3),
|
||||
},
|
||||
})
|
||||
);
|
||||
import useStyles from './styles.contacts';
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from "react";
|
||||
import ListItemText from "@material-ui/core/ListItemText";
|
||||
import React from 'react';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
import {
|
||||
Button,
|
||||
ListItemAvatar,
|
||||
@@ -9,41 +9,41 @@ import {
|
||||
TextField,
|
||||
Collapse,
|
||||
makeStyles,
|
||||
} from "@material-ui/core";
|
||||
} from '@material-ui/core';
|
||||
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { faPen } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faPen } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
import { useFilteredContacts } from "../../hooks/useFilteredContacts";
|
||||
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
|
||||
|
||||
import PhoneIcon from "@material-ui/icons/Phone";
|
||||
import ChatIcon from "@material-ui/icons/Chat";
|
||||
import MoreVertIcon from "@material-ui/icons/MoreVert";
|
||||
import { useContacts } from "../../hooks/useContacts";
|
||||
import { useContactModal } from "../../hooks/useContactModal";
|
||||
import { useContactDetail } from "../../hooks/useContactDetail";
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import ChatIcon from '@material-ui/icons/Chat';
|
||||
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
||||
import { useContacts } from '../../hooks/useContacts';
|
||||
import { useContactModal } from '../../hooks/useContactModal';
|
||||
import { useContactDetail } from '../../hooks/useContactDetail';
|
||||
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
import "../Contact.css";
|
||||
import '../Contact.css';
|
||||
import { ContactAlert } from '../alert/ContactAlert';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
updateButton: {
|
||||
margin: "auto",
|
||||
margin: 'auto',
|
||||
fontSize: 14,
|
||||
width: 150,
|
||||
background: "#2196f3",
|
||||
background: '#2196f3',
|
||||
marginBottom: 10,
|
||||
padding: 8,
|
||||
},
|
||||
collapseItem: {
|
||||
margin: "auto",
|
||||
width: "50%",
|
||||
margin: 'auto',
|
||||
width: '50%',
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContactList = () => {
|
||||
const classes = useStyles();
|
||||
const { filteredContacts } = useFilteredContacts();
|
||||
const { setShowContactModal } = useContactModal();
|
||||
const { contactDetail, setContactDetail } = useContactDetail();
|
||||
@@ -53,11 +53,11 @@ export const ContactList = () => {
|
||||
const openContactInfo = (contact) => {
|
||||
setShowContactModal(true);
|
||||
setContactDetail(contact);
|
||||
console.log("CONTACT", contactDetail);
|
||||
console.log('CONTACT', contactDetail);
|
||||
};
|
||||
const startCall = (number) => {
|
||||
console.log(number);
|
||||
Nui.send("phone:startCall", {
|
||||
Nui.send('phone:startCall', {
|
||||
number,
|
||||
});
|
||||
};
|
||||
@@ -67,8 +67,8 @@ export const ContactList = () => {
|
||||
{contacts.contacts
|
||||
.filter(
|
||||
(contact) =>
|
||||
contact.display.includes(filteredContacts) ||
|
||||
contact.number.includes(filteredContacts)
|
||||
contact.display.includes(filteredContacts.toLowerCase()) ||
|
||||
contact.number.includes(filteredContacts.toLowerCase())
|
||||
)
|
||||
.map((contact) => (
|
||||
<>
|
||||
@@ -91,7 +91,7 @@ export const ContactList = () => {
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() =>
|
||||
console.log("Message: " + contact.display, contact.number)
|
||||
console.log('Message: ' + contact.display, contact.number)
|
||||
}
|
||||
>
|
||||
<ChatIcon />
|
||||
|
||||
@@ -1,66 +1,65 @@
|
||||
import React, { useState } from "react";
|
||||
import { InputBase } from "@material-ui/core";
|
||||
import SearchIcon from "@material-ui/icons/Search";
|
||||
import React from 'react';
|
||||
import { InputBase } from '@material-ui/core';
|
||||
import SearchIcon from '@material-ui/icons/Search';
|
||||
import {
|
||||
createStyles,
|
||||
fade,
|
||||
Theme,
|
||||
makeStyles,
|
||||
} from "@material-ui/core/styles";
|
||||
} from '@material-ui/core/styles';
|
||||
|
||||
import { useFilteredContacts } from "../../hooks/useFilteredContacts";
|
||||
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) =>
|
||||
createStyles({
|
||||
bg: {
|
||||
backgroundColor: "#232323",
|
||||
display: "flex",
|
||||
backgroundColor: '#232323',
|
||||
display: 'flex',
|
||||
height: 60,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
},
|
||||
textFieldInput: {
|
||||
fontSize: 20,
|
||||
},
|
||||
inputRoot: {
|
||||
color: "#fff",
|
||||
color: '#fff',
|
||||
fontSize: 18,
|
||||
},
|
||||
inputInput: {
|
||||
padding: theme.spacing(1, 4, 1, 4),
|
||||
// vertical padding + font size from searchIcon
|
||||
transition: theme.transitions.create("width"),
|
||||
width: "100%",
|
||||
transition: theme.transitions.create('width'),
|
||||
width: '100%',
|
||||
|
||||
[theme.breakpoints.up("sm")]: {
|
||||
width: "13ch",
|
||||
"&:focus": {
|
||||
width: "20ch",
|
||||
[theme.breakpoints.up('sm')]: {
|
||||
width: '13ch',
|
||||
'&:focus': {
|
||||
width: '20ch',
|
||||
},
|
||||
},
|
||||
},
|
||||
search: {
|
||||
position: "relative",
|
||||
position: 'relative',
|
||||
borderRadius: theme.shape.borderRadius,
|
||||
backgroundColor: fade(theme.palette.common.white, 0.15),
|
||||
"&:hover": {
|
||||
'&:hover': {
|
||||
backgroundColor: fade(theme.palette.common.white, 0.25),
|
||||
},
|
||||
marginLeft: 0,
|
||||
width: "100%",
|
||||
[theme.breakpoints.up("sm")]: {
|
||||
width: '100%',
|
||||
[theme.breakpoints.up('sm')]: {
|
||||
marginLeft: theme.spacing(1),
|
||||
width: "auto",
|
||||
width: 'auto',
|
||||
},
|
||||
},
|
||||
searchIcon: {
|
||||
padding: theme.spacing(0, 0.5),
|
||||
height: "100%",
|
||||
position: "absolute",
|
||||
pointerEvents: "none",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
height: '100%',
|
||||
position: 'absolute',
|
||||
pointerEvents: 'none',
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -69,10 +68,8 @@ export const SearchContacts = () => {
|
||||
const { setFilteredContacts } = useFilteredContacts();
|
||||
|
||||
const classes = useStyles();
|
||||
const [searchValue, setSearchValue] = useState("");
|
||||
|
||||
const handleChange = (e) => {
|
||||
setSearchValue(e.target.value);
|
||||
setFilteredContacts(e.target.value);
|
||||
};
|
||||
|
||||
@@ -80,16 +77,16 @@ export const SearchContacts = () => {
|
||||
<div className={classes.bg}>
|
||||
<div className={classes.search}>
|
||||
<div className={classes.searchIcon}>
|
||||
<SearchIcon style={{ color: "#fff" }} />
|
||||
<SearchIcon style={{ color: '#fff' }} />
|
||||
</div>
|
||||
<InputBase
|
||||
onChange={handleChange}
|
||||
placeholder="Search contacts..."
|
||||
placeholder='Search contacts...'
|
||||
classes={{
|
||||
root: classes.inputRoot,
|
||||
input: classes.inputInput,
|
||||
}}
|
||||
inputProps={{ "aria-label": "search" }}
|
||||
inputProps={{ 'aria-label': 'search' }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
import { Snackbar } from '@material-ui/core';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Alert } from '../../../../ui/components/Alert';
|
||||
import { useContactAlert } from '../../hooks/useAlert';
|
||||
|
||||
export const ContactAlert = () => {
|
||||
const { t } = useTranslation();
|
||||
const { alert, setAlert } = useContactAlert();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [message, setMessage] = useState(null);
|
||||
const [severity, setSeverity] = useState('');
|
||||
|
||||
const _handleClose = () => {
|
||||
setOpen(false);
|
||||
setAlert(null);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (alert === 'CONTACT_ADD_SUCCESS') {
|
||||
setMessage(t('APPS_CONTACTS_ADD_SUCCESS'));
|
||||
setSeverity('success');
|
||||
setOpen(true);
|
||||
} else if (alert === 'CONTACT_ADD_FAILED') {
|
||||
setMessage(t('APPS_CONTACTS_ADD_FAILED'));
|
||||
setSeverity('error');
|
||||
setOpen(true);
|
||||
} else if (alert === 'CONTACT_UPDATE_SUCCESS') {
|
||||
setMessage(t('APPS_CONTACTS_UPDATE_SUCCESS'));
|
||||
setSeverity('success');
|
||||
setOpen(true);
|
||||
} else if (alert === 'CONTACT_UPDATE_FAILED') {
|
||||
setMessage(t('APPS_CONTACTS_UPDATE_FAILED'));
|
||||
setSeverity('error');
|
||||
setOpen(true);
|
||||
} else if (alert === 'CONTACT_DELETE_SUCCESS') {
|
||||
setMessage(t('APPS_CONTACTS_DELETE_SUCCESS'));
|
||||
setSeverity('success');
|
||||
setOpen(true);
|
||||
} else if (alert === 'CONTACT_DELETE_FAILED') {
|
||||
setMessage(t('APPS_CONTACTS_DELETE_FAILED'));
|
||||
setSeverity('error');
|
||||
setOpen(true);
|
||||
}
|
||||
}, [alert]);
|
||||
|
||||
return (
|
||||
<Snackbar
|
||||
style={{ width: '80%', position: 'absolute', bottom: '10%' }}
|
||||
autoHideDuration={6000}
|
||||
open={open}
|
||||
onClose={_handleClose}
|
||||
>
|
||||
<Alert severity={severity} variant='filled'>
|
||||
{message}
|
||||
</Alert>
|
||||
</Snackbar>
|
||||
);
|
||||
};
|
||||
@@ -1,18 +1,18 @@
|
||||
import React, { useState } from "react";
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Paper,
|
||||
Slide,
|
||||
Button,
|
||||
TextField,
|
||||
Avatar as MuiAvatar,
|
||||
} from "@material-ui/core";
|
||||
import useStyles from "./modal.styles";
|
||||
import { useContactModal } from "../../hooks/useContactModal";
|
||||
import ArrowBackIcon from "@material-ui/icons/ArrowBack";
|
||||
} from '@material-ui/core';
|
||||
import useStyles from './modal.styles';
|
||||
import { useContactModal } from '../../hooks/useContactModal';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useContactDetail } from "../../hooks/useContactDetail";
|
||||
import Nui from "../../../../os/nui-events/utils/Nui";
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useContactDetail } from '../../hooks/useContactDetail';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
export const InfoModal = () => {
|
||||
const classes = useStyles();
|
||||
@@ -21,14 +21,14 @@ export const InfoModal = () => {
|
||||
const { contactDetail, setContactDetail } = useContactDetail();
|
||||
|
||||
const [display, setDisplay] = useState(
|
||||
contactDetail ? contactDetail.display : ""
|
||||
contactDetail ? contactDetail.display : ''
|
||||
);
|
||||
console.log(contactDetail);
|
||||
const [number, setNumber] = useState(
|
||||
contactDetail ? contactDetail.number : ""
|
||||
contactDetail ? contactDetail.number : ''
|
||||
);
|
||||
const [avatar, setAvatar] = useState(
|
||||
contactDetail ? contactDetail.avatar : ""
|
||||
contactDetail ? contactDetail.avatar : ''
|
||||
);
|
||||
|
||||
const closeModal = () => {
|
||||
@@ -37,7 +37,7 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
const updateContact = () => {
|
||||
Nui.send("phone:updateContact", {
|
||||
Nui.send('phone:updateContact', {
|
||||
id: contactDetail.id,
|
||||
display,
|
||||
number,
|
||||
@@ -48,7 +48,7 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
const deleteContact = () => {
|
||||
Nui.send("phone:deleteContact", {
|
||||
Nui.send('phone:deleteContact', {
|
||||
id: contactDetail.id,
|
||||
});
|
||||
setContactDetail(null);
|
||||
@@ -56,12 +56,12 @@ export const InfoModal = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Slide direction="up" in={showContactModal}>
|
||||
<Slide direction='up' in={showContactModal}>
|
||||
<Paper
|
||||
className={showContactModal ? classes.modalRoot : classes.modalHide}
|
||||
>
|
||||
<Button style={{ margin: 10 }} onClick={closeModal}>
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
<ArrowBackIcon fontSize='large' />
|
||||
</Button>
|
||||
<div className={classes.listContainer}>
|
||||
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||
@@ -69,7 +69,7 @@ export const InfoModal = () => {
|
||||
className={classes.input}
|
||||
value={display}
|
||||
onChange={(e) => setDisplay(e.target.value)}
|
||||
placeholder={t("APPS_CONTACT_FORM_NAME")}
|
||||
placeholder={t('APPS_CONTACT_FORM_NAME')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -79,7 +79,7 @@ export const InfoModal = () => {
|
||||
className={classes.input}
|
||||
value={number}
|
||||
onChange={(e) => setNumber(e.target.value)}
|
||||
placeholder={t("APPS_CONTACT_FORM_NUMBER")}
|
||||
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -87,7 +87,7 @@ export const InfoModal = () => {
|
||||
/>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder={t("APPS_CONTACT_FORM_AVATAR")}
|
||||
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
|
||||
fullWidth
|
||||
value={avatar}
|
||||
onChange={(e) => setAvatar(e.target.value)}
|
||||
@@ -96,7 +96,7 @@ export const InfoModal = () => {
|
||||
}}
|
||||
/>
|
||||
|
||||
<div style={{ display: "block" }}>
|
||||
<div style={{ display: 'block' }}>
|
||||
<Button onClick={updateContact} className={classes.updateButton}>
|
||||
Update
|
||||
</Button>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
button: {
|
||||
margin: 5,
|
||||
marginTop: 20,
|
||||
},
|
||||
root: {
|
||||
position: 'fixed',
|
||||
bottom: 380,
|
||||
zIndex: 2,
|
||||
background: '#232323',
|
||||
marginLeft: '-4em',
|
||||
height: '20%',
|
||||
},
|
||||
clearButton: {
|
||||
width: '10%',
|
||||
position: 'absolute',
|
||||
right: 0,
|
||||
},
|
||||
textInputField: {
|
||||
fontSize: 20,
|
||||
borderBottomColor: 'red',
|
||||
},
|
||||
addBtn: {
|
||||
margin: 'auto',
|
||||
fontSize: 16,
|
||||
width: 150,
|
||||
background: '#2196f3',
|
||||
marginBottom: 10,
|
||||
padding: 8,
|
||||
},
|
||||
cancelBtn: {
|
||||
margin: 'auto',
|
||||
width: 150,
|
||||
background: '#232323',
|
||||
marginBottom: 20,
|
||||
padding: 8,
|
||||
},
|
||||
icons: {
|
||||
marginRight: 5,
|
||||
},
|
||||
}));
|
||||
|
||||
export default useStyles;
|
||||
@@ -0,0 +1,35 @@
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
backgroundModal: {
|
||||
background: 'black',
|
||||
opacity: '0.6',
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
zIndex: 5,
|
||||
},
|
||||
absolute: {
|
||||
position: 'sticky',
|
||||
bottom: theme.spacing(2),
|
||||
left: theme.spacing(3),
|
||||
},
|
||||
// title
|
||||
root: {
|
||||
height: '60px',
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
flexFlow: 'row nowrap',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
background: '#424242',
|
||||
},
|
||||
icon: {
|
||||
color: '#fff',
|
||||
fontSize: 30,
|
||||
},
|
||||
}));
|
||||
|
||||
export default useStyles;
|
||||
@@ -1,24 +1,28 @@
|
||||
import { atom } from "recoil";
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const contactsState = {
|
||||
contacts: atom({
|
||||
key: "contactsList",
|
||||
key: 'contactsList',
|
||||
default: [],
|
||||
}),
|
||||
showModal: atom({
|
||||
key: "showModal",
|
||||
key: 'showModal',
|
||||
default: false,
|
||||
}),
|
||||
filterContacts: atom({
|
||||
key: 'filterContacts',
|
||||
default: ""
|
||||
default: '',
|
||||
}),
|
||||
showContactsModal: atom({
|
||||
key: 'showContactModal',
|
||||
default: false
|
||||
default: false,
|
||||
}),
|
||||
contactDetail: atom({
|
||||
key: 'contactDetail',
|
||||
default: null
|
||||
})
|
||||
default: null,
|
||||
}),
|
||||
contactAlert: atom({
|
||||
key: 'contactAlert',
|
||||
default: null,
|
||||
}),
|
||||
};
|
||||
@@ -61,6 +61,13 @@
|
||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Invalid phone number: ",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "This message group already exists",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Failed to create message group",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "You cannot add yourself!"
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "You cannot add yourself!",
|
||||
|
||||
"APPS_CONTACTS_ADD_SUCCESS": "Successfully created contact!",
|
||||
"APPS_CONTACTS_ADD_FAILED": "Failed to created contact!",
|
||||
"APPS_CONTACTS_UPDATE_SUCCESS": "Successfully updated contact!",
|
||||
"APPS_CONTACTS_UPDATE_FAILED": "Failed to update contact!",
|
||||
"APPS_CONTACTS_DELETE_SUCCESS": "Successfully deleted contact!",
|
||||
"APPS_CONTACTS_DELETE_FAILED": "Failed to delete contact!"
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,7 @@
|
||||
"@types/node": "^14.11.10",
|
||||
"axios": "^0.21.0",
|
||||
"connection-string-parser": "^1.0.3",
|
||||
"esx.js": "^1.1.5",
|
||||
"fivem-esx-js": "^0.1.12",
|
||||
"fivem-js": "^1.3.1",
|
||||
"md5": "^2.3.0",
|
||||
|
||||
Reference in new issue
Block a user