components-cart
Cart components live in many pages of the app including Cart, Checkout, PDP, Order Summary.
Their functionality can vary widely between these apps so we are using a variant system help isolate changes.
Variant System
/ComponentX
- ComponentX.tsx
- styles.tsx
- helpers.ts
/variants
- ComponentXCart
- ComponentXCheckout
- ComponentXFlyIn
- ...etc
/components
- SharedComponentA
- SharedComponentB
- All styling should go into a styles.tsx folder so it doesn't clutter components
- Shared components should go in the components folder
- Shared logic can go in a helpers.ts file
Usage
-
See index.ts for available code exported from this package
-
Remember to install peer-deps when using this package in another repo
-
See package.json for a list of useful commands
-
run npm run build; yalc publish; npm run watch
to do hot reloading while yalcing with another repo