Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #52 from 4alltecnologia/fix/header-optional-backlink
Browse files Browse the repository at this point in the history
🎨 fix header to support absence of backlink
  • Loading branch information
AnnyFigueira authored Dec 30, 2019
2 parents 25453a0 + 3eb3393 commit 36bafd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Header({ breadcrumbLinks, title, backLink, containerStyles }) {
</styles.SmallHeader>
<styles.Title>{title}</styles.Title>
</styles.LeftHeader>
<styles.RightHeader>{renderBackLink(backLink)}</styles.RightHeader>
{backLink && <styles.RightHeader>{renderBackLink(backLink)}</styles.RightHeader>}
</styles.InnerHeader>
</styles.Container>
</styles.Header>
Expand All @@ -40,15 +40,8 @@ function Header({ breadcrumbLinks, title, backLink, containerStyles }) {

Header.defaultProps = {
title: '',
breadcrumbLinks: [
{ external: true, link: '/', text: 'Gestão de MKTP' },
{ link: '/', text: 'Importação' },
],
backLink: {
text: '',
external: false,
link: '',
},
breadcrumbLinks: [{ external: true, link: '/', text: 'Home' }, { link: '/', text: 'Listagem' }],
backLink: null,
containerStyles: {
width: '100%',
margin: '0 auto',
Expand Down
6 changes: 6 additions & 0 deletions src/stories/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ storiesOf('Header', module)
backLink={{ text: 'Voltar para Itens', external: true, link: '/' }}
/>
))
.add('Without backlink', () => (
<Header
breadcrumbLinks={[{ external: true, link: '/', text: 'Home' }, { link: '/', text: 'Itens' }]}
title="Item1"
/>
))
.add('Custom style', () => (
<Header
breadcrumbLinks={[{ external: true, link: '/', text: 'Home' }, { link: '/', text: 'Itens' }]}
Expand Down

0 comments on commit 36bafd7

Please sign in to comment.