Skip to content

Commit

Permalink
feat: change icon to open history sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mrevanzak committed Jun 28, 2024
1 parent 441671d commit 281b50f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Footer } from "@/components/footer";
import { Navbar } from "@/components/navbar";
import { Sidebar } from "@/components/sidebar/sidebar";
import { SidebarUser } from "@/components/sidebar/sidebar-user";
import { env } from "@/env";
import { auth } from "@/server/auth";
import { get } from "@vercel/edge-config";

import { cn } from "@tanya.in/ui";

import ErrorPage from "../error";
import { ChatHistory } from "./@user/history";

export default async function AuthLayout(props: {
user: React.ReactNode;
Expand Down Expand Up @@ -37,7 +37,7 @@ export default async function AuthLayout(props: {
className="relative flex min-h-screen w-full bg-content2 dark:bg-background"
vaul-drawer-wrapper=""
>
{isAdmin ? <Sidebar /> : <ChatHistory />}
{isAdmin ? <Sidebar /> : <SidebarUser />}
<div className="flex flex-1 flex-col overflow-x-hidden">
<Navbar />
<main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { ThemeToggle } from "@/components/theme-toggle";
import { api } from "@/trpc/react";
import { Tab, Tabs, Tooltip } from "@nextui-org/react";
import { useTranslations } from "next-intl";
import { FaChevronRight, FaPlus } from "react-icons/fa6";
import { IoMenu } from "react-icons/io5";
import { FaPlus } from "react-icons/fa6";
import { MdHistory } from "react-icons/md";
import { useMediaQuery } from "usehooks-ts";

import { Button } from "@tanya.in/ui/button";
Expand Down Expand Up @@ -57,7 +57,7 @@ function Content() {
);
}

export function ChatHistory() {
export function SidebarUser() {
const [open, setOpen] = useState(false);
const router = useRouter();
const isMobile = useMediaQuery("(max-width: 768px)");
Expand All @@ -76,7 +76,7 @@ export function ChatHistory() {
variant="solid"
color="warning"
>
<IoMenu className="size-5" />
<MdHistory className="size-7" />
</Button>
</DrawerTrigger>
<DrawerContent className="min-h-[60vh] bg-content1">
Expand Down Expand Up @@ -125,14 +125,14 @@ export function ChatHistory() {

<Tooltip content={t("show")} placement="bottom-end">
<Button
className="absolute -right-7 top-1/4 z-10"
className="absolute -right-5 top-1/4 z-10"
isIconOnly
onClick={() => setOpen(!open)}
radius="full"
variant="solid"
color="warning"
>
<FaChevronRight className="size-5 transition-transform duration-500 group-data-[open=true]:rotate-180" />
<MdHistory className="size-7 transition-transform duration-500 group-data-[open=true]:rotate-180" />
</Button>
</Tooltip>

Expand Down

0 comments on commit 281b50f

Please sign in to comment.