From e77e7d17e0797d901ef60cd06fa2ed2d9601ef76 Mon Sep 17 00:00:00 2001 From: m5r Date: Mon, 30 Aug 2021 08:43:39 +0800 Subject: [PATCH] tap phone button in keypad to "paste" latest recipient --- app/phone-calls/pages/keypad.tsx | 34 ++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/app/phone-calls/pages/keypad.tsx b/app/phone-calls/pages/keypad.tsx index ce11d55..ea8ad38 100644 --- a/app/phone-calls/pages/keypad.tsx +++ b/app/phone-calls/pages/keypad.tsx @@ -7,13 +7,16 @@ import { Transition } from "@headlessui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faBackspace, faPhoneAlt as faPhone } from "@fortawesome/pro-solid-svg-icons"; +import { Direction } from "db"; import Layout from "../../core/layouts/layout"; import Keypad from "../components/keypad"; import useRequireOnboarding from "../../core/hooks/use-require-onboarding"; +import usePhoneCalls from "../hooks/use-phone-calls"; const KeypadPage: BlitzPage = () => { useRequireOnboarding(); const router = useRouter(); + const [phoneCalls] = usePhoneCalls(); const [phoneNumber, setPhoneNumber] = useAtom(phoneNumberAtom); const removeDigit = useAtom(pressBackspaceAtom)[1]; const timeoutRef = useRef | null>(null); @@ -71,21 +74,26 @@ const KeypadPage: BlitzPage = () => { - - - + return; + } + + await router.push(Routes.OutgoingCall({ recipient: encodeURI(phoneNumber) })); + setPhoneNumber(""); + }} + className="cursor-pointer select-none col-start-2 h-12 w-12 flex justify-center items-center mx-auto bg-green-800 rounded-full" + > + +