Skip to content

Commit 952d36f

Browse files
committed
feat: ui improvement
1 parent a88d559 commit 952d36f

File tree

6 files changed

+64
-66
lines changed

6 files changed

+64
-66
lines changed

src/components/common/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const Footer = () => {
2929
href={contact.href}
3030
className='flex gap-2 items-center opacity-60 hover:opacity-100'
3131
>
32-
<Icon name={contact.icon as keyof typeof icons} size={18} />
32+
<Icon name={contact.icon as keyof typeof icons} size={20} />
3333
{contact.label}
3434
</Link>
3535
))}

src/components/common/header.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export const Header = () => {
5151
<MobileMenu isOpen={isOpen} setIsOpen={setIsOpen} />
5252

5353
{/* <!-- Desktop --> */}
54-
<div className='hidden lg:flex justify-center items-center'>
54+
<div className='hidden lg:flex justify-center items-center gap-4'>
5555
<NavigationMenu className='hidden lg:block mx-auto'>
5656
<NavigationMenuList>
5757
<NavigationMenuItem>
@@ -68,11 +68,14 @@ export const Header = () => {
6868

6969
<ToggleTheme />
7070

71-
<Button asChild size='sm' variant='ghost' aria-label='View on GitHub'>
72-
<Link aria-label='View on GitHub' href={DATA.repo} target='_blank'>
73-
<Github className='size-5' />
74-
</Link>
75-
</Button>
71+
<Link
72+
aria-label='View on GitHub'
73+
href={DATA.repo}
74+
target='_blank'
75+
aria-labelledby='View on GitHub'
76+
>
77+
<Github size={20} />
78+
</Link>
7679
</div>
7780
</div>
7881
</header>

src/components/sections/faq.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ export const FAQ = () => {
1212
<section id='faq' className='container md:w-[700px] py-24 sm:py-32 m-auto'>
1313
<div className='text-center mb-8'>
1414
<h2 className='text-lg text-primary text-center mb-2 tracking-wider'>FAQS</h2>
15-
1615
<h2 className='text-3xl md:text-4xl text-center font-bold'>Common Questions</h2>
1716
</div>
1817

1918
<Accordion type='single' collapsible className='AccordionRoot'>
2019
{DATA.faq.map(({ question, answer }, idx) => (
2120
<AccordionItem key={idx} value={idx.toString()}>
2221
<AccordionTrigger className='text-left'>{question}</AccordionTrigger>
23-
2422
<AccordionContent>{answer}</AccordionContent>
2523
</AccordionItem>
2624
))}

src/components/sections/hero.tsx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client'
22

33
import { ChevronRight, Github } from 'lucide-react'
4-
// import Link from 'next/link'
4+
import Link from 'next/link'
55

66
import { Button } from '@/components/ui/button'
77

@@ -24,27 +24,33 @@ export const Hero = () => {
2424
<div className='space-y-4 md:space-y-0 md:space-x-4'>
2525
<BlurFade delay={0.3}>
2626
<div className='mt-6 gap-2 flex justify-center'>
27-
<Button
28-
size='lg'
29-
variant='default'
30-
className='w-5/6 md:w-1/4 font-bold group/arrow'
31-
onClick={() => window.open('/docs', '_blank')}
27+
<Link
28+
href={'/docs'}
29+
target='_blank'
30+
className='w-5/6 md:w-1/4 font-bold group/arrow flex items-center justify-center'
3231
>
33-
Documentation
34-
<ChevronRight className='size-5 ml-2 group-hover/arrow:translate-x-1 transition-transform' />
35-
</Button>
36-
<Button
37-
size='lg'
38-
className='w-5/6 md:w-1/4 font-bold group/arrow'
39-
variant='secondary'
40-
onClick={() => {
41-
window.open('https://github.com/kinotio/drowser', '_blank')
42-
}}
32+
<Button className='w-full h-full' variant='outline'>
33+
Documentation
34+
<ChevronRight
35+
className='ml-2 group-hover/arrow:translate-x-1 transition-transform'
36+
size={100}
37+
/>
38+
</Button>
39+
</Link>
40+
<Link
41+
href={'https://github.com/kinotio/drowser'}
42+
target='_blank'
43+
className='w-5/6 md:w-1/4 font-bold group/arrow flex items-center justify-center'
4344
>
44-
<Github className='size-5 mr-2' />
45-
Github
46-
<ChevronRight className='size-5 ml-2 group-hover/arrow:translate-x-1 transition-transform' />
47-
</Button>
45+
<Button className='w-full h-full' variant='secondary'>
46+
<Github className='mr-2' size={20} />
47+
Github
48+
<ChevronRight
49+
className='ml-2 group-hover/arrow:translate-x-1 transition-transform'
50+
size={20}
51+
/>
52+
</Button>
53+
</Link>
4854
</div>
4955
</BlurFade>
5056
</div>

src/components/toogle-theme.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
import { useTheme } from 'next-themes'
22
import { Moon, Sun } from 'lucide-react'
3-
4-
import { Button } from '@/components/ui/button'
3+
import Link from 'next/link'
54

65
export const ToggleTheme = () => {
76
const { theme, setTheme } = useTheme()
87

98
return (
10-
<Button
9+
<Link
10+
href='#'
1111
onClick={() => setTheme(theme === 'light' ? 'dark' : 'light')}
12-
size='sm'
13-
variant='ghost'
1412
className='w-full justify-start'
1513
>
1614
<div className='flex gap-2 dark:hidden'>
17-
<Moon className='size-5' />
15+
<Moon size={20} />
1816
<span className='block lg:hidden'>Dark</span>
1917
</div>
2018

2119
<div className='dark:flex gap-2 hidden'>
22-
<Sun className='size-5' />
20+
<Sun size={20} />
2321
<span className='block lg:hidden'>Light</span>
2422
</div>
2523

2624
<span className='sr-only'>Toggle theme</span>
27-
</Button>
25+
</Link>
2826
)
2927
}

src/components/ui/button.tsx

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
1-
import * as React from "react"
2-
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
1+
import * as React from 'react'
2+
import { Slot } from '@radix-ui/react-slot'
3+
import { cva, type VariantProps } from 'class-variance-authority'
44

5-
import { cn } from "@/lib/utils"
5+
import { cn } from '@/lib/utils'
66

77
const buttonVariants = cva(
8-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
8+
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',
99
{
1010
variants: {
1111
variant: {
12-
default:
13-
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
14-
destructive:
15-
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
12+
default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
13+
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
1614
outline:
17-
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18-
secondary:
19-
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20-
ghost: "hover:bg-accent hover:text-accent-foreground",
21-
link: "text-primary underline-offset-4 hover:underline",
15+
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
16+
secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
17+
ghost: 'hover:bg-accent hover:text-accent-foreground',
18+
link: 'text-primary underline-offset-4 hover:underline'
2219
},
2320
size: {
24-
default: "h-9 px-4 py-2",
25-
sm: "h-8 rounded-md px-3 text-xs",
26-
lg: "h-10 rounded-md px-8",
27-
icon: "h-9 w-9",
28-
},
21+
default: 'h-9 px-4 py-2',
22+
sm: 'h-8 rounded-md px-3 text-xs',
23+
lg: 'h-10 rounded-md px-8',
24+
icon: 'h-9 w-9'
25+
}
2926
},
3027
defaultVariants: {
31-
variant: "default",
32-
size: "default",
33-
},
28+
variant: 'default',
29+
size: 'default'
30+
}
3431
}
3532
)
3633

@@ -42,16 +39,12 @@ export interface ButtonProps
4239

4340
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
4441
({ className, variant, size, asChild = false, ...props }, ref) => {
45-
const Comp = asChild ? Slot : "button"
42+
const Comp = asChild ? Slot : 'button'
4643
return (
47-
<Comp
48-
className={cn(buttonVariants({ variant, size, className }))}
49-
ref={ref}
50-
{...props}
51-
/>
44+
<Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />
5245
)
5346
}
5447
)
55-
Button.displayName = "Button"
48+
Button.displayName = 'Button'
5649

5750
export { Button, buttonVariants }

0 commit comments

Comments
 (0)