mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Add phone service, rename phone app to dialer, etc improvements
This commit is contained in:
1 parent
bf2e7fa295
commit
b2e0cba844
24 files changed
+311
-255
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import React from "react";
|
||||
import { AppWrapper } from "../../../ui/components";
|
||||
import { AppTitle } from "../../../ui/components/AppTitle";
|
||||
import { AppContent } from "../../../ui/components/AppContent";
|
||||
import { DialerHistory } from "./DialerHistory";
|
||||
import { useDialerHistory } from "../hooks/useDialerHistory";
|
||||
import { useApp } from "../../../os/apps/hooks/useApps";
|
||||
|
||||
export const DialerApp = () => {
|
||||
const { history } = useDialerHistory();
|
||||
const dialer = useApp("DIALER");
|
||||
return (
|
||||
<AppWrapper>
|
||||
<AppTitle {...dialer} />
|
||||
<AppContent>
|
||||
<DialerHistory calls={history} />
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import React from "react";
|
||||
import ListItemText from "@material-ui/core/ListItemText";
|
||||
import PhoneCallbackIcon from "@material-ui/icons/PhoneCallback";
|
||||
import PhoneForwardedIcon from "@material-ui/icons/PhoneForwarded";
|
||||
import { List } from "../../../ui/components/List";
|
||||
import { ListItem } from "../../../ui/components/ListItem";
|
||||
|
||||
const CallTypeIcon = {
|
||||
incoming: <PhoneCallbackIcon />,
|
||||
outgoing: <PhoneForwardedIcon />,
|
||||
};
|
||||
|
||||
export const DialerHistory = ({ calls }) => {
|
||||
return (
|
||||
<List>
|
||||
{calls.map((call) => (
|
||||
<ListItem key={call.id} divider>
|
||||
<ListItemText primary={call.caller} secondary={call.phoneNumber} />
|
||||
{CallTypeIcon[call.type]}
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
import { useRecoilState, atom } from "recoil";
|
||||
|
||||
const dialerHistoryState = atom({
|
||||
key: "dialerHistory",
|
||||
default: [
|
||||
{
|
||||
id: 0,
|
||||
caller: "Kidz",
|
||||
phoneNumber: "000-1111",
|
||||
type: "incoming",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
caller: "ROCKY",
|
||||
phoneNumber: "000-1112",
|
||||
type: "outgoing",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export const useDialerHistory = () => {
|
||||
const [history, setHistory] = useRecoilState(dialerHistoryState);
|
||||
return { history, setHistory };
|
||||
};
|
||||
Reference in new issue
Block a user