feat: update version to 1.4.6 and enhance code block component with download and copy sticky support

This commit is contained in:
n4ze3m
2025-02-08 12:48:49 +05:30
parent a46156847d
commit 40698e02d7
9 changed files with 324 additions and 553 deletions

View File

@@ -89,10 +89,9 @@ export const Header: React.FC<Props> = ({
}
}
return (
<div
className={`absolute top-0 z-10 w-full flex h-14 p-3 bg-gray-50 border-b dark:bg-[#171717] dark:border-gray-600 ${
className={`absolute top-0 z-10 flex h-14 w-full flex-row items-center justify-center p-3 overflow-x-auto lg:overflow-x-visible bg-gray-50 border-b dark:bg-[#171717] dark:border-gray-600 ${
temporaryChat && "!bg-gray-200 dark:!bg-black"
}`}>
<div className="flex gap-2 items-center">
@@ -210,12 +209,6 @@ export const Header: React.FC<Props> = ({
<div className="flex flex-1 justify-end px-4">
<div className="ml-4 flex items-center md:ml-6">
<div className="flex gap-4 items-center">
{/* {pathname === "/" &&
messages.length > 0 &&
!streaming &&
shareModeEnabled && (
<ShareBtn historyId={historyId} messages={messages} />
)} */}
{messages.length > 0 && !streaming && (
<MoreOptions
shareModeEnabled={shareModeEnabled}
@@ -247,7 +240,7 @@ export const Header: React.FC<Props> = ({
<CogIcon className="w-6 h-6" />
</NavLink>
</Tooltip>
</div>
</div>
</div>
</div>
</div>

View File

@@ -39,13 +39,16 @@ export default function OptionLayout({
<div className="flex h-full w-full">
<main className="relative h-dvh w-full">
<div className="relative z-10 w-full">
<div className="pointer-events-none absolute inset-x-0 top-0 z-10 h-24 overflow-hidden sm:h-20">
<div className="bgGradientMask bg-background h-dvh w-screen"></div>
</div>
<Header
setSidebarOpen={setSidebarOpen}
setOpenModelSettings={setOpenModelSettings}
/>
</div>
{/* <div className="relative flex h-full flex-col items-center"> */}
{children}
{children}
{/* </div> */}
<Drawer
title={

View File

@@ -20,9 +20,7 @@ export const NewChat: React.FC<Props> = ({ clearChat }) => {
<label className="flex items-center gap-6 justify-between px-1 py-0.5 cursor-pointer w-full">
<div className="flex items-center gap-2">
<TimerReset className="h-4 w-4 text-gray-600" />
<span>
{t("temporaryChat")}
</span>
<span>{t("temporaryChat")}</span>
</div>
<Switch
checked={temporaryChat}
@@ -44,14 +42,14 @@ export const NewChat: React.FC<Props> = ({ clearChat }) => {
<button
onClick={clearChat}
className="inline-flex dark:bg-transparent bg-white items-center rounded-s-lg rounded-e-none border dark:border-gray-700 bg-transparent px-3 py-2.5 pe-6 text-xs lg:text-sm font-medium leading-4 text-gray-800 dark:text-white disabled:opacity-50 ease-in-out transition-colors duration-200 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white">
<SquarePen className="h-5 w-5" />
<span className="truncate ms-3">{t("newChat")}</span>
</button>
<SquarePen className="size-4 sm:size-5" />
<span className="truncate ms-3 hidden sm:inline">{t("newChat")}</span>
</button>{" "}
<Dropdown menu={{ items }} trigger={["click"]}>
<button className="inline-flex dark:bg-transparent bg-white items-center rounded-lg border-s-0 rounded-s-none border dark:border-gray-700 bg-transparent px-3 py-2.5 text-xs lg:text-sm font-medium leading-4 text-gray-800 dark:text-white disabled:opacity-50 ease-in-out transition-colors duration-200 hover:bg-gray-100 dark:hover:bg-gray-800 dark:hover:text-white">
<MoreHorizontal className="h-5 w-5 text-gray-600 dark:text-gray-400" />
<MoreHorizontal className="size-4 sm:size-5 text-gray-600 dark:text-gray-400" />
</button>
</Dropdown>
</div>
)
}
}