INSTALL
Need Peer Dependencies:
yarn add lodash react react-dom lodash prop-types react-router react-transition-group styled-components
Install:
yarn add twreporter-react-header-components
USE
ES6:
import Header from 'twreporter-react-header-components/lib/components/header'
const Page = (props) => (
<div>
<Header
isChannelsDisplayed
pageTheme={props.pageTheme}
pathName={props.pathName}
/>
{props.children}
</div>
)
Props:
isChannelsDisplayed
: Config to display channels menu or not.pageTheme
: The page theme passed by twreporter-react
. DARK
or BRIGHT
.pathName
: The pathname passed by twreporter-react
. With format likes /categories/inforgraphic
, /photography
.
Developement
Source code
- For this package:
/header-components/src/
- Shared by all packages under
twreporter-react-components
: /shared/
gulp.watch
Automatically rebuild while files change.
cd twreporter-react-components/header-components
npm run dev
Build (pre-publish)
cd twreporter-react-components/header-components
npm run build
Pubish
cd twreporter-react-components/header-components
npm publish