From ee3a79fdcf6bf43ffe3f3ef865a9da59d05fa6e2 Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Tue, 13 Feb 2024 14:26:56 -0800 Subject: [PATCH] Remove custom tooltip implementation (#716) --- .../PromptInput/SlashCommands/index.jsx | 9 +++ .../ChatContainer/PromptInput/index.jsx | 62 +++++++++---------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx index 0e4f26aa..1e85d372 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/SlashCommands/index.jsx @@ -1,10 +1,13 @@ import { useEffect, useRef, useState } from "react"; import SlashCommandIcon from "./icons/slash-commands-icon.svg"; +import { Tooltip } from "react-tooltip"; export default function SlashCommandsButton({ showing, setShowSlashCommand }) { return (
setShowSlashCommand(!showing)} className={`flex justify-center items-center opacity-60 hover:opacity-100 cursor-pointer ${ showing ? "!opacity-100" : "" @@ -15,6 +18,12 @@ export default function SlashCommandsButton({ showing, setShowSlashCommand }) { className="w-6 h-6 pointer-events-none" alt="Slash commands button" /> +
); } diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx index e141cc0a..75316308 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/PromptInput/index.jsx @@ -6,7 +6,6 @@ import { Quotes, } from "@phosphor-icons/react"; import React, { useState, useRef } from "react"; -import { isMobile } from "react-device-detect"; import ManageWorkspace, { useManageWorkspaceModal, } from "../../../Modals/MangeWorkspace"; @@ -15,6 +14,8 @@ import SlashCommandsButton, { SlashCommands, useSlashCommands, } from "./SlashCommands"; +import { isMobile } from "react-device-detect"; +import { Tooltip } from "react-tooltip"; export default function PromptInput({ workspace, @@ -98,13 +99,23 @@ export default function PromptInput({
-
+
{user?.role !== "default" && ( - +
+ + +
)} { - setShowTooltip(true); - }, 700) - ); - } - - const cleanupTooltipListener = () => { - clearTimeout(delayHandler); - setShowTooltip(false); - }; - const ModeIcon = chatMode === "chat" ? Chats : Quotes; return (
-
- You are currently in {chatMode} mode. Click to switch to{" "} - {chatMode === "chat" ? "query" : "chat"} mode. -
+
); }