generated from gabrielduete/frontend-template-nextjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from gabrielduete/feat/create-section-service
- Loading branch information
Showing
7 changed files
with
146 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export const CARDS = [ | ||
{ | ||
title: 'Search doctor', | ||
subtitle: | ||
'Choose your doctor from thousands of specialist, general, and trusted hospitals', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892291909390346/img-search.png', | ||
}, | ||
{ | ||
title: 'Online pharmacy', | ||
subtitle: | ||
'Buy your medicines with our mobile application with a simple delivery system', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892384364441700/img-pharmacy.png', | ||
}, | ||
{ | ||
title: 'Consultation', | ||
subtitle: | ||
'Free consultation with our trusted doctors and get the best recomendations ', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892245730119710/img-consultation.png', | ||
}, | ||
{ | ||
title: 'Details info', | ||
subtitle: | ||
'Free consultation with our trusted doctors and get the best recomendations', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892496864071780/img-details.png', | ||
}, | ||
{ | ||
title: 'Emergency care', | ||
subtitle: | ||
'You can get 24/7 urgent care for yourself or your children and your lovely family', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892465088020511/img-emergency.png', | ||
}, | ||
{ | ||
title: 'Tracking', | ||
subtitle: 'Track and save your medical history and health data ', | ||
image: | ||
'https://media.discordapp.net/attachments/778024116140769331/1141892429650350081/img-tracking.png', | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { render, screen } from '@testing-library/react' | ||
|
||
import { CARDS } from './SectionServices.data' | ||
|
||
import SectionServices from '.' | ||
|
||
describe('<SectionServices />', () => { | ||
beforeEach(() => { | ||
render(<SectionServices />) | ||
}) | ||
|
||
const items = CARDS.map(card => card.title) | ||
|
||
it('should render title, subtitle and button correctly', () => { | ||
expect(screen.getByText(/Our services/i)).toBeInTheDocument() | ||
expect( | ||
screen.getByText( | ||
/We provide to you the best choiches for you. Adjust it to your health needs and make sure your undergo treatment with our highly qualified doctors you can consult with us which type of service is suitable for your health/i | ||
) | ||
).toBeInTheDocument() | ||
expect(screen.getByText(/Learn more/i)).toBeInTheDocument() | ||
}) | ||
|
||
it.each(items)('shold render %s title card correctly', title => { | ||
expect(screen.getByText(title)).toBeInTheDocument() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import Title from '../Title' | ||
import { CARDS } from './SectionServices.data' | ||
import Image from 'next/image' | ||
import Button from '../Button' | ||
|
||
const SectionServices = () => { | ||
return ( | ||
<section className='flex flex-col items-center justify-center mt-48 mb-52 max-md:px-4 px-48'> | ||
<Title fontSize='text-3xl' hasLine={true}> | ||
Our Services | ||
</Title> | ||
<p className='text-gray-500 text-xl text-center mt-6 max-w-[1050px] '> | ||
We provide to you the best choiches for you. Adjust it to your health | ||
needs and make sure your undergo treatment with our highly qualified | ||
doctors you can consult with us which type of service is suitable for | ||
your health | ||
</p> | ||
<div className='flex flex-wrap items-center justify-center gap-9 mt-20 '> | ||
{CARDS.map(({ title, subtitle, image }) => { | ||
return ( | ||
<div | ||
key={title} | ||
className='flex flex-col justify-center p-10 pr-16 max-w-full rounded-2xl bg-white drop-shadow-xl h-[350px]' | ||
> | ||
<div className='mb-6'> | ||
<Image | ||
src={image} | ||
alt={image} | ||
width={ | ||
title === CARDS[0].title || title === CARDS[4].title | ||
? 85 | ||
: 70 | ||
} | ||
height={title === CARDS[4].title ? 70 : 93} | ||
quality={100} | ||
/> | ||
</div> | ||
<Title fontSize='text-2xl'>{title}</Title> | ||
<p className='w-64 mt-3 text-gray-500'>{subtitle}</p> | ||
</div> | ||
) | ||
})} | ||
</div> | ||
<div className='mt-20'> | ||
<Button | ||
style='outlined' | ||
content='Learn more' | ||
padding='px-9' | ||
textColor='text-blue-500' | ||
/> | ||
</div> | ||
</section> | ||
) | ||
} | ||
|
||
export default SectionServices |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
import React from 'react' | ||
|
||
type TitleProps = { | ||
content: string | ||
children: string | React.ReactElement | ||
fontSize?: string | ||
width?: string | ||
hasLine?: boolean | ||
} | ||
|
||
const Title = ({ content, width }: TitleProps) => { | ||
return <h1 className={`text-5xl font-bold break-all ${width}`}>{content}</h1> | ||
const Title = ({ children, fontSize, width, hasLine }: TitleProps) => { | ||
return ( | ||
<h1 className={`font-bold break-all ${width} ${fontSize}`}> | ||
<span className='flex flex-col gap-6'> | ||
{children} | ||
{hasLine && <span className='self-center block w-14 h-0.5 bg-black' />} | ||
</span> | ||
</h1> | ||
) | ||
} | ||
|
||
export default Title |