Skip to content

Commit

Permalink
Darwinia USDT cross-chain (#3)
Browse files Browse the repository at this point in the history
* Install prettier

* Prettier code

* Install eslint-config-prettier

* Init husky

* Setup lint-staged

* Tailwind prettier config

* Update tailwind config

* Install @polkadot/api

* Test cross

* Asset type

* Refactor chain config

* Connfigure cross

* Chain utils

* Configure cross wallet

* Configure global styles

* Update root layout

* Add app icon.svg

* PageWrap component

* Create header and footer

* Update root layout

* Update header logo

* Bridge lib

* Create balance utils

* Talisman provider

* Hook useTalisman

* New formatBalance util

* Rename to getNativeBalance

* Update test page

* Configure parachain id

* Improve bridge lib

* Remove getBalance from balance util

* Improve return value of getBalance

* Configure isReserve

* Update Asset type

* Improve bridge lib

* Talisman provider activeAccount

* New Transfer provider

* Hook useTransfer

* New notification ui

* Notify extrinsic and transaction

* Hook useApi

* Hook useBalance

* Support refetch for useBalance

* Fetch source and target balance

* Transfer callback

* Button ui

* Split to sourceChain sourceAsset targetChain and targetAsset

* Fix build failed

* Hook useToggle

* Dropdown ui

* Select ui

* Modal ui

* CopyIcon ui

* Loading ui

* Input ui

* Tooltip ui

* Cross utils

* Configure chain logo and asset icon

* Utils getChainLogoSrc and getAssetIconSrc

* AssetSelect component

* BalanceInput component

* SwitchCross component

* ChainSelect component

* ConnectWallet component

* AddressSelect component

* Label component

* Fix dev console warning

* TransferSection component

* Improve Select with suffix props

* Update Label text color

* Support disconnect talisman wallet

* Support innerSuffix of Select

* AddressInput component

* Talisman provider update activeAccount

* ConnectWallet component

* Update border radius

* Improve transfer provider default value

* Button component kind

* Modal stopPropagation for mask click

* Root layout import talisman and transfer providers

* Fix disconnect for ConnectWallet

* Fix default kind border color of Button

* Fix useBalance

* Tailwind content include utils tsx file

* Fix Tooltip border color

* Fix AddressInput value

* Improve AssetSelect

* Improve AddressSelect

* Improve BalanceInput

* Improve ChainSelect

* Improve ConnectWallet

* Improve SwitchCross

* Update label text color

* Improve TransferSelect

* Fix transfer provider

* Update defaultSourceChainOptions

* Select arrowClassName

* Transfer component

* Page import Transfer

* Improve footer

* Support kind for ConnectWallet

* ConnectWallet use client

* ConnectWallet hover cursor-pointer

* Improve header

* Fix border radius of Modal

* Improve theme rainbowkit provider
  • Loading branch information
JayJay1024 authored Nov 6, 2023
1 parent 3806bc1 commit 0480c9a
Show file tree
Hide file tree
Showing 89 changed files with 13,964 additions and 3,316 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_WALLET_CONNECT_ID=2719448e2ce94fdd269a3c8587123bcc
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
"extends": ["next/core-web-vitals", "prettier"]
}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
9 changes: 9 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const path = require("path");

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames.map((f) => path.relative(process.cwd(), f)).join(" --file ")}`;

module.exports = {
"src/**/*.{js,jsx,ts,tsx}": [buildEslintCommand],
"src/**/*.{js,jsx,ts,tsx,json}": "prettier --write",
};
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"plugins": ["prettier-plugin-tailwindcss"]
}
9 changes: 7 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {
webpack: (config) => {
config.externals.push("lokijs", "encoding", "pino-pretty");
return config;
},
};

module.exports = nextConfig
module.exports = nextConfig;
Loading

0 comments on commit 0480c9a

Please sign in to comment.