-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### What problem does this PR solve? Feat: Add Sessions component #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
- Loading branch information
Showing
11 changed files
with
130 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { ArrowLeft } from 'lucide-react'; | ||
import { PropsWithChildren, ReactNode } from 'react'; | ||
import { Button } from './ui/button'; | ||
|
||
interface IPageHeaderProps extends PropsWithChildren { | ||
back(): void; | ||
title: ReactNode; | ||
} | ||
|
||
export function PageHeader({ back, title, children }: IPageHeaderProps) { | ||
return ( | ||
<header className="flex justify-between items-center border-b pr-9"> | ||
<div className="flex items-center "> | ||
<div className="flex items-center border-r p-1.5"> | ||
<Button variant="ghost" size="icon" onClick={back}> | ||
<ArrowLeft className="w-5 h-5" /> | ||
</Button> | ||
</div> | ||
<div className="p-4"> | ||
<h1 className="text-2xl font-semibold tracking-tight">{title}</h1> | ||
</div> | ||
</div> | ||
{children} | ||
</header> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function AppSettings() { | ||
return <section className="p-6 w-[400px] max-w-[20%]">app-settings</section>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function ChatBox() { | ||
return <section className="border-x flex-1">ChatBox</section>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { PageHeader } from '@/components/page-header'; | ||
import { Button } from '@/components/ui/button'; | ||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks'; | ||
import { EllipsisVertical } from 'lucide-react'; | ||
import { AppSettings } from './app-settings'; | ||
import { ChatBox } from './chat-box'; | ||
import { Sessions } from './sessions'; | ||
|
||
export default function Chat() { | ||
const { navigateToChatList } = useNavigatePage(); | ||
|
||
return ( | ||
<section className="h-full flex flex-col"> | ||
<PageHeader back={navigateToChatList} title="Chat app 01"> | ||
<div className="flex items-center gap-2"> | ||
<Button variant={'icon'} size={'icon'}> | ||
<EllipsisVertical /> | ||
</Button> | ||
<Button variant={'tertiary'} size={'sm'}> | ||
Publish | ||
</Button> | ||
</div> | ||
</PageHeader> | ||
<div className="flex flex-1"> | ||
<Sessions></Sessions> | ||
<ChatBox></ChatBox> | ||
<AppSettings></AppSettings> | ||
</div> | ||
</section> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Button } from '@/components/ui/button'; | ||
import { Card, CardContent } from '@/components/ui/card'; | ||
import { EllipsisVertical, Plus } from 'lucide-react'; | ||
|
||
function SessionCard() { | ||
return ( | ||
<Card className="bg-colors-background-inverse-weak border-colors-outline-neutral-standard"> | ||
<CardContent className="px-3 py-2 flex justify-between items-center"> | ||
xxx | ||
<Button variant={'icon'} size={'icon'}> | ||
<EllipsisVertical /> | ||
</Button> | ||
</CardContent> | ||
</Card> | ||
); | ||
} | ||
|
||
export function Sessions() { | ||
const sessionList = new Array(10).fill(1); | ||
|
||
return ( | ||
<section className="p-6 w-[400px] max-w-[20%]"> | ||
<div className="flex justify-between items-center mb-4"> | ||
<span className="text-colors-text-neutral-strong text-2xl font-bold"> | ||
Sessions | ||
</span> | ||
<Button variant={'icon'} size={'icon'}> | ||
<Plus></Plus> | ||
</Button> | ||
</div> | ||
<div className="space-y-4"> | ||
{sessionList.map((x) => ( | ||
<SessionCard key={x.id}></SessionCard> | ||
))} | ||
</div> | ||
</section> | ||
); | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters