0.0.1 • Published 6 years ago

@helpusersvote/election-copy v0.0.1

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

@helpusersvote/election-copy

JavaScript functions to render election-related CTAs

Installation

First, add the module to your codebase:

npm install --save @helpusersvote/election-copy

Usage

In your app, import functions and text from the @helpusersvote/election-copy module:

import { getElectionText, electionCopy } from '@helpusersvote/election-copy'

// Pass in optional configuration to `getElectionText()`

const {
  // Election day is in 3 days!
  titleText,
  // Get ready to vote
  ctaText,
  // https://vote.org
  ctaHref
} = getElectionText({ type: 'countdown', daysLeft: 3 })

// Or get the static text directly with `electionCopy`

const {
  text: {
    registration: {
      // Get ready to vote in 2018!
      title: titleText,
      // Check if you're registered today
      cta: ctaText
    }
  }
} = electionCopy

License

All modules are open-sourced under the MIT License