diff --git a/components/Modals/ShortcutHelpModal.tsx b/components/Modals/ShortcutHelpModal.tsx index b1eac54..2d92bef 100644 --- a/components/Modals/ShortcutHelpModal.tsx +++ b/components/Modals/ShortcutHelpModal.tsx @@ -1,6 +1,6 @@ import { Carousel, Divider, Drawer, Modal } from "antd"; import { CarouselRef } from "antd/lib/carousel"; -import { useRef, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import { GlobalHotKeys, KeyMap } from "react-hotkeys"; import { BsThreeDots } from "react-icons/bs"; import { @@ -15,6 +15,8 @@ import { FcGoogle } from "react-icons/fc"; import { useKeyboardContext } from "../../contexts/keyboardContext"; import Rooms from "../demo/Rooms"; import Image from "next/image"; +import Cookies from "js-cookie"; +import { CookieType } from "../../helpers/cookies"; export default function ShortcutHelpModal() { const [visible, setVisible] = useState(false); @@ -22,6 +24,15 @@ export default function ShortcutHelpModal() { const { isRecording } = useKeyboardContext(); + useEffect(() => { + // if have the specific cookie, then don't show the modal, otherwise show the modal + const cookie = Cookies.get(CookieType.TEAM_SHORTCUTS_ONBOARDING); + if (!cookie) { + setVisible(true); + Cookies.set(CookieType.TEAM_SHORTCUTS_ONBOARDING, "true"); + } + }, []); + function handleShowModal() { setVisible(true); } @@ -75,147 +86,6 @@ export default function ShortcutHelpModal() { width={750} > -
- - - carouselRef.current.prev()} - className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" - /> - - Audio Messages - - carouselRef.current.next()} - className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" - /> - - - - - - Select a Teammate - - - Type numbers on your keyboard. - - - - - - - ... - - - - - - - - - - - - - - Send an Audio Message - - - Press and hold R.{" "} - - Your teammate will

hear you instantly -
{" "} - if they are online. -
- - As if they were across the table. - - - -
-
- - - - - - - Play Incoming Message - - - Select teammate and then press SPACE

to listen to - the last conversation. -
- {/* - Deselect teammate by pressing

ESC. -
*/} - - -
- - -
- - - - - - - - Clear Your View - - Deselect teammate and

stop playing audio by - pressing ESC. -
- - -
-
-
-
@@ -395,11 +265,11 @@ export default function ShortcutHelpModal() { {"Cross Collaborate"} - Walk into the office with clarity of team

+ Walk into the office with clarity of what

- conversations are going on{" "} + team conversations{" "} {" "} - across the hall. + are going on across the hall.
@@ -410,6 +280,147 @@ export default function ShortcutHelpModal() {
+
+ + + carouselRef.current.prev()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + Audio Messages + + carouselRef.current.next()} + className="hover:cursor-pointer bg-teal-600 text-white p-1 rounded-full text-xl" + /> + + + + + + Select a Teammate + + + Type numbers on your keyboard. + + + + + + + ... + + + + + + + + + + + + + + Send an Audio Message + + + Press and hold R.{" "} + + Your teammate will

hear you instantly +
{" "} + if they are online. +
+ + As if they were across the table. + + + +
+
+ + + + + + + Play Incoming Message + + + Select teammate and then press SPACE

to listen to + the last conversation. +
+ {/* + Deselect teammate by pressing

ESC. +
*/} + + +
+ + +
+ + + + + + + + Clear Your View + + Deselect teammate and

stop playing audio by + pressing ESC. +
+ + +
+
+
+
diff --git a/helpers/cookies.ts b/helpers/cookies.ts new file mode 100644 index 0000000..10cbd41 --- /dev/null +++ b/helpers/cookies.ts @@ -0,0 +1,3 @@ +export enum CookieType { + TEAM_SHORTCUTS_ONBOARDING = "TEAM_SHORTCUTS_ONBOARDING", +}