Skip to content

Commit

Permalink
feat: crete structure introduction component and title component
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielduete committed Aug 6, 2023
1 parent 060834c commit e7fd6a6
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
images: { domains: ['media.discordapp.net'] },
}

module.exports = nextConfig
4 changes: 3 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import Introduction from '~/src/components/Introduction'

const Home = () => {
return <h1 className='text-3xl font-bold underline'>HELLO WORLD!</h1>
return <Introduction />
}

export default Home
Empty file.
Empty file removed src/components/Exemple/index.tsx
Empty file.
Empty file removed src/components/Exemple/styles.ts
Empty file.
25 changes: 25 additions & 0 deletions src/components/Introduction/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Image from 'next/image'

import Title from '../Title'

const Introduction = () => {
return (
<section className='px-48 flex justify-center items-center gap-28'>
<div>
<Title content='Virtual healthcare for you' width='w-[427px]' />
<p className='text-gray-500 text-xl mt-6 w-[410px]'>
Trafalgar provides progressive, and affordable healthcare, accessible
on mobile and online for everyone
</p>
</div>
<Image
src='https://media.discordapp.net/attachments/778024116140769331/1137638119047446629/trafalgar-header_illustration_1.png'
alt='decorative image'
width={700}
height={600}
/>
</section>
)
}

export default Introduction
13 changes: 13 additions & 0 deletions src/components/Title/Title.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { render, screen } from '@testing-library/react'

import Title from '.'

describe('<Title />', () => {
it('should render title correctly', () => {
const title = 'Shiryu amigo'

render(<Title content={title} />)

expect(screen.getByText(title)).toBeInTheDocument()
})
})
10 changes: 10 additions & 0 deletions src/components/Title/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type TitleProps = {
content: string
width?: string
}

const Title = ({ content, width }: TitleProps) => {
return <h1 className={`text-5xl font-bold ${width}`}>{content}</h1>
}

export default Title

0 comments on commit e7fd6a6

Please sign in to comment.