Skip to content

Commit 036c829

Browse files
committed
feat(www): add basic layout including header, footer and meta
- Added new UI components including Badge, Button, Card, Checkbox, Dialog, Footer, Input, Label, SubscriptionForm, Textarea, and Tooltip. - Implemented a new layout configuration with improved navigation and metadata handling. - Integrated third-party libraries for enhanced functionality (e.g., Radix UI, Lucide). - Updated global styles and added custom CSS variables for theming. - Introduced new pages for Changelog, Contact, Community, and GitHub redirection. - Updated package dependencies in package.json and pnpm-lock.yaml. - Added Open Graph image generation for better social media sharing. - Included favicon and application icons for branding.
1 parent 19764a4 commit 036c829

35 files changed

+2661
-45
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Changelog from "@/components/ui/changelog";
2+
import { SubscriptionForm } from "@/components/ui/subscription-form";
3+
4+
export const metadata = {
5+
title: "Changelog",
6+
description: "Get the latest product updates and changes to Amical.",
7+
};
8+
9+
export default function ChangelogPage() {
10+
return (
11+
<>
12+
<Changelog />
13+
</>
14+
);
15+
}
16+

apps/www/app/(home)/contact/page.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import Contact from "@/components/ui/contact";
2+
3+
export const metadata = {
4+
title: "Contact",
5+
description: "Get in touch with the authors of Amical for any questions or support.",
6+
};
7+
8+
export default function ContactPage() {
9+
return <Contact />;
10+
}

apps/www/app/(home)/layout.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import type { ReactNode } from 'react';
22
import { HomeLayout } from 'fumadocs-ui/layouts/home';
33
import { baseOptions } from '@/app/layout.config';
4+
import { Footer } from '@/components/ui/footer';
45

5-
export default function Layout({ children }: { children: ReactNode }) {
6+
export default function Layout({
7+
children,
8+
}: {
9+
children: ReactNode;
10+
}): React.ReactElement {
611
return (
7-
<HomeLayout
8-
{...baseOptions}
9-
links={[
10-
{
11-
text: 'Documentation',
12-
url: '/docs',
13-
},
14-
]}
15-
>
16-
{children}
12+
<HomeLayout {...baseOptions}>
13+
<div className="fixed inset-0 pointer-events-none">
14+
</div>
15+
<div className="relative min-h-screen w-full">
16+
{children}
17+
<Footer />
18+
</div>
1719
</HomeLayout>
1820
);
1921
}

apps/www/app/(home)/page.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
import Link from 'next/link';
2-
31
export default function HomePage() {
42
return (
5-
<main className="flex flex-1 flex-col justify-center text-center">
6-
<h1 className="mb-4 text-2xl font-bold">Hello World</h1>
7-
<p className="text-fd-muted-foreground">
8-
You can open{' '}
9-
<Link
10-
href="/docs"
11-
className="text-fd-foreground font-semibold underline"
12-
>
13-
/docs
14-
</Link>{' '}
15-
and see the documentation.
16-
</p>
3+
<main className="flex flex-1 flex-col">
174
</main>
185
);
19-
}
6+
}

apps/www/app/api/search/route.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { source } from '@/lib/source';
22
import { createFromSource } from 'fumadocs-core/search/server';
33

4-
export const { GET } = createFromSource(source);
4+
// it should be cached forever
5+
export const revalidate = false;
6+
7+
export const { staticGET: GET } = createFromSource(source);

apps/www/app/community/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { redirect } from 'next/navigation';
2+
3+
export default async function CommunityPage() {
4+
redirect('https://discord.gg/x7pGh8Q34e')
5+
}

apps/www/app/github/page.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { redirect } from 'next/navigation';
2+
3+
export default async function CommunityPage() {
4+
redirect('https://github.com/amicalhq/amical')
5+
}

apps/www/app/global.css

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,122 @@
11
@import 'tailwindcss';
22
@import 'fumadocs-ui/css/neutral.css';
33
@import 'fumadocs-ui/css/preset.css';
4+
@import "tw-animate-css";
5+
6+
@custom-variant dark (&:is(.dark *));
7+
8+
@theme inline {
9+
--radius-sm: calc(var(--radius) - 4px);
10+
--radius-md: calc(var(--radius) - 2px);
11+
--radius-lg: var(--radius);
12+
--radius-xl: calc(var(--radius) + 4px);
13+
--color-background: var(--background);
14+
--color-foreground: var(--foreground);
15+
--color-card: var(--card);
16+
--color-card-foreground: var(--card-foreground);
17+
--color-popover: var(--popover);
18+
--color-popover-foreground: var(--popover-foreground);
19+
--color-primary: var(--primary);
20+
--color-primary-foreground: var(--primary-foreground);
21+
--color-secondary: var(--secondary);
22+
--color-secondary-foreground: var(--secondary-foreground);
23+
--color-muted: var(--muted);
24+
--color-muted-foreground: var(--muted-foreground);
25+
--color-accent: var(--accent);
26+
--color-accent-foreground: var(--accent-foreground);
27+
--color-destructive: var(--destructive);
28+
--color-border: var(--border);
29+
--color-input: var(--input);
30+
--color-ring: var(--ring);
31+
--color-chart-1: var(--chart-1);
32+
--color-chart-2: var(--chart-2);
33+
--color-chart-3: var(--chart-3);
34+
--color-chart-4: var(--chart-4);
35+
--color-chart-5: var(--chart-5);
36+
--color-sidebar: var(--sidebar);
37+
--color-sidebar-foreground: var(--sidebar-foreground);
38+
--color-sidebar-primary: var(--sidebar-primary);
39+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
40+
--color-sidebar-accent: var(--sidebar-accent);
41+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
42+
--color-sidebar-border: var(--sidebar-border);
43+
--color-sidebar-ring: var(--sidebar-ring);
44+
}
45+
46+
:root {
47+
--radius: 0.625rem;
48+
--background: oklch(1 0 0);
49+
--foreground: oklch(0.145 0 0);
50+
--card: oklch(1 0 0);
51+
--card-foreground: oklch(0.145 0 0);
52+
--popover: oklch(1 0 0);
53+
--popover-foreground: oklch(0.145 0 0);
54+
--primary: oklch(0.205 0 0);
55+
--primary-foreground: oklch(0.985 0 0);
56+
--secondary: oklch(0.97 0 0);
57+
--secondary-foreground: oklch(0.205 0 0);
58+
--muted: oklch(0.97 0 0);
59+
--muted-foreground: oklch(0.556 0 0);
60+
--accent: oklch(0.97 0 0);
61+
--accent-foreground: oklch(0.205 0 0);
62+
--destructive: oklch(0.577 0.245 27.325);
63+
--border: oklch(0.922 0 0);
64+
--input: oklch(0.922 0 0);
65+
--ring: oklch(0.708 0 0);
66+
--chart-1: oklch(0.646 0.222 41.116);
67+
--chart-2: oklch(0.6 0.118 184.704);
68+
--chart-3: oklch(0.398 0.07 227.392);
69+
--chart-4: oklch(0.828 0.189 84.429);
70+
--chart-5: oklch(0.769 0.188 70.08);
71+
--sidebar: oklch(0.985 0 0);
72+
--sidebar-foreground: oklch(0.145 0 0);
73+
--sidebar-primary: oklch(0.205 0 0);
74+
--sidebar-primary-foreground: oklch(0.985 0 0);
75+
--sidebar-accent: oklch(0.97 0 0);
76+
--sidebar-accent-foreground: oklch(0.205 0 0);
77+
--sidebar-border: oklch(0.922 0 0);
78+
--sidebar-ring: oklch(0.708 0 0);
79+
}
80+
81+
.dark {
82+
--background: oklch(0.145 0 0);
83+
--foreground: oklch(0.985 0 0);
84+
--card: oklch(0.205 0 0);
85+
--card-foreground: oklch(0.985 0 0);
86+
--popover: oklch(0.205 0 0);
87+
--popover-foreground: oklch(0.985 0 0);
88+
--primary: oklch(0.922 0 0);
89+
--primary-foreground: oklch(0.205 0 0);
90+
--secondary: oklch(0.269 0 0);
91+
--secondary-foreground: oklch(0.985 0 0);
92+
--muted: oklch(0.269 0 0);
93+
--muted-foreground: oklch(0.708 0 0);
94+
--accent: oklch(0.269 0 0);
95+
--accent-foreground: oklch(0.985 0 0);
96+
--destructive: oklch(0.704 0.191 22.216);
97+
--border: oklch(1 0 0 / 10%);
98+
--input: oklch(1 0 0 / 15%);
99+
--ring: oklch(0.556 0 0);
100+
--chart-1: oklch(0.488 0.243 264.376);
101+
--chart-2: oklch(0.696 0.17 162.48);
102+
--chart-3: oklch(0.769 0.188 70.08);
103+
--chart-4: oklch(0.627 0.265 303.9);
104+
--chart-5: oklch(0.645 0.246 16.439);
105+
--sidebar: oklch(0.205 0 0);
106+
--sidebar-foreground: oklch(0.985 0 0);
107+
--sidebar-primary: oklch(0.488 0.243 264.376);
108+
--sidebar-primary-foreground: oklch(0.985 0 0);
109+
--sidebar-accent: oklch(0.269 0 0);
110+
--sidebar-accent-foreground: oklch(0.985 0 0);
111+
--sidebar-border: oklch(1 0 0 / 10%);
112+
--sidebar-ring: oklch(0.556 0 0);
113+
}
114+
115+
@layer base {
116+
* {
117+
@apply border-border outline-ring/50;
118+
}
119+
body {
120+
@apply bg-background text-foreground;
121+
}
122+
}

apps/www/app/layout.config.tsx

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
2+
import Image from 'next/image';
23

34
/**
45
* Shared layout configurations
@@ -8,19 +9,46 @@ import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
89
* Docs Layout: app/docs/layout.tsx
910
*/
1011
export const baseOptions: BaseLayoutProps = {
12+
githubUrl: 'https://github.com/amicalhq/amical',
13+
disableThemeSwitch: true,
1114
nav: {
1215
title: (
1316
<>
14-
<svg
15-
width="24"
16-
height="24"
17-
xmlns="http://www.w3.org/2000/svg"
18-
aria-label="Logo"
19-
>
20-
<circle cx={12} cy={12} r={12} fill="currentColor" />
21-
</svg>
22-
My App
17+
<Image
18+
src="/amical-icon.svg"
19+
width={32}
20+
height={32}
21+
alt="Amical Logo"
22+
/>
23+
Amical
2324
</>
2425
),
2526
},
27+
links: [
28+
{
29+
text: 'Docs',
30+
url: '/docs',
31+
},
32+
{
33+
text: 'Contact',
34+
url: '/contact',
35+
active: 'nested-url',
36+
},
37+
{
38+
text: 'Changelog',
39+
url: '/changelog',
40+
active: 'nested-url',
41+
},
42+
{
43+
type: 'icon',
44+
url: '/community',
45+
text: 'Discord',
46+
icon: (
47+
<svg role="img" viewBox="0 0 24 24" fill="currentColor">
48+
<path d="M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.09.09 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.09 16.09 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02zM8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12zm6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12z"/>
49+
</svg>
50+
),
51+
external: true,
52+
},
53+
],
2654
};

apps/www/app/layout.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ import './global.css';
22
import { RootProvider } from 'fumadocs-ui/provider';
33
import { Inter } from 'next/font/google';
44
import type { ReactNode } from 'react';
5+
import PlausibleProvider from 'next-plausible';
6+
import { GoogleTagManager } from '@next/third-parties/google'
7+
import { createMetadata } from '@/lib/metadata';
8+
import { TooltipProvider } from '@radix-ui/react-tooltip';
9+
10+
11+
export const metadata = createMetadata({});
512

613
const inter = Inter({
714
subsets: ['latin'],
@@ -10,9 +17,30 @@ const inter = Inter({
1017
export default function Layout({ children }: { children: ReactNode }) {
1118
return (
1219
<html lang="en" className={inter.className} suppressHydrationWarning>
20+
<head>
21+
<PlausibleProvider
22+
domain="amical.ai"
23+
trackOutboundLinks={true}
24+
trackFileDownloads={true}
25+
taggedEvents={true}
26+
hash={true}
27+
/>
28+
</head>
1329
<body className="flex flex-col min-h-screen">
14-
<RootProvider>{children}</RootProvider>
30+
<RootProvider
31+
search={{
32+
options: {
33+
type: 'static',
34+
}
35+
}}
36+
theme={{
37+
defaultTheme: 'dark',
38+
}}>
39+
<TooltipProvider>
40+
{children}
41+
</TooltipProvider>
42+
</RootProvider>
1543
</body>
1644
</html>
1745
);
18-
}
46+
}

0 commit comments

Comments
 (0)