mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Implenting components
This commit is contained in:
1 parent
d329eb6a5b
commit
763a0300b5
1 file changed
+43
-18
@@ -1,38 +1,63 @@
|
||||
import React, { useState } from "react";
|
||||
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 "./ContactList";
|
||||
import { ContactList } from "./List/ContactList";
|
||||
import { useApp } from "../../../os/apps/hooks/useApps";
|
||||
import AddCircleIcon from "@material-ui/icons/AddCircle";
|
||||
import { AddContactModal } from "./ContactModal";
|
||||
import { Button } from "@material-ui/core";
|
||||
import { useModal } from '../hooks/useModal';
|
||||
import { SearchContacts } from "./List/SearchContacts";
|
||||
import { ContactTitle } from "./ContactTitle";
|
||||
|
||||
import './Contact.css';
|
||||
|
||||
import AddIcon from '@material-ui/icons/Add';
|
||||
import Fab from '@material-ui/core/Fab';
|
||||
|
||||
|
||||
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),
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const [modal, setModal] = useState(false);
|
||||
|
||||
const classes = useStyles();
|
||||
const { showModal, setShowModal } = useModal();
|
||||
const contacts = useApp("CONTACTS");
|
||||
|
||||
const openModal = () => {
|
||||
setModal(true);
|
||||
setShowModal(true);
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
setModal(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<AppWrapper>
|
||||
<AppWrapper id="contact-app">
|
||||
<AppTitle app={contacts}></AppTitle>
|
||||
<Button
|
||||
onClick={openModal}
|
||||
variant="contained"
|
||||
style={{ backgroundColor: "#232323" }}
|
||||
>
|
||||
<AddCircleIcon color="action" />
|
||||
</Button>
|
||||
<SearchContacts />
|
||||
<AddContactModal/>
|
||||
<div className={showModal ? classes.backgroundModal : undefined} />
|
||||
<AppContent>
|
||||
<AddContactModal show={modal} handleClose={closeModal} />
|
||||
<ContactList />
|
||||
<Fab onClick={openModal} style={{backgroundColor: '#2196f3', color: '#fff'}} className={classes.absolute}>
|
||||
<AddIcon />
|
||||
</Fab>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user