From 938156097033a9bde605a4bd4adbe5cda662e901 Mon Sep 17 00:00:00 2001 From: Immanuel Onyeka Date: Fri, 22 Oct 2021 19:13:27 -0400 Subject: [PATCH] Add call details area --- src/App.jsx | 11 +++++++---- src/Call.jsx | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ src/Feed.jsx | 13 ++++++++----- 3 files changed, 69 insertions(+), 9 deletions(-) create mode 100644 src/Call.jsx diff --git a/src/App.jsx b/src/App.jsx index 6f20048..2490f2f 100755 --- a/src/App.jsx +++ b/src/App.jsx @@ -8,21 +8,24 @@ import Call from './Call.jsx'; const App = () => { const [recent, setRecent] = useState(true) - const [call, setCall] = useState() + const [entry, setEntry] = useState() - let focus = setCall(c) }/> - if (call) { - focus = + let focus = setEntry(c) }/> + if (entry) { + focus = } return (
+
setRecent(r) } recent={recent}/> +
{focus}
+
); }; diff --git a/src/Call.jsx b/src/Call.jsx new file mode 100644 index 0000000..ebf0c5c --- /dev/null +++ b/src/Call.jsx @@ -0,0 +1,54 @@ +import React, {useState, useEffect} from 'react'; + +function ContactIcon() { + return ( + + + + + + + ) +} + +function Call(props) { + return ( +
+ + +

{props.info.direction == 'inbound' + ? props.info.from + : props.info.to} +

+ +

+ {new Date(props.info.created_at).toLocaleTimeString([], + {hour: '2-digit', minute: '2-digit'}) + } - {props.info.call_type} +

+ +

+ {parseInt(props.info.duration / 60)} mins + {props.info.duration % 60} seconds +

+ +
+ ) +} + +export default Call diff --git a/src/Feed.jsx b/src/Feed.jsx index 028589d..016cc67 100644 --- a/src/Feed.jsx +++ b/src/Feed.jsx @@ -38,9 +38,9 @@ function PhoneSymbol(props) { } -function DetailSymbol() { +function DetailSymbol(props) { return ( -