Skip to content

Commit eabb53e

Browse files
authored
feat(www): refactor examples page (shadcn-ui#5818)
1 parent a21ef83 commit eabb53e

File tree

4 files changed

+19
-30
lines changed

4 files changed

+19
-30
lines changed

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Metadata } from "next"
22
import Link from "next/link"
33

4+
import { siteConfig } from "@/config/site"
45
import { Announcement } from "@/components/announcement"
56
import { ExamplesNav } from "@/components/examples-nav"
67
import {
@@ -25,20 +26,23 @@ export default function ExamplesLayout({ children }: ExamplesLayoutProps) {
2526
<div className="relative">
2627
<PageHeader>
2728
<Announcement />
28-
<PageHeaderHeading className="hidden md:block">
29-
Check out some examples
30-
</PageHeaderHeading>
31-
<PageHeaderHeading className="md:hidden">Examples</PageHeaderHeading>
29+
<PageHeaderHeading>Build your component library</PageHeaderHeading>
3230
<PageHeaderDescription>
33-
Dashboard, cards, authentication. Some examples built using the
34-
components. Use this as a guide to build your own.
31+
Beautifully designed components that you can copy and paste into your
32+
apps. Made with Tailwind CSS. Open source.
3533
</PageHeaderDescription>
3634
<PageActions>
3735
<Button asChild size="sm">
3836
<Link href="/docs">Get Started</Link>
3937
</Button>
4038
<Button asChild size="sm" variant="ghost">
41-
<Link href="/components">Components</Link>
39+
<Link
40+
target="_blank"
41+
rel="noreferrer"
42+
href={siteConfig.links.github}
43+
>
44+
GitHub
45+
</Link>
4246
</Button>
4347
</PageActions>
4448
</PageHeader>

apps/www/components/examples-nav.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function ExamplesNav({ className, ...props }: ExamplesNavProps) {
5959
<div className="relative">
6060
<ScrollArea className="max-w-[600px] lg:max-w-none">
6161
<div className={cn("mb-4 flex items-center", className)} {...props}>
62-
{examples.map((example, index) => (
62+
{examples.map((example) => (
6363
<Link
6464
href={example.href}
6565
key={example.href}

apps/www/components/main-nav.tsx

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function MainNav() {
1212

1313
return (
1414
<div className="mr-4 hidden md:flex">
15-
<Link href="/" className="mr-4 flex items-center space-x-2 lg:mr-6">
15+
<Link href="/" className="mr-4 flex items-center gap-2 lg:mr-6">
1616
<Icons.logo className="h-6 w-6" />
1717
<span className="hidden font-bold lg:inline-block">
1818
{siteConfig.name}
@@ -23,7 +23,7 @@ export function MainNav() {
2323
href="/docs"
2424
className={cn(
2525
"transition-colors hover:text-foreground/80",
26-
pathname === "/docs" ? "text-foreground" : "text-foreground/60"
26+
pathname === "/docs" ? "text-foreground" : "text-foreground/80"
2727
)}
2828
>
2929
Docs
@@ -35,7 +35,7 @@ export function MainNav() {
3535
pathname?.startsWith("/docs/components") &&
3636
!pathname?.startsWith("/docs/component/chart")
3737
? "text-foreground"
38-
: "text-foreground/60"
38+
: "text-foreground/80"
3939
)}
4040
>
4141
Components
@@ -46,7 +46,7 @@ export function MainNav() {
4646
"transition-colors hover:text-foreground/80",
4747
pathname?.startsWith("/blocks")
4848
? "text-foreground"
49-
: "text-foreground/60"
49+
: "text-foreground/80"
5050
)}
5151
>
5252
Blocks
@@ -58,7 +58,7 @@ export function MainNav() {
5858
pathname?.startsWith("/docs/component/chart") ||
5959
pathname?.startsWith("/charts")
6060
? "text-foreground"
61-
: "text-foreground/60"
61+
: "text-foreground/80"
6262
)}
6363
>
6464
Charts
@@ -69,29 +69,18 @@ export function MainNav() {
6969
"transition-colors hover:text-foreground/80",
7070
pathname?.startsWith("/themes")
7171
? "text-foreground"
72-
: "text-foreground/60"
72+
: "text-foreground/80"
7373
)}
7474
>
7575
Themes
7676
</Link>
77-
<Link
78-
href="/examples"
79-
className={cn(
80-
"hidden transition-colors hover:text-foreground/80 lg:inline-block",
81-
pathname?.startsWith("/examples")
82-
? "text-foreground"
83-
: "text-foreground/60"
84-
)}
85-
>
86-
Examples
87-
</Link>
8877
<Link
8978
href="/colors"
9079
className={cn(
9180
"transition-colors hover:text-foreground/80",
9281
pathname?.startsWith("/colors")
9382
? "text-foreground"
94-
: "text-foreground/60"
83+
: "text-foreground/80"
9584
)}
9685
>
9786
Colors

apps/www/config/docs.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export const docsConfig: DocsConfig = {
3232
title: "Themes",
3333
href: "/themes",
3434
},
35-
{
36-
title: "Examples",
37-
href: "/examples",
38-
},
3935
{
4036
title: "Colors",
4137
href: "/colors",

0 commit comments

Comments
 (0)