Skip to content

Commit d6a8fae

Browse files
committed
Add missing elements
1 parent bd9f0b4 commit d6a8fae

File tree

2 files changed

+76
-34
lines changed

2 files changed

+76
-34
lines changed

apps/frontpage/components/docs/sidebar/icons.tsx

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { FC } from "react";
1+
import type { FC } from 'react';
22

33
export const DocsIcon: FC = () => (
44
<svg fill="none" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
@@ -32,12 +32,27 @@ export const TutorialsIcon: FC = () => (
3232
export const ChangelogIcon: FC = () => (
3333
<svg fill="none" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
3434
<path
35-
d="M6.06 18c-.419 0-.828-.194-1.093-.519a1.39 1.39 0 0 1-.281-1.16l1.143-5.615H2.84a.84.84 0 0 1-.766-1.18L6.089.5a.84.84 0 0 1 .767-.5h6.213a.84.84 0 0 1 .76 1.198L12.097 4.87h3.267a.84.84 0 0 1 .658 1.36L7.11 17.515A1.382 1.382 0 0 1 6.06 18ZM4.133 9.028h2.724a.84.84 0 0 1 .823 1.007L6.57 15.49l7.062-8.94h-2.857a.84.84 0 0 1-.76-1.197l1.732-3.672H7.403l-3.27 7.347Z"
35+
d="M3.099 9.374 6.497.13A.2.2 0 0 1 6.685 0h6.276a.2.2 0 0 1 .184.278l-2.5 5.872a.2.2 0 0 0 .184.279h4.746a.2.2 0 0 1 .154.327l-9.03 10.908c-.067.082-.2.015-.174-.088l1.888-7.685a.2.2 0 0 0-.194-.248H3.287a.2.2 0 0 1-.188-.27Z"
3636
fill="#FF4785"
3737
/>
38+
</svg>
39+
);
40+
41+
export const IntegrationsIcon: FC = () => (
42+
<svg fill="none" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
3843
<path
39-
d="M6.857 9.027H4.133l3.27-7.347h4.343l-1.731 3.672a.84.84 0 0 0 .76 1.197h2.857l-7.063 8.94 1.11-5.455a.836.836 0 0 0-.822-1.007Z"
40-
fill="#FFA0C0"
44+
d="M16 2.4v7.634a.4.4 0 0 1-.683.283L7.683 2.683A.4.4 0 0 1 7.966 2H15.6c.22 0 .4.18.4.4Z"
45+
fill="#37D5D3"
4146
/>
47+
<circle cx="7" cy="11" fill="#87E6E5" r="5" />
48+
</svg>
49+
);
50+
51+
export const APIIcon: FC = () => (
52+
<svg fill="none" height="18" width="18" xmlns="http://www.w3.org/2000/svg">
53+
<rect fill="#A8E38C" height="16" rx="8" width="18" y="1.001" />
54+
<g fill="#489524">
55+
<path d="M7.348 12.345a.52.52 0 0 0 0-.73l-2.606-2.63 2.606-2.628a.521.521 0 0 0-.37-.856.511.511 0 0 0-.355.125l-2.97 2.991a.519.519 0 0 0 0 .737l2.97 2.991a.514.514 0 0 0 .365.156.512.512 0 0 0 .36-.156ZM11.011 12.5a.512.512 0 0 1-.474-.321.523.523 0 0 1 .114-.565l2.607-2.629-2.607-2.628a.521.521 0 0 1 .37-.856c.13-.005.257.04.355.125l2.971 2.991a.52.52 0 0 1 0 .737l-2.971 2.991a.515.515 0 0 1-.365.156Z" />
56+
</g>
4257
</svg>
4358
);

apps/frontpage/components/docs/sidebar/sidebar.tsx

+57-30
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ import type { FC, ReactNode } from 'react';
55
import { cn } from '@repo/utils';
66
import { usePathname } from 'next/navigation';
77
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
8-
import { ScrollBar } from "../../ui/scroll-area";
9-
import { ChangelogIcon, DocsIcon, TutorialsIcon } from './icons';
8+
import { ScrollBar } from '../../ui/scroll-area';
9+
import {
10+
APIIcon,
11+
ChangelogIcon,
12+
DocsIcon,
13+
IntegrationsIcon,
14+
TutorialsIcon,
15+
} from './icons';
1016

1117
interface SidebarProps {
1218
children: ReactNode;
@@ -21,36 +27,39 @@ export const Sidebar: FC<SidebarProps> = ({ children }) => {
2127
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
2228
<div className="py-12 pl-1 pr-4">
2329
<nav className="flex flex-col gap-1.5 text-sm font-medium">
24-
<Link
25-
className={cn(
26-
'flex items-center gap-3 hover:text-blue-500 transition-colors px-2 h-8',
27-
pathname === '/docs' && 'text-blue-500',
28-
)}
30+
<Line
2931
href="/docs"
30-
>
31-
<DocsIcon />
32-
Documentation
33-
</Link>
34-
<Link
35-
className={cn(
36-
'flex items-center gap-3 hover:text-blue-500 transition-colors px-2 h-8',
37-
pathname === '/tutorials' && 'text-blue-500',
38-
)}
39-
href="#"
40-
>
41-
<TutorialsIcon />
42-
Tutorials
43-
</Link>
44-
<Link
45-
className={cn(
46-
'flex items-center gap-3 hover:text-blue-500 transition-colors px-2 h-8',
47-
pathname.startsWith('/releases') && 'text-blue-500',
48-
)}
32+
icon={<DocsIcon />}
33+
isActive={
34+
pathname.startsWith('/docs') &&
35+
!pathname.startsWith('/docs/api')
36+
}
37+
label="Documentation"
38+
/>
39+
<Line
40+
href="/docs/api"
41+
icon={<APIIcon />}
42+
isActive={pathname.startsWith('/docs/api')}
43+
label="API"
44+
/>
45+
<Line
46+
href="/#"
47+
icon={<TutorialsIcon />}
48+
isActive={pathname === '/tutorials'}
49+
label="Tutorials"
50+
/>
51+
<Line
52+
href="/integrations"
53+
icon={<IntegrationsIcon />}
54+
isActive={false}
55+
label="Integrations"
56+
/>
57+
<Line
4958
href="/releases"
50-
>
51-
<ChangelogIcon />
52-
Changelog
53-
</Link>
59+
icon={<ChangelogIcon />}
60+
isActive={pathname.startsWith('/releases')}
61+
label="Changelog"
62+
/>
5463
</nav>
5564
{children}
5665
</div>
@@ -60,3 +69,21 @@ export const Sidebar: FC<SidebarProps> = ({ children }) => {
6069
</nav>
6170
);
6271
};
72+
73+
export const Line: FC<{
74+
isActive: boolean;
75+
href: string;
76+
icon: ReactNode;
77+
label: string;
78+
}> = ({ isActive, href, label, icon }) => (
79+
<Link
80+
className={cn(
81+
'flex items-center gap-3 hover:text-blue-500 transition-colors px-2 h-8',
82+
isActive && 'text-blue-500',
83+
)}
84+
href={href}
85+
>
86+
{icon}
87+
{label}
88+
</Link>
89+
);

0 commit comments

Comments
 (0)