0.10.0 • Published 6 years ago

@lemontech/headerstrip v0.10.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@lemontech/headerstrip npm Travis Codecov

A component to display advertising campaings as a header banner in your apps. Stores behavior locally on localStorage.

Usage

  • Install with yarn add @lemontech/headerstrip.
  • Install peer dependencies (if you haven't already) yarn add react@^16.0.0 react-dom@^16.0.0.
  • Use the component:
import Headerstrip from '@lemontech/headerstrip'
import '@lemontech/headerstrip/dist/headerstrip.css'

<Headerstrip />

Demo

Props

proptypedefaultrequireddescription
idstringtrueAdvertising unique id, if not supplied the headerstrip will not render.
titlestringtrueHeaderstrip title, the main message should be here.
textsobject{accept: 'Accept', dismiss: 'Dismiss', remind_me_later: 'Snooze'}Texts used in the component action buttons.
onAcceptfunctiontrueCallback when accept button is clicked.
showDismissbooleantrueShow Dismiss button.
onDismissfunctionCallback when dismiss button is clicked.
showSnoozebooleantrueShow Snooze button.
onSnoozefunctionCallback when snooze button is clicked.
npsShowbooleanfalseShow NPS format.
npsobject{ranking: 10,texts: {left: 'Unlikely',right: 'Very likely',},progressColor: 'rgba(230,123,47,1)',}Texts and props used in the component nps.

Development

  • Run yarn start to start building the library in watch mode.
  • Write stories in the stories/index.js file.
  • This project lints and prettifies source files automatically before commiting. You can run yarn lint and yarn prettify to do this operations manually before commiting (although you shouldn't need to).

Testing

  • Pending