1.0.0 • Published 3 years ago

woowoof v1.0.0

Weekly downloads
9
License
-
Repository
github
Last release
3 years ago

Heycar Rebrand


Allows for incremental site rebranding by route.

Routes can be in two statuses:

  • ENABLED = rebrand route is accessible via query param ?rebrand=true i.e not released
  • RELEASED = rebranding is live on this route and accessible to the public

Install

$ yarn add @hey-car/rebrand

Usage

  1. Import Rebrand
import { Rebrand } from '@hey-car/rebrand';
  1. Instantiate Rebrand class with location, route list config, and themes.
const rebrand = new Rebrand(location, routeListConfig, themes);

Rebrand Parameters

NameTypeDescription
location{pathname: string; query?: string;}Current location object with pathname and optional query parameter
routeListConfig{ENABLED: string[]; RELEASED: string[];}Dictionary of lists of pathname indexed by rebrand status
themes{current: object; rebrand: object;}Object with current theme object and rebrand theme object

Additional info

Rebrand Statuses

Routes can be in two statuses:

  • ENABLED = rebrand route is accessible via query param ?rebrand=true i.e not released
  • RELEASED = rebranding is live on this route and accessible to the public

Themes

The Rebrand module will decide based on your location and routeListConfig which theme to return.