Skip to content

Commit d7e2bdf

Browse files
committed
refactor: replace inline svg logo with logo component
1 parent 746e768 commit d7e2bdf

File tree

4 files changed

+31
-36
lines changed

4 files changed

+31
-36
lines changed

src/assets/logo.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { type SVGProps } from 'react'
2+
import { cn } from '@/lib/utils'
3+
4+
export function Logo({ className, ...props }: SVGProps<SVGSVGElement>) {
5+
return (
6+
<svg
7+
id='shadcn-admin-logo'
8+
viewBox='0 0 24 24'
9+
xmlns='http://www.w3.org/2000/svg'
10+
height='24'
11+
width='24'
12+
fill='none'
13+
stroke='currentColor'
14+
strokeWidth='2'
15+
strokeLinecap='round'
16+
strokeLinejoin='round'
17+
className={cn('size-6', className)}
18+
{...props}
19+
>
20+
<title>Shadcn-Admin</title>
21+
<path d='M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3' />
22+
</svg>
23+
)
24+
}

src/features/auth/auth-layout.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { Logo } from '@/assets/logo'
2+
13
type AuthLayoutProps = {
24
children: React.ReactNode
35
}
@@ -7,18 +9,7 @@ export function AuthLayout({ children }: AuthLayoutProps) {
79
<div className='container grid h-svh max-w-none items-center justify-center'>
810
<div className='mx-auto flex w-full flex-col justify-center space-y-2 py-8 sm:w-[480px] sm:p-8'>
911
<div className='mb-4 flex items-center justify-center'>
10-
<svg
11-
xmlns='http://www.w3.org/2000/svg'
12-
viewBox='0 0 24 24'
13-
fill='none'
14-
stroke='currentColor'
15-
strokeWidth='2'
16-
strokeLinecap='round'
17-
strokeLinejoin='round'
18-
className='me-2 h-6 w-6'
19-
>
20-
<path d='M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3' />
21-
</svg>
12+
<Logo className='me-2' />
2213
<h1 className='text-xl font-medium'>Shadcn Admin</h1>
2314
</div>
2415
{children}

src/features/auth/sign-in/sign-in-2.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Logo } from '@/assets/logo'
12
import { cn } from '@/lib/utils'
23
import dashboardDark from './assets/dashboard-dark.png'
34
import dashboardLight from './assets/dashboard-light.png'
@@ -9,18 +10,7 @@ export function SignIn2() {
910
<div className='lg:p-8'>
1011
<div className='mx-auto flex w-full flex-col justify-center space-y-2 py-8 sm:w-[480px] sm:p-8'>
1112
<div className='mb-4 flex items-center justify-center'>
12-
<svg
13-
xmlns='http://www.w3.org/2000/svg'
14-
viewBox='0 0 24 24'
15-
fill='none'
16-
stroke='currentColor'
17-
strokeWidth='2'
18-
strokeLinecap='round'
19-
strokeLinejoin='round'
20-
className='me-2 h-6 w-6'
21-
>
22-
<path d='M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3' />
23-
</svg>
13+
<Logo className='me-2' />
2414
<h1 className='text-xl font-medium'>Shadcn Admin</h1>
2515
</div>
2616
</div>

src/routes/clerk/(auth)/route.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { createFileRoute, Link, Outlet } from '@tanstack/react-router'
22
import { ClerkFullLogo } from '@/assets/clerk-full-logo'
3+
import { Logo } from '@/assets/logo'
34
import { LearnMore } from '@/components/learn-more'
45

56
export const Route = createFileRoute('/clerk/(auth)')({
@@ -15,18 +16,7 @@ function ClerkAuthLayout() {
1516
to='/'
1617
className='relative z-20 flex items-center text-lg font-medium'
1718
>
18-
<svg
19-
xmlns='http://www.w3.org/2000/svg'
20-
viewBox='0 0 24 24'
21-
fill='none'
22-
stroke='currentColor'
23-
strokeWidth='2'
24-
strokeLinecap='round'
25-
strokeLinejoin='round'
26-
className='me-2 h-6 w-6'
27-
>
28-
<path d='M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3' />
29-
</svg>
19+
<Logo className='me-2' />
3020
Shadcn Admin
3121
</Link>
3222

0 commit comments

Comments
 (0)