diff --git a/src/App.tsx b/src/App.tsx index 25f9202..8f29cab 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -12,30 +12,17 @@ function App() { return (
- - + +

Vite + React + TypeScript + tailwindcss

diff --git a/src/components/Logo.spec.tsx b/src/components/Logo.spec.tsx index 0ae4e22..8eca574 100644 --- a/src/components/Logo.spec.tsx +++ b/src/components/Logo.spec.tsx @@ -5,32 +5,12 @@ import { Logo } from './Logo' describe('logo', () => { it('should render link and image', () => { - render( - - ) + render() expect(screen.getByRole('link', { name: /vite logo/i })).toBeInTheDocument() expect(screen.getByRole('img', { name: /vite logo/i })).toBeInTheDocument() - }) - - it('should render image with custom class', () => { - render( - - ) - expect(screen.getByRole('img', { name: /vite logo/i })).toHaveClass( - 'h-24 transition duration-300 hover:drop-shadow-[0_0_2em_#646CFF] animate-[spin_20s_linear_infinite]' + 'h-24 transition duration-300 hover:drop-shadow-[0_0_2em_#646CFF]' ) }) }) diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index 4e0a045..e7df79f 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -1,22 +1,25 @@ import clsx from 'clsx' interface LogoProps { - className?: string - color: string imgSrc: string link: string - name: string + name: 'React' | 'tailwindcss' | 'TypeScript' | 'Vite' } -export const Logo = ({ color, className, link, name, imgSrc }: LogoProps) => { +const classNames = { + Vite: 'hover:drop-shadow-[0_0_2em_#646CFF]', + React: + 'hover:drop-shadow-[0_0_2em_#61DAFB] animate-[spin_20s_linear_infinite]', + TypeScript: 'hover:drop-shadow-[0_0_2em_#3178C6]', + tailwindcss: 'hover:drop-shadow-[0_0_2em_#06B6D4]', +} + +export const Logo = ({ link, imgSrc, name }: LogoProps) => { return ( {`${name}