prizeout-ui
v1.0.24
Published
Shared PO component library
Readme
Prizeout UI
A shared component library for Prizeout, designed to provide reusable UI elements across Prizeout projects.
Table of Contents
Installation
To set up the Prizeout UI component library, ensure that you're using the correct version of Node.js. You can easily switch to the required version using nvm. Once you're on the right version, install the necessary dependencies and prepare the project.
Steps:
Switch to the required Node.js version:
nvm useInstall the project's dependencies:
npm installPrepare the project (this configures Git hooks and ensures Husky is set up):
npm run prepare
After these steps, you should be ready to start developing or using the library.
Usage
To use components from the Prizeout UI library in your project, first install it as a dependency in your project. For example:
npm install prizeout-uiThen, you can import and use the components in your application:
import { Button, Modal } from 'prizeout-ui';
const MyComponent = () => (
<div>
<Button label="Click me" />
<Modal isOpen={true} title="Welcome" />
</div>
);Development
To contribute or modify the component library locally:
Clone the repository:
git clone https://github.com/your-username/prizeout-ui.git cd prizeout-uiInstall the dependencies:
npm installStart the development environment:
npm run storybook
This will launch a local development server where you can view and test components.
Running Tests
To run unit tests for the components:
npm testThis ensures the integrity and functionality of the components.
Contributing
Contributions to the Prizeout UI library are by all team members! Please follow these steps to contribute:
Fork the repository and create your branch:
git checkout -b WV2-XXXX-your-feature-nameMake your changes and commit with a descriptive message:
git commit -m "WV2-XXXX: Add new feature XYZ"Push to your branch and create a pull request:
git push origin WV2-XXXX-your-feature-name
Pre-commit Hooks
Husky is used to ensure code quality and consistency through pre-commit hooks. These hooks run automatically before you commit your code to ensure it meets project standards (e.g., linting, tests, etc.).
To configure Husky properly, make sure to run the following command when setting up the project:
npm run prepareThis will set up the Git hooks for you. If you encounter any issues, verify that Husky is configured correctly by checking the .husky directory.
