├── .editorconfig ├── .gitignore ├── .travis.yml ├── README.md ├── __mocks__ └── fileMock.ts ├── example ├── .env ├── README.md ├── package-lock.json ├── package.json ├── public │ ├── index.html │ └── manifest.json └── src │ ├── App.js │ ├── index.css │ ├── index.js │ └── news-icon.png ├── jest.config.js ├── package-lock.json ├── package.json ├── rollup.config.js ├── src ├── __tests__ │ └── ticker.test.tsx ├── global.d.ts ├── images │ ├── chevron-down.svg │ └── chevron-up.svg ├── index.tsx ├── styles.css ├── tickers │ ├── FinancialTicker │ │ ├── index.tsx │ │ └── styles.css │ ├── NewsTicker │ │ ├── index.tsx │ │ └── styles.css │ └── Ticker │ │ ├── index.tsx │ │ └── styles.css └── typings.d.ts ├── tsconfig.json └── tsconfig.test.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # See https://help.github.com/ignore-files/ for more about ignoring files. 3 | 4 | # dependencies 5 | node_modules 6 | 7 | # builds 8 | build 9 | dist 10 | .rpt2_cache 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 16 4 | after_success: 5 | - cd example && npm install && npm run build 6 | before_deploy: 7 | - cd .. 8 | deploy: 9 | - provider: npm 10 | email: "jeremyrajan@gmail.com" 11 | api_key: $NPM_TOKEN 12 | edge: true 13 | on: 14 | tags: true 15 | - provider: pages 16 | skip_cleanup: true 17 | github_token: $GITHUB_TOKEN 18 | keep_history: true 19 | local_dir: "example/build" 20 | on: 21 | branch: master 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # nice-react-ticker 2 | 3 | > Nicest react ticker in town 4 | 5 | [](https://www.npmjs.com/package/nice-react-ticker) [](https://standardjs.com) 6 | [](https://travis-ci.com/jeremyrajan/nice-react-ticker) 7 | 8 | ## Install 9 | 10 | ```bash 11 | npm install --save nice-react-ticker 12 | ``` 13 | 14 | **Demo**: https://jeremyrajan.github.io/nice-react-ticker/ 15 | 16 | ## Usage 17 | 18 | The library provides with 2 kinds of tickers: 19 | 20 | 1. Financial Ticker: Heavily inspired from https://www.tradingview.com/ 21 | 2. News Ticker: Lightweight news ticker 22 | 23 | You can refer to the demo below for the props and refer to `/example` folder for implementation. 24 | 25 | ```tsx 26 | import React, { Component } from 'react' 27 | import Ticker, { FinancialTicker, NewsTicker } from 'nice-react-ticker'; 28 | import icon from './news-icon.png'; // add images, please make sure they can be set as src 29 | 30 | 31 | export default class App extends Component { 32 | render() { 33 | return ( 34 |