3.1.19 • Published 5 years ago

the-header v3.1.19

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

the-header

Build Status npm Version JS Standard

Header of the-components

Installation

$ npm install the-header --save

Usage

'use strict'

import React from 'react'
import { TheRouter } from 'the-router'
import { TheRoute } from 'the-route'
import { TheHeader, TheHeaderStyle } from 'the-header'
import { TheButton, TheButtonStyle } from 'the-button'

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    this.state = {
      notice: true
    }
  }

  render () {
    const {MockPage} = ExampleComponent
    const {Logo, Tab, TabItem, RightArea} = TheHeader
    return (
      <div>
        <TheRouter.Hash>
          <TheHeaderStyle/>
          <TheButtonStyle/>
          <TheHeader notices={this.state.notice ? {
            'you needs to verify your email': {
              'send again': () => this.setState({notice: false})
            }
          } : {}}>
            <Logo>Some app</Logo>
            <Tab>
              <TabItem to='/page-a'>PageA</TabItem>
              <TabItem to='/page-b'>PageB</TabItem>
            </Tab>
            <RightArea>
              <TheButton>Login</TheButton>
              <TheButton primary>Sign Up</TheButton>
            </RightArea>
          </TheHeader>
          <div>
            <MockPage path='/page-a'
                      color='#83A'
                      message='This is Page A'
            />
            <MockPage path='/page-b'
                      color='#38A'
                      message='This is Page B'
            />

            <hr/>

            <TheHeader asOverlay
                       style={{top: 190}}
            >
              <Logo>Some app with overlay header</Logo>
              <Tab>
                <TabItem to='/page-a'>PageA</TabItem>
                <TabItem to='/page-b'>PageB</TabItem>
                <TabItem to='/page-b' icon='fa fa-search'/>
              </Tab>
              <RightArea>
                <TheButton>Login</TheButton>
                <TheButton primary>Sign Up</TheButton>
              </RightArea>
            </TheHeader>

            <hr/>


            <TheHeader asOverlay
                       reversed
                       ribbon={'This is a ribbon'}
                       style={{top: 400}}
            >
              <Logo>Some app with overlay header</Logo>
              <Tab>
                <TabItem to='/page-a'>PageA</TabItem>
                <TabItem to='/page-b'>PageB</TabItem>
                <TabItem to='/page-b' icon='fa fa-search'/>
              </Tab>
              <RightArea>
                <TheButton>Login</TheButton>
                <TheButton primary>Sign Up</TheButton>
              </RightArea>
            </TheHeader>


            <br/>
            <TheHeader asStatic>
              <Logo>Some app with static header</Logo>
            </TheHeader>
          </div>
        </TheRouter.Hash>
      </div>
    )
  }

  static MockPage ({path, color, message}) {
    return (
      <TheRoute path={path}
                component={({}) => (
                  <div style={{color}}>
                    {message}
                  </div>
                )}
      >

      </TheRoute>
    )
  }
}

export default ExampleComponent

Components

TheHeader

Header of the-components

Props

NameTypeDescriptionDefault
asOverlayboolStyle as overlayfalse
asStaticboolRender with static positioningfalse
noticesobjectNotices{}
reversedboolReversed themefalse
ribbonnodeRibbon to shownull
role'banner'

TheHeaderStyle

Style for TheHeader

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

3.1.19

5 years ago

3.1.18

5 years ago

3.1.17

5 years ago

3.1.16

6 years ago

3.1.15

6 years ago

3.1.14

6 years ago

3.1.13

6 years ago

3.1.12

6 years ago

3.1.11

6 years ago

3.1.10

6 years ago

3.1.9

6 years ago

3.1.7

6 years ago

3.1.6

6 years ago

3.1.5

6 years ago

3.1.4

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.9

6 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.4

7 years ago

1.5.3

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.8

7 years ago

1.4.7

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.10

7 years ago

1.2.9

7 years ago

1.2.8

7 years ago

1.2.7

7 years ago

1.2.6

7 years ago

1.2.5

7 years ago

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago