docs: redesign search + re-introduce ai assistant in v2 docs (#8678)
* docs: redesign search + re-introduce ai assistant in v2 * change version in ui * show icon in case of error * fixes based on feedback
This commit is contained in:
@@ -13,6 +13,7 @@ export type AiAssistantContextType = {
|
||||
questionId: string,
|
||||
reaction: AiAssistantFeedbackType
|
||||
) => Promise<Response>
|
||||
version: "v1" | "v2"
|
||||
}
|
||||
|
||||
const AiAssistantContext = createContext<AiAssistantContextType | null>(null)
|
||||
@@ -22,12 +23,14 @@ export type AiAssistantProviderProps = {
|
||||
apiUrl: string
|
||||
recaptchaSiteKey: string
|
||||
websiteId: string
|
||||
version?: "v1" | "v2"
|
||||
}
|
||||
|
||||
export const AiAssistantProvider = ({
|
||||
apiUrl,
|
||||
recaptchaSiteKey,
|
||||
websiteId,
|
||||
version = "v2",
|
||||
children,
|
||||
}: AiAssistantProviderProps) => {
|
||||
const { analytics } = useAnalytics()
|
||||
@@ -90,6 +93,7 @@ export const AiAssistantProvider = ({
|
||||
value={{
|
||||
getAnswer,
|
||||
sendFeedback,
|
||||
version,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -131,14 +131,9 @@ export const SearchProvider = ({
|
||||
<Modal
|
||||
contentClassName={clsx(
|
||||
"!p-0 overflow-hidden relative h-full",
|
||||
"rounded-none md:rounded-docs_lg flex flex-col justify-between"
|
||||
)}
|
||||
modalContainerClassName={clsx(
|
||||
"!rounded-none md:!rounded-docs_lg",
|
||||
"md:!h-[480px] h-screen",
|
||||
"md:!w-[640px] w-screen",
|
||||
"bg-medusa-bg-base"
|
||||
"flex flex-col justify-between"
|
||||
)}
|
||||
modalContainerClassName="sm:h-[480px] sm:max-h-[480px]"
|
||||
open={isOpen}
|
||||
onClose={() => setIsOpen(false)}
|
||||
passedRef={modalRef}
|
||||
@@ -156,7 +151,7 @@ export const SearchProvider = ({
|
||||
? "animate-fadeOutLeft animate-fast"
|
||||
: "animate-fadeOutRight animate-fast",
|
||||
}}
|
||||
timeout={300}
|
||||
timeout={250}
|
||||
key={command?.name || "search"}
|
||||
>
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user