diff --git a/phone/src/apps/contacts/components/ContactModal.tsx b/phone/src/apps/contacts/components/ContactModal.tsx index d115adb..506ee2c 100644 --- a/phone/src/apps/contacts/components/ContactModal.tsx +++ b/phone/src/apps/contacts/components/ContactModal.tsx @@ -1,11 +1,15 @@ import React, { useState } from "react"; -import { makeStyles } from "@material-ui/core/styles"; -import { Button, TextField, Paper } from "@material-ui/core"; +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'; -const useStyles = makeStyles((theme) => ({ +import '../components/Contact.css' + +const useStyles = makeStyles((theme: Theme) => ({ button: { margin: 5, marginTop: 20, @@ -18,23 +22,33 @@ const useStyles = makeStyles((theme) => ({ marginLeft: "-4em", height: "20%", }, - - displayBlock: { - /*Sets modal to center*/ - display: "flex", - justifyContent: "center", - alignItems: "center", + textInputField: { + fontSize: 20, + borderBottomColor: 'red' }, - displayNone: { - display: "none", + addBtn: { + margin: 'auto', + width: 150, + background: "#2196f3", + marginBottom: 10, + padding: 8 }, + cancelBtn: { + margin: 'auto', + width: 150, + background: "#232323", + marginBottom: 20, + padding: 8 + } })); -export const AddContactModal = ({ handleClose, show }) => { +export const AddContactModal = () => { const [name, setName] = useState(""); const [number, setNumber] = useState(""); + const [avatar, setAvatar] = useState(""); const classes = useStyles(); - const showHideClassName = show ? classes.displayBlock : classes.displayNone; + + const { showModal, setShowModal } = useModal(); const addContact = () => { if (name === "" || number === "") { @@ -43,37 +57,55 @@ export const AddContactModal = ({ handleClose, show }) => { Nui.send("contacts:add", { name, number, + avatar }); - console.log(name, number); + console.log(name, number, avatar); } }; + const _handleClose = () => { + setShowModal(false) + } + return ( -