woowoof

Allows for incremental site rebranding by route.

Usage no npm install needed!

<script type="module">
  import woowoof from 'https://cdn.skypack.dev/woowoof';
</script>

README

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

Name Type Description
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.