mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
I really hope I didnt fuck anything up now
This commit is contained in:
1 parent
ad20755608
commit
ec37fcde46
67 files changed
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import React from "react";
|
||||
import ListItemText from "@material-ui/core/ListItemText";
|
||||
import { Button } from "@material-ui/core";
|
||||
|
||||
import PhoneIcon from "@material-ui/icons/Phone";
|
||||
import ChatIcon from "@material-ui/icons/Chat";
|
||||
import { List } from "../../../ui/components/List";
|
||||
import { ListItem } from "../../../ui/components/ListItem";
|
||||
|
||||
export const ContactList = ({ contacts, onCall, onMessage }) => {
|
||||
return (
|
||||
<List>
|
||||
{contacts.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
<ListItemText
|
||||
primary={contact.display}
|
||||
secondary={contact.phoneNumber}
|
||||
/>
|
||||
<Button onClick={() => onCall(contact.display)}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button onClick={onMessage}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||
import { AppContent } from "../../../ui/components/AppContent";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useContacts } from "../hooks/useContacts";
|
||||
import { ContactList } from "./ContactList";
|
||||
import { useApps } from "../../appmarket/hooks/useApps";
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const { contactList } = useContacts();
|
||||
const { getApp } = useApps();
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<AppWrapper>
|
||||
<AppTitle color={getApp("contacts").backgroundColor}>
|
||||
{t("APPS_CONTACTS")}
|
||||
</AppTitle>
|
||||
<AppContent>
|
||||
<ContactList
|
||||
contacts={contactList}
|
||||
onCall={(contact => console.log(contact))}
|
||||
onMessage={() => console.log("Opening messages")}
|
||||
/>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user