mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Feat(Contacts): Contact List
This commit is contained in:
1 parent
de5de7860d
commit
7a46eaf2be
2 files changed
+47
-2
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import List from '@material-ui/core/List';
|
||||||
|
import ListItem from '@material-ui/core/ListItem';
|
||||||
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
|
import { useContacts } from "../hooks/useContacts";
|
||||||
|
import { Button } from '@material-ui/core';
|
||||||
|
|
||||||
|
import PhoneIcon from '@material-ui/icons/Phone';
|
||||||
|
import ChatIcon from '@material-ui/icons/Chat';
|
||||||
|
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme) => ({
|
||||||
|
root: {
|
||||||
|
width: '100%',
|
||||||
|
maxWidth: 360,
|
||||||
|
color: '#fff'
|
||||||
|
},
|
||||||
|
listItem: {
|
||||||
|
color: '#fff'
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const ContactList = ({ children, onCall, onMessage }) => {
|
||||||
|
const classes = useStyles();
|
||||||
|
const [contacts] = useContacts();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<List component='nav' className={classes.root} >
|
||||||
|
{contacts.map((contact) => (
|
||||||
|
<ListItem divider className={classes.listItem}>
|
||||||
|
<ListItemText primary={contact.display} secondary={contact.phoneNumber}/>
|
||||||
|
<Button className={classes.listItem} onClick={onCall}><PhoneIcon/></Button>
|
||||||
|
<Button className={classes.listItem} onClick={onMessage}><ChatIcon/></Button>
|
||||||
|
</ListItem>
|
||||||
|
))}
|
||||||
|
</List>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -6,13 +6,16 @@ import { AppTitle } from "../../../ui/components/AppTitle";
|
|||||||
import { AppContent } from "../../../ui/components/AppContent";
|
import { AppContent } from "../../../ui/components/AppContent";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useContacts } from "../hooks/useContacts";
|
import { useContacts } from "../hooks/useContacts";
|
||||||
|
import { ContactList } from './ContactList';
|
||||||
|
|
||||||
|
|
||||||
const useStyles = makeStyles(() => ({
|
const useStyles = makeStyles(() => ({
|
||||||
root: {
|
root: {
|
||||||
backgroundColor: lightBlue[50],
|
backgroundColor: '#232323',
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
backgroundColor: lightBlue[300],
|
backgroundColor: lightBlue[300],
|
||||||
|
textAlign: 'center'
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@@ -23,7 +26,9 @@ export const ContactsApp = () => {
|
|||||||
return (
|
return (
|
||||||
<AppWrapper className={classes.root}>
|
<AppWrapper className={classes.root}>
|
||||||
<AppTitle className={classes.title}>{t("APPS_CONTACTS")}</AppTitle>
|
<AppTitle className={classes.title}>{t("APPS_CONTACTS")}</AppTitle>
|
||||||
<AppContent>{t("COMING_SOON")}</AppContent>
|
<AppContent>
|
||||||
|
<ContactList onCall={() => console.log("Calling")} onMessage={() => console.log("Opening messages")}/>
|
||||||
|
</AppContent>
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user