mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 01:21:48 +03:00
parent
c73529885f
commit
202daac77a
@ -1,5 +1,4 @@
|
||||
"use client";
|
||||
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { PiPaperclipFill } from "react-icons/pi";
|
||||
|
||||
@ -23,11 +22,10 @@ export const ChatInput = ({
|
||||
const { t } = useTranslation(["chat"]);
|
||||
|
||||
const { setShouldDisplayFeedCard } = useKnowledgeToFeedContext();
|
||||
const shouldDisplayOnboarding = useFeatureIsOn("onboarding");
|
||||
|
||||
return (
|
||||
<>
|
||||
{shouldDisplayOnboarding && <OnboardingQuestions />}
|
||||
{<OnboardingQuestions />}
|
||||
<div className="flex mt-1 flex-col w-full shadow-md dark:shadow-primary/25 hover:shadow-xl transition-shadow rounded-xl bg-white dark:bg-black border border-black/10 dark:border-white/25 p-2">
|
||||
<form
|
||||
data-testid="chat-input-form"
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
||||
|
||||
import { useChatContext } from "@/lib/context";
|
||||
import { useOnboarding } from "@/lib/hooks/useOnboarding";
|
||||
|
||||
import { ChatDialogue } from "./components/ChatDialogue";
|
||||
import { ShortCuts } from "./components/ShortCuts";
|
||||
@ -13,10 +12,9 @@ export const ChatDialogueArea = (): JSX.Element => {
|
||||
messages,
|
||||
notifications
|
||||
);
|
||||
const shouldDisplayOnboarding = useFeatureIsOn("onboarding");
|
||||
const { isOnboarding } = useOnboarding();
|
||||
|
||||
const shouldDisplayShortcuts =
|
||||
chatItems.length === 0 && !shouldDisplayOnboarding;
|
||||
const shouldDisplayShortcuts = chatItems.length === 0 && !isOnboarding;
|
||||
|
||||
if (!shouldDisplayShortcuts) {
|
||||
return <ChatDialogue chatItems={chatItems} />;
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
||||
import Link from "next/link";
|
||||
import { Fragment } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { RiDownloadLine } from "react-icons/ri";
|
||||
|
||||
@ -19,8 +17,6 @@ export const Onboarding = (): JSX.Element => {
|
||||
const step2 = t("onboarding.step_2");
|
||||
const step3 = t("onboarding.step_3");
|
||||
|
||||
const shouldStepBeDisplayed = useFeatureIsOn("onboarding");
|
||||
|
||||
const { trackOnboardingEvent } = useOnboardingTracker();
|
||||
|
||||
const { streamingText: titleStream, isDone: isTitleDisplayed } =
|
||||
@ -49,10 +45,6 @@ export const Onboarding = (): JSX.Element => {
|
||||
enabled: isStep2Done,
|
||||
});
|
||||
|
||||
if (!shouldStepBeDisplayed) {
|
||||
return <Fragment />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-2 mb-3">
|
||||
<MessageRow speaker={"assistant"} brainName={"Quivr"}>
|
||||
|
@ -1,4 +1,3 @@
|
||||
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { useParams } from "next/navigation";
|
||||
|
||||
@ -9,7 +8,6 @@ import { Onboarding } from "../types/Onboarding";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
export const useOnboarding = () => {
|
||||
const isOnboardingFeatureActivated = useFeatureIsOn("onboarding");
|
||||
const { getOnboarding } = useOnboardingApi();
|
||||
const params = useParams();
|
||||
const { updateOnboarding } = useOnboardingApi();
|
||||
@ -38,13 +36,10 @@ export const useOnboarding = () => {
|
||||
await queryClient.invalidateQueries({ queryKey: [ONBOARDING_DATA_KEY] });
|
||||
};
|
||||
|
||||
const shouldDisplayWelcomeChat =
|
||||
isOnboardingFeatureActivated && onboarding.onboarding_a;
|
||||
const shouldDisplayWelcomeChat = onboarding.onboarding_a;
|
||||
|
||||
const shouldDisplayOnboardingAInstructions =
|
||||
isOnboardingFeatureActivated &&
|
||||
chatId === undefined &&
|
||||
shouldDisplayWelcomeChat;
|
||||
chatId === undefined && shouldDisplayWelcomeChat;
|
||||
|
||||
return {
|
||||
onboarding,
|
||||
|
Loading…
Reference in New Issue
Block a user