mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +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>
|
||||
|
||||
Reference in new issue
Block a user