Skip to content

Commit

Permalink
Merge pull request #198 from vtex/feature/page-header
Browse files Browse the repository at this point in the history
Add pageheader
  • Loading branch information
kevinch authored Jul 4, 2018
2 parents c151035 + fd61c48 commit c02b689
Show file tree
Hide file tree
Showing 33 changed files with 79 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [5.1.0] - 2018-7-3
## [5.2.0] - 2018-07-04

### Added

- **PageHeader**

## [5.1.0] - 2018-07-03

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vtex/styleguide",
"version": "5.1.1",
"version": "5.2.0",
"scripts": {
"test": "react-scripts test --env=jsdom",
"test:codemod": "jest codemod",
Expand Down
18 changes: 18 additions & 0 deletions react/components/PageHeader/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Default

```js
<PageHeader title="Invoices" />
```

With back link

```js
<PageHeader
title="Invoice"
backLabel="Back"
backUrl="http://wikipedia.com"
backClick={e => {
console.log(e)
}}
/>
```
55 changes: 55 additions & 0 deletions react/components/PageHeader/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'

import ArrowBack from '../icon/ArrowBack'
import Button from '../Button'

class PageHeader extends PureComponent {
handleClick = e => {
this.props.backClick && this.props.backClick(e)
}

render() {
const { backLabel } = this.props

return (
<div className="bg-near-white pa5">
{backLabel && (
<Button
size="small"
variation="tertiary"
neutral
onClick={this.handleClick}
>
<span
className="flex align-baseline relative"
style={{ marginLeft: '-16px' }}
>
<span className="mr3">
<ArrowBack color="currentColor" />
</span>

{backLabel}
</span>
</Button>
)}

<div
className={`near-black f2 fw6 mt2 mb7 ${
backLabel ? 'mt2' : 'mb2 mt8'
}`}
>
{this.props.title}
</div>
</div>
)
}
}

PageHeader.propTypes = {
title: PropTypes.string.isRequired,
backLabel: PropTypes.string,
backClick: PropTypes.func,
}

export default PageHeader
Binary file modified styleguide-visual/Alert_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Badge_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Button_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Button_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Button_3_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Button_5_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Button_6_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Card_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Card_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Checkbox_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Checkbox_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Dropdown_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Dropdown_3_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/EmptyState_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/EmptyState_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Icons_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Input_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Input_3_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styleguide-visual/PageHeader_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added styleguide-visual/PageHeader_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/RadioGroup_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/RadioGroup_3_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Spinner_1_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Spinner_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Table_2_desktop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified styleguide-visual/Tabs_1_desktop.png
Binary file modified styleguide-visual/Toggle_1_desktop.png
Binary file modified styleguide-visual/Toggle_2_desktop.png
Binary file modified styleguide-visual/Toggle_3_desktop.png

0 comments on commit c02b689

Please sign in to comment.