1.0.0 • Published 3 years ago
woowoof v1.0.0
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 releasedRELEASED
= rebranding is live on this route and accessible to the public
Install
$ yarn add @hey-car/rebrand
Usage
- Import
Rebrand
import { Rebrand } from '@hey-car/rebrand';
- 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 releasedRELEASED
= 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.
1.0.0
3 years ago