fansunited-component-either-or v0.0.17
Fans United component library starter kit
This template provides a minimal setup to get you started developing React components for Fans United functionality.
You can fork this repo, create a component and publish it to NPM for use in other projects.
How to run the project
First, you'd need to download the dependencies from NPM:
npm installThen to run it for development, you use:
npm run devTo build a package for production, you run:
npm run buildThis will export the JS files to /dist dir.
To publish the project to NPM, you run:
npm publishDirectory structure
Your code sits in the src dir. Here you will find:
main.tsx- The entry point for the applicationApp.tsx- The top-level component that accepts all the propscoredir - Contains different files needed for the app - types, translations, etc.componentsdir - Where your code should live. TheIndexcomponent is the main component you'd need to work on
Styling
Our components depend on the JoyUI framework
Fans United SDK
When in production the component will expect a fansUnitedSDK prop containing an instance of the Fans United SDK.
However, for development purposes, this is not a good approach. This is why, when in development, we are giving the developer the opportunity to define an SDK instance using env variables. Check the .env file for details on which variables you need.