diff --git a/website/src/components/NavBar/MobileNav.tsx b/website/src/components/NavBar/MobileNav.tsx index 10a2b153..e62c3393 100644 --- a/website/src/components/NavBar/MobileNav.tsx +++ b/website/src/components/NavBar/MobileNav.tsx @@ -1,11 +1,13 @@ import { Dialog } from '@base-ui-components/react/dialog'; import clsx from 'clsx'; -import { Menu, X } from 'lucide-react'; +import { ArrowUpRight, Menu, X } from 'lucide-react'; +import { DISCORD_INVITE_URL, GITHUB_REPO_URL } from '@/consts'; interface NavLink { href: string; label: string; matchPath: string | null; + external?: boolean; } export interface MobileNavProps { @@ -58,8 +60,26 @@ export default function MobileNav({ navLinks, currentPath, dark = false, childre aria-current={link.matchPath && currentPath.startsWith(link.matchPath) ? 'page' : undefined} > {link.label} + {' '} + {link.external ? : null} ))} + + GitHub + {' '} + + + + Discord + {' '} + + diff --git a/website/src/components/NavBar/NavBar.astro b/website/src/components/NavBar/NavBar.astro index 8ee49dea..d52b41bb 100644 --- a/website/src/components/NavBar/NavBar.astro +++ b/website/src/components/NavBar/NavBar.astro @@ -1,17 +1,24 @@ --- -import { GITHUB_REPO_URL } from '@/consts'; +import { DISCORD_INVITE_URL, GITHUB_REPO_URL } from '@/consts'; import MobileNav from './MobileNav'; import { ArrowUpRight } from 'lucide-react'; +import Discord from '@/components/icons/Discord'; +import GitHub from '@/components/icons/GitHub'; export interface Props { dark?: boolean; class?: string; } -const navLinks = [ +type NavLink = { + href: string; + label: string; + matchPath: string | null; + external?: boolean; +}; +const navLinks: NavLink[] = [ { href: '/docs', label: 'Docs', matchPath: '/docs' }, { href: '/blog', label: 'Blog', matchPath: '/blog' }, - { href: GITHUB_REPO_URL, label: 'GitHub', matchPath: null, external: true }, ]; const currentPath = Astro.url.pathname; @@ -41,14 +48,34 @@ const { class: className, dark = false } = Astro.props; ? 'border-current' : 'border-transparent intent:border-current', ]} + aria-current={link.matchPath && currentPath.startsWith(link.matchPath) ? 'page' : undefined} > {link.label} {link.external ? : null} )) } + + + + + + - + + + diff --git a/website/src/components/icons/Discord.tsx b/website/src/components/icons/Discord.tsx new file mode 100644 index 00000000..6042ab9c --- /dev/null +++ b/website/src/components/icons/Discord.tsx @@ -0,0 +1,18 @@ +interface DiscordProps extends React.SVGProps { + size?: number | string; +} + +export default function Discord({ size = 24, ...props }: DiscordProps) { + return ( + + + + ); +} diff --git a/website/src/components/icons/GitHub.tsx b/website/src/components/icons/GitHub.tsx new file mode 100644 index 00000000..f3fd3c33 --- /dev/null +++ b/website/src/components/icons/GitHub.tsx @@ -0,0 +1,22 @@ +interface GitHubProps extends React.SVGProps { + size?: number | string; +} + +export default function GitHub({ size = 24, ...props }: GitHubProps) { + return ( + + + + ); +} diff --git a/website/src/consts.ts b/website/src/consts.ts index 4f124c1b..1035eb01 100644 --- a/website/src/consts.ts +++ b/website/src/consts.ts @@ -1,3 +1,4 @@ export const SITE_TITLE = 'Video.js 10'; export const SITE_DESCRIPTION = `For over 15 years, Video.js has been the world's web video player. Now rebuilt in v10 for modern development and performance.`; export const GITHUB_REPO_URL = 'https://github.com/muxinc/vjs-10-monorepo/'; +export const DISCORD_INVITE_URL = 'https://discord.gg/yyatwmQr';