npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ian-test-react-components

v0.3.25

Published

Library of react components for the Rome Terminal

Downloads

5

Readme

Search Bar Token Pair Centric Widget

A react component which fetches token pairs and shows information from various network and its exchanges

Current version is 0.3.21 | version | description |

  • | 0.3.22| Fix style for long token name ellipsed
  • | 0.3.21| Allow duplicated exchanges in networks

Prerequisites

This project requires NodeJS (version 16.13 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

$ npm -v && node -v
16.13.1
v8.1.2

Table of contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See notes on how to publish and deploy the project on a live system.

Installation

$ npm i @romeblockchain/react-components

Or if you prefer using Yarn:

$ yarn add @romeblockchain/react-components

Usage

Launching the app on development mode

$ git clone https://github.com/Rome-Blockchain-Labs/terminal-library.git
$ cd terminal-library
$ npm run dev

Building a distribution version

$ npm run build

This task will create a distribution version of the project inside your local dist/ folder

Publishing package into npm repositories

Before npm publish, it requires that you already logged into npm repository.

$ npm login
$ Username: 
$ Password:
$ Email: (this IS public)

After logging into npm repository, make sure that you update the version in package.json. You can publish different version into npm so that update higher version than current.

$ npm run publish

How to use the search bar component

import { SearchBar } from '@romeblockchain/react-components';

<div>
    <SearchBar {...props} />    
</div>

API

Types

  • NetworkId
NetworkId = 'ethereum' | 'avalanche' | 'bsc' | 'moonriver' | 'moonbeam'
  • ExchangeName
ExchangeName =
  | 'uniswapv2'
  | 'uniswapv3'
  | 'sushiswap'
  | 'pangolin'
  | 'traderjoe'
  | 'pancakeswap'
  | 'safeswap'
  | 'kyberdmm'
  | 'zeroexchange'
  | 'yetiswap'
  | 'baguette'
  | 'canary'
  | 'lydiafinance'
  | 'elkfinance'
  | 'pandaswap'
  | 'complusnetwork'
  | 'oliveswap'
  | 'mdex'
  | 'ellipsis.finance'
  | 'biswap'
  | 'apeswap'
  | 'knightswap.finance'
  | 'babyswap'
  | 'synapse'
  | 'beamswap'
  | 'solarflare'
  | 'stellaswap'
  | 'zenlink'
  | 'solarbeam'
  | 'shibaswap'
  | 'quickswap'
  | 'solidex'
  | 'spookyswap'
  | 'spiritswap'
  | 'vvs.finance'
  | 'mm.finance'
  | 'cronaswap'
  | 'crodex'
  | 'cyborgswap';
  • NetworkType
NetworkType = {
  id: NetworkId;
  name?: string;
  icon?: ReactNode;
  exchanges: ExchangeType[];
}
  • ExchangeType
ExchangeType = {
  name: ExchangeName;
  icon?: ReactNode;
}
  • CustomWrapperType
CustomWrapperType = {
  backgroundColor?: string;
  borderRadius?: string;
  border?: string;
  button?: {
    borderColor?: string;
    backColor?: string;
    color?: string;
    borderRadius?: string;
    fontSize?: string;
    padding?: string;
    hoverBackColor?: string;
  };
}
  • CustomSearchInputType
CustomSearchInputType = {
  input?: {
    width?: string;
    height?: string;
    border?: string;
    color?: string;
    display?: string;
    borderRadius?: string;
    background?: string;
    padding?: string;
    fontSize?: string;
    fontFamily?: string;
  };

  icon?: {
    right?: string;
    top?: string;
    height?: number;
    width?: number;
    color?: string;
    activeColor?: string;
  };

  placeholder?: string;
}
  • CustomSearchFilterType
CustomSearchFilterType = {
  wrapper?: {
    backgroundColor?: string;
    borderRadius?: string;
    toggleColor?: string;
    toggleHeight?: string;
    toggleWidth?: string;
    toggleMarginRight?: string;
    toggleLeft?: string;
    toggleTop?: string;
    toggleBorderBottom?: string;
    toggleBorderRight?: string;
    contentBorder?: string;
    contentBorderRadius?: string;
    margin?: string;
  };

  content?: {
    network?: string;
    exchange?: string;
    header?: {
      display?: string;
      justifyContent?: string;
      alignItems?: string;
      width?: string;
      border?: string;
      backgroundColor?: string;
      color?: string;
      padding?: string;
      textAlign?: string;
      margin?: string;
      borderRadius?: string;
      fontSize?: string;
      fontWeight?: string;
      hoverColor?: string;
    };
    wrapper?: {
      justifyContent?: string;
      alignItems?: string;
      padding?: string;
      backgroundColor?: string;
      borderRadius?: string;
    };
    content?: {
      justifyContent?: string;
      alignItems?: string;
      padding?: string;
    };
    description?: {
      textAlign?: string;
      fontSize?: string;
      fontWeight?: string;
      padding?: string;
      backgroundColor?: string;
      color?: string;
    };
  };
}
  • CustomResultType
CustomResultType = {
  title?: {
    color?: string;
    fontSize?: string;
    padding?: string;
    margin?: string;
    fontSize2?: string;
  };
  content?: {
    padding?: string;
    background?: string;
    borderRadius?: string;
    width?: string;
    height?: string;
    border?: string;
    color?: string;
    display?: string;
    borderColor?: string;
    borderStyle?: string;
    borderWidth?: string;
    fontSize?: string;
    fontFamily?: string;
  };
}
  • CustomSearchFilterType
CustomSearchFilterType = {
  wrapper?: {
    backgroundColor?: string;
    borderRadius?: string;
    toggleColor?: string;
    toggleHeight?: string;
    toggleWidth?: string;
    toggleMarginRight?: string;
    toggleLeft?: string;
    toggleTop?: string;
    toggleBorderBottom?: string;
    toggleBorderRight?: string;
    contentBorder?: string;
    contentBorderRadius?: string;
    margin?: string;
  };

  content?: {
    network?: string;
    exchange?: string;
    header?: {
      display?: string;
      justifyContent?: string;
      alignItems?: string;
      width?: string;
      border?: string;
      backgroundColor?: string;
      color?: string;
      padding?: string;
      textAlign?: string;
      margin?: string;
      borderRadius?: string;
      fontSize?: string;
      fontWeight?: string;
      hoverColor?: string;
    };
    wrapper?: {
      justifyContent?: string;
      alignItems?: string;
      padding?: string;
      backgroundColor?: string;
      borderRadius?: string;
    };
    content?: {
      justifyContent?: string;
      alignItems?: string;
      padding?: string;
    };
    description?: {
      textAlign?: string;
      fontSize?: string;
      fontWeight?: string;
      padding?: string;
      backgroundColor?: string;
      color?: string;
    };
  };
}
  • ActionComponentType
ActionComponentType = {
    detail: CustomSearchFilterType
};
  • ActionType
ActionType = {
    component?: FC<ActionComponentType>,
    detail?: TokenPair
}

Props

  • customWrapper

| Type | Default value | | --- | --- | | CustomWrapperType | null |

Example:

  • customSearchInput

| Type | Default value | | --- | --- | | CustomSearchInputType | null |

Example:

  • customSearchFilter

| Type | Default value | | --- | --- | | CustomSearchFilterType | null |

Example:

  • customChip

| Type | Default value | | --- | --- | | CustomChipType | null |

Example:

  • customResult

| Type | Default value | | --- | --- | | CustomResultType | null |

Example:

  • customTokenDetail

| Type | Default value | | --- | --- | | CustomTokenDetailType | null |

Example:

  • customLoading

| Type | Default value | | --- | --- | | CustomLoadingType | null |

Example:

  • customActions

| Type | Default value | | --- | --- | | Array | null |

Example:

// customActions is the array list which has the index and component
const customActions = [
    actionComponent1
    actionComponent2   
    actionComponent3    
    ...
]

// You can refer the detail for the token pair information from the prop
const actionComponent1 = (props: ActionType) => {  
  const { detail } = props
  const handleClick = () => {
    console.log('Exchange: ', detail)
  }
  return (
    <div onClick={handleClick}>Exchange</div>
  )
}
  • networks

| Type | Default value | | --- | --- | | Array | null |

Example:

Authors

License

MIT License © Rome Blockchain Labs