From c8a10144ef7e40cde724977fa371d6a00428f4df Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 25 Jan 2022 00:07:38 -0800 Subject: [PATCH] building initial onboarding teaching --- components/Modals/ShortcutHelpModal.tsx | 132 ++++++++++++++++-- .../undraw_takeout_boxes_ap54.svg | 1 + styles/globals.css | 7 + 3 files changed, 128 insertions(+), 12 deletions(-) create mode 100644 public/illustrations/undraw_takeout_boxes_ap54.svg diff --git a/components/Modals/ShortcutHelpModal.tsx b/components/Modals/ShortcutHelpModal.tsx index cc7f2d1..838d66b 100644 --- a/components/Modals/ShortcutHelpModal.tsx +++ b/components/Modals/ShortcutHelpModal.tsx @@ -1,24 +1,35 @@ -import { Carousel, Modal } from "antd"; -import { useState } from "react"; +import { Carousel, Drawer, Modal } from "antd"; +import { useRef, useState } from "react"; import { GlobalHotKeys, KeyMap } from "react-hotkeys"; +import { FaArrowLeft, FaArrowRight, FaUserCheck } from "react-icons/fa"; +import { useKeyboardContext } from "../../contexts/keyboardContext"; export default function ShortcutHelpModal() { const [visible, setVisible] = useState(false); + const carouselRef = useRef(); + const { isRecording } = useKeyboardContext(); - function handleToggleModal() { - setVisible((pv) => !pv); + function handleShowModal() { + setVisible(true); + } + function handleDismissModal() { + setVisible(false); } const keyMap: KeyMap = { - SHOW_HELP_MODAL: "/", + SHOW_HELP_MODAL: { + name: "show help modal", + sequence: "/", + action: "keyup", + }, }; - const handlers = { SHOW_HELP_MODAL: handleToggleModal }; + const handlers = { SHOW_HELP_MODAL: handleShowModal }; return ( <> {/* fixed help on bottom left */} Help @@ -33,18 +44,115 @@ export default function ShortcutHelpModal() { + {/* */} + } + zIndex={5} > - +
-

1

+ + + carouselRef.current.prev()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + + + Select a Teammate + + + Type numbers on your keyboard. + + + + + + + ... + + + + carouselRef.current.next()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + + +
-

2

+ + + carouselRef.current.prev()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + + + Send an Audio Message + + + Press and hold R. Try it now! + + + + + + carouselRef.current.next()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + + +

3

diff --git a/public/illustrations/undraw_takeout_boxes_ap54.svg b/public/illustrations/undraw_takeout_boxes_ap54.svg new file mode 100644 index 0000000..faa0caf --- /dev/null +++ b/public/illustrations/undraw_takeout_boxes_ap54.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/styles/globals.css b/styles/globals.css index 872d8c2..9131d52 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -114,6 +114,13 @@ p { @apply bg-white text-black rounded !important; } +.slick-dots > li { + @apply bg-teal-600 !important; +} +li.slick-active button { + @apply bg-orange-500 !important; +} + /* scrollbar customization */ ::-webkit-scrollbar { height: 5px;