JSPM

@times-components/star-button

0.4.117-bac6b8e500a02071e1be89be7f925d003afae003.1+bac6b8e500
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120
  • Score
    100M100P100Q94727F
  • License BSD-3-Clause

Star button

Package Exports

  • @times-components/star-button
  • @times-components/star-button/dist/star-button.js
  • @times-components/star-button/rnw
  • @times-components/star-button/rnw.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@times-components/star-button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

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.