Skip to content

Commit cafde5a

Browse files
committed
feat(chatui): add resize functionality to chat window
1 parent 206573e commit cafde5a

File tree

16 files changed

+190
-277
lines changed

16 files changed

+190
-277
lines changed

apps/docs/app/(docs)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function Layout({ children }: { children: ReactNode }) {
5656
},
5757
}}
5858
sidebar={{
59-
collapsible: false,
59+
collapsible: true,
6060
}}
6161
>
6262
<WrapperLayout isHomeLayout={false}>

apps/docs/app/(home)/page.mdx

Lines changed: 21 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ import { iconResolver } from "@/lib/iconResolver";
2020
import { Cards } from "fumadocs-ui/components/card";
2121
import {
2222
Card,
23-
CardAction,
24-
CardContent,
25-
CardDescription,
26-
CardFooter,
2723
CardHeader,
24+
CardDescription,
2825
CardTitle,
2926
} from "@/components/ui/card";
3027
import {
@@ -39,6 +36,8 @@ import {
3936
DocumentCheckIcon,
4037
CloudIcon,
4138
} from "@heroicons/react/24/solid";
39+
import * as heroIcons from '@heroicons/react/24/solid';
40+
import {linksApi} from "@/data/links-api";
4241

4342
<main className="min-h-screen">
4443
<section className="py-16 sm:py-20 lg:py-32 xl:py-36">
@@ -96,97 +95,29 @@ import {
9695
<section className="py-16 sm:py-20 lg:py-32 xl:py-36 relative">
9796
<div className="container mx-auto px-4 sm:px-6 lg:px-8">
9897
<div className="text-center mb-16">
99-
<h2 className="font-heading font-bold text-3xl lg:text-4xl mb-4">Has everything you need</h2>
98+
<h2 className="font-heading font-bold text-3xl lg:text-4xl mb-4">Mesh has everything you need</h2>
10099
<div className="text-xl max-w-2xl mx-auto">
101100
Comprehensive suite of tools and libraries to help you build amazing applications
102101
</div>
103102
</div>
104103

105-
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6 items-stretch">
106-
{[
107-
{
108-
title: "Wallets",
109-
href: "/apis/wallets",
110-
icon: <WalletIcon />,
111-
description: "Wallets APIs for interacting with the blockchain"
112-
},
113-
{
114-
title: "Transaction Builder",
115-
href: "/apis/txbuilder",
116-
icon: <BanknotesIcon />,
117-
description: "Build transactions with cardano-cli like APIs"
118-
},
119-
{
120-
title: "Transaction Parser",
121-
href: "/apis/txparser",
122-
icon: <MagnifyingGlassIcon />,
123-
description: "Parse transactions for testing and rebuilding"
124-
},
125-
{
126-
title: "Providers",
127-
href: "/providers",
128-
icon: <CloudIcon />,
129-
description: "Data providers for connecting to the blockchain"
130-
},
131-
{
132-
title: "Utilities",
133-
href: "/apis/utilities",
134-
icon: <WrenchScrewdriverIcon />,
135-
description: "Serializers, resolvers and data types for converting between different formats"
136-
},
137-
{
138-
title: "React Components",
139-
href: "/react",
140-
icon: <ComputerDesktopIcon />,
141-
description: "Frontend React UI components and React hooks"
142-
},
143-
{
144-
title: "Svelte Components",
145-
href: "/svelte",
146-
icon: <ComputerDesktopIcon />,
147-
description: "Svelte UI components for wallet connections"
148-
},
149-
{
150-
title: "Smart Contract Library",
151-
href: "/smart-contracts",
152-
icon: <DocumentCheckIcon />,
153-
description: "Open-source smart contracts, complete with documentation, and live demos"
154-
},
155-
{
156-
title: "Aiken",
157-
href: "/aiken",
158-
icon: iconResolver("icons/aiken.png"),
159-
description: "Function programming language created for Cardano smart contract development"
160-
},
161-
{
162-
title: "Hydra",
163-
href: "/hydra",
164-
icon: iconResolver("icons/hydra.svg"),
165-
description: "Layer 2 scaling solution for Cardano"
166-
},
167-
{
168-
title: "Yaci",
169-
href: "/yaci",
170-
icon: iconResolver("icons/yaci.png"),
171-
description: "Custom devnet to tailor your devnet needs with a builtin indexer"
172-
},
173-
{
174-
title: "Midnight",
175-
href: "https://midnight.meshjs.dev/en",
176-
icon: iconResolver("icons/midnight.svg", "invert dark:invert-0"),
177-
description: "Leveraging zero-knowledge technology to enable data protection"
178-
},
179-
{
180-
title: "Wallet as a Service",
181-
href: "https://utxos.dev/",
182-
icon: iconResolver("icons/mesh.svg", "invert dark:invert-0"),
183-
description: "Access self-custodial wallet using social logins"
184-
}
185-
].map((card) => (
186-
<Link key={card.title} href={card.href}>
187-
<Card className="h-full text-center hover:border-primary/50 transition-colors px-4 py-8">
188-
<CardTitle className="font-heading">{card.title}</CardTitle>
189-
<CardDescription>{card.description}</CardDescription>
104+
<div className="grid md:grid-cols-2 lg:grid-cols-3 gap-6 items-stretch">
105+
{linksApi.map((item) => (
106+
<Link key={item.title} href={item.link}>
107+
<Card className="h-full hover:border-primary/50 transition-colors px-4 py-8">
108+
<CardHeader>
109+
<div className="w-12 h-12 bg-gradient-to-br from-primary/20 to-primary/10 rounded-lg flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300">
110+
{typeof item.icon === typeof heroIcons ? (
111+
<item.icon className="w-6 h-6" />
112+
) :
113+
<div>
114+
{iconResolver(item.icon, "w-6 h-6 object-contain")}
115+
</div>
116+
}
117+
</div>
118+
<CardTitle className="font-heading">{item.title}</CardTitle>
119+
<CardDescription>{item.desc}</CardDescription>
120+
</CardHeader>
190121
</Card>
191122
</Link>
192123
))}

apps/docs/components/layout/WrapperLayout.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ReactNode, useEffect, useState } from "react";
33
import { useAISidebar } from "@/context/AISidebarContext";
44
import { MobileAISearch } from "../ai/search";
5-
import { AISearch as SearchAI } from "../ai/search";
5+
import Sidebar from "../ui/Sidebar";
66

77

88
export function WrapperLayout({ isHomeLayout, children }: { isHomeLayout: boolean, children: ReactNode }) {
@@ -21,13 +21,11 @@ export function WrapperLayout({ isHomeLayout, children }: { isHomeLayout: boolea
2121
const usedHeight = isHomeLayout ? "56px" : "0px"
2222

2323
return (
24-
<div className="flex" style={{ minHeight: `calc(100vh - ${usedHeight})` }}>
24+
<div className="flex w-full" style={{ minHeight: `calc(100vh - ${usedHeight})` }}>
2525
<div
26-
className={`flex flex-col flex-1 ${
27-
isAISidebarOpen ? 'max-w-3/4' : 'max-w-full'
28-
}`}
26+
className="flex-1 min-w-0"
2927
>
30-
<div className="flex flex-col h-full w-full max-w-[1280px] px-4 mx-auto mb-16">
28+
<div className="flex flex-col h-full max-w-[1280px] px-4 mx-auto mb-16">
3129
{children}
3230
</div>
3331
</div>
@@ -41,11 +39,11 @@ export function WrapperLayout({ isHomeLayout, children }: { isHomeLayout: boolea
4139
)}
4240

4341
{ !isMobile && (
44-
<div className="hidden md:flex flex-col w-1/4 sticky" style={{
42+
<div className="hidden md:flex flex-col sticky shrink-0" style={{
4543
top: usedHeight,
4644
height: `calc(100vh - ${usedHeight})`,
4745
}}>
48-
<SearchAI open={isAISidebarOpen} onOpenChange={setIsAISidebarOpen} />
46+
<Sidebar usedHeight={usedHeight} isAISidebarOpen={isAISidebarOpen} setIsAISidebarOpen={setIsAISidebarOpen} />
4947
</div>
5048
)}
5149
</>

0 commit comments

Comments
 (0)