File tree Expand file tree Collapse file tree
apps/website/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use client" ;
2+
3+ import Link from "next/link" ;
4+ import { useRouter } from "next/navigation" ;
5+ import { useHotkeys } from "react-hotkeys-hook" ;
6+
7+ import { ChevronRightIcon } from "lucide-react" ;
8+ import { buttonVariants } from "@/components/ui/button" ;
9+
10+ const GetStartedLink = ( ) => {
11+ const navigate = useRouter ( ) ;
12+ useHotkeys ( "c" , ( ) => navigate . push ( "/docs" ) ) ;
13+ return (
14+ < Link
15+ href = "/docs/getting-started/prerequisites"
16+ className = { buttonVariants ( {
17+ size : "default" ,
18+ className : "group w-full md:w-auto" ,
19+ } ) }
20+ >
21+ < span > Get Started</ span >
22+ < span className = "rounded-sm bg-neutral-600/60 px-0.5 font-mono text-neutral-300 dark:bg-neutral-700/60" >
23+ c
24+ </ span >
25+ < ChevronRightIcon
26+ size = { 16 }
27+ className = "transition-transform group-hover:translate-x-0.5"
28+ />
29+ </ Link >
30+ ) ;
31+ } ;
32+
33+ export default GetStartedLink ;
Original file line number Diff line number Diff line change 1- import Link from "next/link" ;
2- import { ArrowUpRightIcon , ChevronRightIcon } from "lucide-react" ;
1+ import { ArrowUpRightIcon } from "lucide-react" ;
32
43import { cn } from "@/utils/cn" ;
54import { globals } from "@/globals" ;
65
76import { GitHub } from "@/components/ui/svgs/github" ;
87import { buttonVariants } from "@/components/ui/button" ;
8+ import GetStartedLink from "@/components/get-started-link" ;
99import { ExternalLink } from "@/components/ui/external-link" ;
1010
1111const Hero = ( ) => {
@@ -32,19 +32,7 @@ const Hero = () => {
3232 "animate-in fill-mode-backwards fade-in slide-in-from-bottom-4 delay-100 duration-500" ,
3333 ) }
3434 >
35- < Link
36- href = "/docs/getting-started/prerequisites"
37- className = { buttonVariants ( {
38- size : "default" ,
39- className : "group w-full md:w-auto" ,
40- } ) }
41- >
42- < span > Get Started</ span >
43- < ChevronRightIcon
44- size = { 16 }
45- className = "transition-transform group-hover:translate-x-0.5"
46- />
47- </ Link >
35+ < GetStartedLink />
4836 < ExternalLink
4937 title = "View on GitHub"
5038 href = { globals . githubUrl }
Original file line number Diff line number Diff line change @@ -10,12 +10,17 @@ import {
1010 DropdownMenuTrigger ,
1111} from "@/components/ui/dropdown-menu" ;
1212import { buttonVariants } from "@/components/ui/button" ;
13+ import { useHotkeys } from "react-hotkeys-hook" ;
1314
1415const ThemeToggle = ( ) => {
1516 const { setTheme } = useTheme ( ) ;
17+ useHotkeys ( "t" , ( ) =>
18+ setTheme ( ( prev ) => ( prev === "light" ? "dark" : "light" ) ) ,
19+ ) ;
1620 return (
1721 < DropdownMenu >
1822 < DropdownMenuTrigger
23+ title = "Toggle theme (t)"
1924 className = { buttonVariants ( { variant : "ghost" , size : "icon" } ) }
2025 >
2126 < SunIcon
@@ -26,7 +31,7 @@ const ThemeToggle = () => {
2631 size = { 20 }
2732 className = "absolute scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"
2833 />
29- < span className = "sr-only" > Toggle theme</ span >
34+ < span className = "sr-only" > Toggle theme (t) </ span >
3035 </ DropdownMenuTrigger >
3136 < DropdownMenuContent align = "end" >
3237 < DropdownMenuItem onClick = { ( ) => setTheme ( "light" ) } >
You can’t perform that action at this time.
0 commit comments