Skip to content

Commit

Permalink
Merge pull request #2 from athrael-soju/revert-1-jp/new-shadcn-sidebar
Browse files Browse the repository at this point in the history
Revert "Jp/new shadcn sidebar"
  • Loading branch information
athrael-soju authored Oct 23, 2024
2 parents a825e15 + 3ff8100 commit 2169ae3
Show file tree
Hide file tree
Showing 17 changed files with 402 additions and 1,285 deletions.
21 changes: 0 additions & 21 deletions app/(chat)/layout.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
.dark {
--background: 240 10% 3.9%;
Expand All @@ -83,14 +75,6 @@
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
}
}

Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Metadata } from 'next';
import { Toaster } from 'sonner';

import { Navbar } from '@/components/custom/navbar';
import { ThemeProvider } from '@/components/custom/theme-provider';

import './globals.css';
Expand Down Expand Up @@ -64,6 +65,7 @@ export default async function RootLayout({
disableTransitionOnChange
>
<Toaster position="top-center" />
<Navbar />
{children}
</ThemeProvider>
</body>
Expand Down
234 changes: 0 additions & 234 deletions components/app-sidebar.tsx

This file was deleted.

27 changes: 10 additions & 17 deletions components/custom/chat.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
'use client';
"use client";

import { Attachment, Message } from 'ai';
import { useChat } from 'ai/react';
import { useState } from 'react';
import { Attachment, Message } from "ai";
import { useChat } from "ai/react";
import { useState } from "react";

import { Message as PreviewMessage } from '@/components/custom/message';
import { useScrollToBottom } from '@/components/custom/use-scroll-to-bottom';
import { cn } from '@/lib/utils';
import { Message as PreviewMessage } from "@/components/custom/message";
import { useScrollToBottom } from "@/components/custom/use-scroll-to-bottom";

import { MultimodalInput } from './multimodal-input';
import { Overview } from './overview';
import { useSidebar } from '../ui/sidebar';
import { MultimodalInput } from "./multimodal-input";
import { Overview } from "./overview";

export function Chat({
id,
Expand All @@ -24,10 +22,9 @@ export function Chat({
body: { id },
initialMessages,
onFinish: () => {
window.history.replaceState({}, '', `/chat/${id}`);
window.history.replaceState({}, "", `/chat/${id}`);
},
});
const { open } = useSidebar();

const [messagesContainerRef, messagesEndRef] =
useScrollToBottom<HTMLDivElement>();
Expand All @@ -39,11 +36,7 @@ export function Chat({
<div className="flex flex-col justify-between items-center gap-4">
<div
ref={messagesContainerRef}
className={cn(
'flex flex-col gap-4 h-full items-center overflow-y-scroll',
open && 'w-[calc(100dvw-var(--sidebar-width))]',
!open && 'w-dvw'
)}
className="flex flex-col gap-4 h-full w-dvw items-center overflow-y-scroll"
>
{messages.length === 0 && <Overview />}

Expand Down
Loading

0 comments on commit 2169ae3

Please sign in to comment.