update(front): front 폴더명 frontend로 변경
This commit is contained in:
1 parent
698d4e72d4
commit
16848e9f63
85 files changed
No files matched your search
@@ -0,0 +1,53 @@
|
||||
import { type ComponentProps } from 'react'
|
||||
import { cn } from '@/lib'
|
||||
import logoColor from '@/assets/imarketkorea-logo.png'
|
||||
import logoWhite from '@/assets/imarketkorea-logo-white.png'
|
||||
|
||||
export type LogoVariant = 'color' | 'white'
|
||||
export type LogoSize = 'sm' | 'md' | 'lg'
|
||||
|
||||
const sources: Record<LogoVariant, string> = {
|
||||
color: logoColor,
|
||||
white: logoWhite,
|
||||
}
|
||||
|
||||
const sizes: Record<LogoSize, { img: string; text: string; gap: string }> = {
|
||||
sm: { img: 'h-6', text: 'text-base', gap: 'gap-1.5' },
|
||||
md: { img: 'h-8', text: 'text-xl', gap: 'gap-2' },
|
||||
lg: { img: 'h-10', text: 'text-2xl', gap: 'gap-2.5' },
|
||||
}
|
||||
|
||||
export interface LogoProps extends Omit<ComponentProps<'div'>, 'children'> {
|
||||
variant?: LogoVariant
|
||||
size?: LogoSize
|
||||
withText?: boolean
|
||||
alt?: string
|
||||
}
|
||||
|
||||
export function Logo({
|
||||
variant = 'color',
|
||||
size = 'md',
|
||||
withText = true,
|
||||
alt = 'iMarket Korea',
|
||||
className,
|
||||
...props
|
||||
}: LogoProps) {
|
||||
const s = sizes[size]
|
||||
|
||||
return (
|
||||
<div className={cn('flex items-center', s.gap, className)} {...props}>
|
||||
<img
|
||||
src={sources[variant]}
|
||||
alt={withText ? '' : alt}
|
||||
className={cn('w-auto select-none', s.img)}
|
||||
/>
|
||||
{withText && (
|
||||
<span className={cn('font-bold tracking-[-0.4px] text-foreground', s.text)}>
|
||||
iMarket Korea
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Logo
|
||||
Reference in new issue
Block a user