Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified

Plans v2

This is the React component that renders a newer iteration of the Plans selection screen.

See: p1HpG7-8PX-p2

Routes

Routes can have a customizable root, but are by default as follows:

  • /:duration? - Selector, with optional billing cycle duration selected. Default is annual.

These are all defined in the index.ts file. This exports a function that accepts a root path string and Page.js callbacks to be inserted before rendering the plans. See the plans page for an implementation.

Data Flow

The architecture of this section is designed to normalize the disparate data structures into a unified product type, called the SelectorProduct. This is done by ingesting plans from a source such as constants in libraries or an API, and transforming it into this type. The code for this parsing is in the itemToSelectorProduct function. This is run in the pages and flows into the ProductCardWrapper component for additional state information and wiring to the component UI.

This is designed as a foundation for an eventual switch to an API that would unify the disparate data types and enable things like conditional deals and A/B testing to occur without complex code changes.