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 #15 from gabrielduete/feat/create-footer
- Loading branch information
Showing
12 changed files
with
170 additions
and
17 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
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,16 @@ | ||
const items = [ | ||
{ | ||
title: 'Company', | ||
texts: ['About', 'Testimonials', 'Find a doctor', 'Apps'], | ||
}, | ||
{ | ||
title: 'Region', | ||
texts: ['Idonesia', 'Singapore', 'Hongkong', 'Canada'], | ||
}, | ||
{ | ||
title: 'Help', | ||
texts: ['Help center', 'Contact support', 'Instructions', 'How it works'], | ||
}, | ||
] | ||
|
||
export default items |
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,28 @@ | ||
import { render, screen } from '@testing-library/react' | ||
|
||
import items from './Footer.data' | ||
|
||
import Footer from '.' | ||
|
||
describe('<Footer />', () => { | ||
beforeEach(() => { | ||
render(<Footer />) | ||
}) | ||
|
||
const itemsTexts = items.map(item => item.title) | ||
|
||
it('should section about correctly', () => { | ||
expect( | ||
screen.getByText( | ||
/Trafalgar provides progressive, and affordable healthcare, accessible on mobile and online for everyone/i | ||
) | ||
).toBeInTheDocument() | ||
expect( | ||
screen.getByText(/Trafalgar PTY LTD 2020. All rights reserved/i) | ||
).toBeInTheDocument() | ||
}) | ||
|
||
it.each(itemsTexts)('shold render %s section items 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,19 @@ | ||
import { render, screen } from '@testing-library/react' | ||
|
||
import Item from '.' | ||
|
||
describe('<Item />', () => { | ||
const mockItems = ['Cazuza', 'Titãs', 'Mamonas Assassinas'] | ||
|
||
beforeEach(() => { | ||
render(<Item title='Raul Seixas' items={mockItems} />) | ||
}) | ||
|
||
it('should render title correctly', () => { | ||
screen.getByText('Raul Seixas') | ||
}) | ||
|
||
it.each(mockItems)('shold render %s texts 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,25 @@ | ||
import Title from '../../Title' | ||
|
||
type ItemProps = { | ||
title: string | ||
items: string[] | ||
} | ||
|
||
const Item = ({ title, items }: ItemProps) => { | ||
return ( | ||
<div> | ||
<Title>{title}</Title> | ||
<div className='mt-6'> | ||
{items.map(text => { | ||
return ( | ||
<p className='mt-2' key={text}> | ||
{text} | ||
</p> | ||
) | ||
})} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Item |
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,44 @@ | ||
import Logo from '../Logo' | ||
import Item from './Item' | ||
|
||
import items from './Footer.data' | ||
|
||
const Footer = () => { | ||
return ( | ||
<footer | ||
className=' | ||
flex | ||
max-lg:flex-col | ||
items-center | ||
max-lg:items-start | ||
justify-center | ||
gap-48 | ||
max-lg:gap-20 | ||
py-28 | ||
px-14 | ||
bg-gradient-to-b | ||
from-sky-300 | ||
to-blue-500 | ||
text-white | ||
' | ||
> | ||
<div className='max-w-[330px]'> | ||
<Logo type='white' /> | ||
<p className='mt-5'> | ||
Trafalgar provides progressive, and affordable healthcare, accessible | ||
on mobile and online for everyone | ||
</p> | ||
<p className='mt-7'> | ||
© Trafalgar PTY LTD 2020. All rights reserved | ||
</p> | ||
</div> | ||
<div className='flex max-lg:flex-col gap-40 max-lg:gap-14'> | ||
{items.map(({ title, texts }) => { | ||
return <Item title={title} items={texts} key={title} /> | ||
})} | ||
</div> | ||
</footer> | ||
) | ||
} | ||
|
||
export default Footer |
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
type LogoProps = { | ||
type: 'black' | 'white' | ||
} | ||
|
||
const Logo = ({ type }: LogoProps) => { | ||
const isBlack = type === 'black' | ||
|
||
return ( | ||
<div className='flex items-center justify-center gap-3 w-40'> | ||
<p | ||
className={`text-3xl font-semibold p-1 rounded-full w-11 flex justify-center ${ | ||
isBlack ? 'text-white bg-blue-500' : 'text-sky-300 bg-white' | ||
}`} | ||
> | ||
T | ||
</p> | ||
<h1 | ||
className={`text-2xl font-semibold ${ | ||
isBlack ? 'text-slate-950' : 'text-white' | ||
}`} | ||
> | ||
Trafalgar | ||
</h1> | ||
</div> | ||
) | ||
} | ||
|
||
export default Logo |
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