10.0.0 • Published 2 years ago

@antiyro/components v10.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

components

Ui Kit for Pangolin

Installation

yarn add @pangolindex/components @gelatonetwork/limit-orders-react@2.4.0

or

npm install @pangolindex/components @gelatonetwork/limit-orders-react@2.4.0

Getting started

Wrap your app with the PangolinProvider and pass the pangolin reducers into your redux store.

In your store pass the gelato reducers:

import { configureStore, getDefaultMiddleware } from "@reduxjs/toolkit";
import { save, load } from "redux-localstorage-simple";
import {
  pangolinReducers,
  PANGOLIN_PERSISTED_KEYS,
} from "@pangolindex/components";

const PERSISTED_KEYS: string[] = ["your_keys", ...PANGOLIN_PERSISTED_KEYS];

const store = configureStore({
  reducer: {
    ...your_reducers,
    ...pangolinReducers,
  },
  middleware: [
    ...getDefaultMiddleware({ thunk: false }),
    save({ states: PERSISTED_KEYS }),
  ],
  preloadedState: load({ states: PERSISTED_KEYS }),
});

export default store;

In your main file wrap your app with PangolinProvider:

import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
import App from "./App";
import store from "./state";
import { useWeb3React, Web3ReactProvider } from "@web3-react/core";
import { Provider } from "react-redux";
import { PangolinProvider } from "@pangolindex/components";
import getLibrary from "./utils/getLibrary";

const AppProvider = () => {
  const { library, account, chainId } = useWeb3React();

  return (
    <PangolinProvider
      library={library}
      chainId={chainId}
      account={account as string}
    >
      <App />
    </PangolinProvider>
  );
};

ReactDOM.render(
  <React.StrictMode>
    <Web3ReactProvider getLibrary={getLibrary}>
      <Provider store={store}>
        <AppProvider />
      </Provider>
    </Web3ReactProvider>
  </React.StrictMode>,
  document.getElementById("root")
);

development flow

  1. do yarn in components
  2. do yarn dev which will watch for any files changes and recompiles files
  3. do yalc link "@pangolindex/components" in the project where you want to use components

Incase react hook violation error comes, in that case follow below steps also.

  1. do yarn link in <project_root>/node_modules/react.
  2. do yarn link react in components which will symlink react which are being used by project.

Publish flow

  • do yarn publish which will build the components and publish to npm.
10.0.13

2 years ago

10.0.0

2 years ago

10.0.19

2 years ago

10.0.18

2 years ago

10.0.17

2 years ago

10.0.16

2 years ago

10.0.15

2 years ago

10.0.14

2 years ago

10.0.12

2 years ago

2.0.0-rc.14

2 years ago

2.0.0-rc.13

2 years ago

2.0.0-rc.12

2 years ago

2.0.0-rc.11

2 years ago

2.0.0-rc.10

2 years ago

2.0.0-rc.9

2 years ago

2.0.0-rc.8

2 years ago

2.0.0-rc.7

2 years ago

2.0.0-rc.6

2 years ago