@times-components/star-button
v0.4.85
Published
Star button
Downloads
82
Readme
Star Button
A star button component which is clickable and has three states: default
, selected
, disabled
StarButton
- wraps a star svg and is clicable.
How to use
import StarButton from "@times-components/star-button";
// works this way
<StarButton onPress={this.onStarPress} />;
<StarButton onPress={this.onStarPress} disabled={true} />;
<StarButton onPress={this.onStarPress} selected={true} />;
It changes colours and opacity based on the different state it has.
default
star is clickable and has default colour.
disabled
does not allow the star to be clicked.
selected
would change the star colour.
If disabled
and selected
are both true - disabled
takes precedence.
Contributing
Please read CONTRIBUTING.md before contributing to this package
Running the code
Please see our main README.md to get the project running locally
Development
The code can be formatted and linted in accordance with the agreed standards.
yarn fmt
yarn lint
Testing
This package uses yarn (latest) to run unit tests on each platform with jest.
yarn test:web
Visit the official storybook to see our available link templates.