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

feat(Header): add create() factory #809

Merged
merged 2 commits into from
Jan 31, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Add RTL examples for `Button` and `Divider` components @mnajdova ([#792](https://github.com/stardust-ui/react/pull/792))
- Add mechanism for marking icons that should rotate in RTL in Teams theme; marked icons: `send`, `bullets`, `leave`, `outdent`, `redo`, `undo`, `send` @mnajdova ([#788](https://github.com/stardust-ui/react/pull/788))
- Remove ability to introduce global style overrides for HTML document from `pxToRem` @kuzhelov ([#789](https://github.com/stardust-ui/react/pull/789))
- Add `create` shorthand factory to `Header` component @layershifter ([#809](https://github.com/stardust-ui/react/pull/809))

### Fixes
- Handle `onClick` and `onFocus` on ListItems correctly @layershifter ([#779](https://github.com/stardust-ui/react/pull/779))
Expand Down
5 changes: 5 additions & 0 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from 'react'

import {
childrenExist,
createShorthandFactory,
customPropTypes,
UIComponent,
UIComponentProps,
Expand Down Expand Up @@ -38,6 +39,8 @@ export interface HeaderProps
* In addition to that, both will be displayed in the list of headings.
*/
class Header extends UIComponent<ReactProps<HeaderProps>, any> {
static create: Function

static className = 'ui-header'

static displayName = 'Header'
Expand Down Expand Up @@ -84,4 +87,6 @@ class Header extends UIComponent<ReactProps<HeaderProps>, any> {
}
}

Header.create = createShorthandFactory(Header, 'content')

export default Header