Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hubble Bridge V2 UI #1578

Merged
merged 139 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
c1dae86
Add Adjust Amount component & Fixed Tailwind Dark Mode on Storybook (…
AtelyPham Jul 26, 2023
ddeb0f8
Merge remote-tracking branch 'origin/develop' into hubble-bridge-v2
AtelyPham Jul 26, 2023
a79cea9
Merge remote-tracking branch 'origin/develop' into hubble-bridge-v2
AtelyPham Jul 27, 2023
be9cb70
V2 ToggleCard component (#1468)
AtelyPham Jul 27, 2023
fa2a9d7
Merge remote-tracking branch 'origin/develop' into hubble-bridge-v2
AtelyPham Jul 29, 2023
e3ceeac
Adding StatusIndicator Component to `webb-ui-kit` (#1469)
AtelyPham Jul 31, 2023
0234fdd
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Jul 31, 2023
c9fa721
Merge remote-tracking branch 'origin/develop' into hubble-bridge-v2
AtelyPham Jul 31, 2023
328bb03
V2 ChainButton, WalletButton and LoadingPill (#1489)
AtelyPham Aug 1, 2023
f39791c
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 2, 2023
32e14d6
Fee Detail component (#1494)
AtelyPham Aug 2, 2023
fbea58e
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 3, 2023
c2ccc04
Update TokenSelector component (#1497)
AtelyPham Aug 4, 2023
0593bd8
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 4, 2023
fc7e0cd
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 4, 2023
70b291a
Merge remote-tracking branch 'origin/develop' into hubble-bridge-v2
AtelyPham Aug 11, 2023
4e97408
Update New V2 List Card Items (Token, Shielded Pool, Chain & Relayer)…
AtelyPham Aug 11, 2023
7246591
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 12, 2023
a5840ca
Add New Stepped Progressor, Text Field Input, and Improve the Switch …
AtelyPham Aug 13, 2023
8c1569e
Fix Netlify Build (#1542)
AtelyPham Aug 14, 2023
ca3fd00
Orbit Deployment 20230814 01 (#1538)
shekohex Aug 14, 2023
6faa22c
fix: update remaining workflows
AtelyPham Aug 14, 2023
01caaa4
chore: bump @octokit/request from 6.2.8 to 8.1.1 (#1543)
dependabot[bot] Aug 14, 2023
2381cdd
chore: bump tailwind-scrollbar from 3.0.4 to 3.0.5 (#1544)
dependabot[bot] Aug 14, 2023
3a9bcff
Connect back-end with Overview Chips Component (#1521)
vutuanlinh2k2 Aug 15, 2023
1f0344d
chore: run yarn install
AtelyPham Aug 15, 2023
d2e14b0
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 15, 2023
0cbce02
V2 Tx Progressor Component (#1547)
AtelyPham Aug 16, 2023
7b0f555
V2 Transaction Input Card (#1548)
AtelyPham Aug 21, 2023
bb561ab
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 21, 2023
5e12da0
fix: not found components
AtelyPham Aug 21, 2023
57edff8
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 22, 2023
086a413
feat: convert from tabs to pages for deposit, withdraw and transfer
AtelyPham Aug 24, 2023
8edb639
Revert "feat: convert from tabs to pages for deposit, withdraw and tr…
AtelyPham Aug 24, 2023
52736a7
chore: extract BridgeTabsContainer from BridgeTabs
AtelyPham Aug 24, 2023
93c8341
feat: add settings icon
AtelyPham Aug 24, 2023
771c5c7
feat: add UI for deposit page
AtelyPham Aug 24, 2023
e7ddc4d
fix: styling issues
AtelyPham Aug 24, 2023
5458eeb
feat: add UI for transfer page
AtelyPham Aug 24, 2023
1a65abf
feat: add UI for withdraw page
AtelyPham Aug 24, 2023
6441d00
feat: add IconButton and IconWithTooltip
AtelyPham Aug 24, 2023
571b1e3
chore: update orbit chain names
AtelyPham Aug 24, 2023
abe013b
feat: handle input states with routing
AtelyPham Aug 25, 2023
b2c57cd
fix: correct the amount input
AtelyPham Aug 25, 2023
0ca1d86
feat: allow fetching balances with custom typed chain id
AtelyPham Aug 25, 2023
be79ac0
fix: chain or account persistence in localstorage
AtelyPham Aug 26, 2023
2dc9450
fix: add toFixed function and format number to 2 decimal places for m…
AtelyPham Aug 26, 2023
d53a11c
chore: define button props based on states
AtelyPham Aug 26, 2023
6ed3557
feat: handle api connection on deposit
AtelyPham Aug 26, 2023
8221a33
chore: remove unused code add eslint rules for unused vars and imports
AtelyPham Aug 26, 2023
40de704
chore: handle deposit confirm card
AtelyPham Aug 26, 2023
88a5ef9
refactor: deposit files
AtelyPham Aug 26, 2023
aec3000
chore: fix lint
AtelyPham Aug 26, 2023
2451c64
chore: handle select source chain button on header
AtelyPham Aug 26, 2023
5168dd4
fix: overflow issue
AtelyPham Aug 26, 2023
edb9273
feat: add LoadingPill for transaction processing
AtelyPham Aug 26, 2023
617dd91
chore: add gas item for fee info
AtelyPham Aug 26, 2023
8e352a1
fix: correct main tx id state
AtelyPham Aug 26, 2023
b77d073
fix: connect wallet first then create account
AtelyPham Aug 26, 2023
450147b
feat: animate cards
AtelyPham Aug 26, 2023
583b86f
fix: add the typed chain id in select token card to render the correc…
AtelyPham Aug 27, 2023
f163f6c
chore: iterative improvement the deposit flow
AtelyPham Aug 27, 2023
b1e7183
feat: add hooks for withdraw flow
AtelyPham Aug 27, 2023
d9853d5
feat: handle state on withdraw flow
AtelyPham Aug 27, 2023
3b51441
feat: handle select chain on withdraw flow
AtelyPham Aug 27, 2023
c4bafe9
feat: handle select token on withdraw flow
AtelyPham Aug 27, 2023
5c8976c
feat: handle inputs
AtelyPham Aug 27, 2023
df6fb7d
feat: add toggle for fixed and custom amount
AtelyPham Aug 27, 2023
238bc78
chore: add relayer button and fix balances issue on unwrap token
AtelyPham Aug 27, 2023
505b05b
fix: adjust amount max width
AtelyPham Aug 27, 2023
10c3e49
chore: add refund token info to refund amount input
AtelyPham Aug 27, 2023
6ebd30a
feat: add select relayer page with relayer list card
AtelyPham Aug 28, 2023
eb53114
refactor: relayer classes and hooks
AtelyPham Aug 28, 2023
0a120bc
fix: set default state when no connection
AtelyPham Aug 28, 2023
1d7c01b
feat: add toggle card, default select a relayer and a button to confi…
AtelyPham Aug 28, 2023
f4bd446
feat: handle relayer selection with custom relayer endpoint
AtelyPham Aug 28, 2023
677e84a
chore: test and finalized the relayer selection
AtelyPham Aug 29, 2023
406f2cb
refactor: separate logic hooks
AtelyPham Aug 29, 2023
02b275a
feat: handle fee calculation for withdraw
AtelyPham Aug 29, 2023
b26736f
refactor: extract fee calculation to a hook
AtelyPham Aug 29, 2023
9de4a1e
feat: add remaining tx info items
AtelyPham Aug 29, 2023
dd58240
chore: improve UI
AtelyPham Aug 29, 2023
edc7da9
feat: add tx info items for the withdraw flow
AtelyPham Aug 30, 2023
267d36d
feat: handle rendering confirm card and wtihdraw action
AtelyPham Aug 30, 2023
9e6040c
chore: extract useWithdrawButtonProps hook and fix bugs
AtelyPham Aug 30, 2023
70f79b0
fix: condition for state issue
AtelyPham Aug 31, 2023
f07851f
feat: separate select token and pool
AtelyPham Aug 31, 2023
aad6ef3
fix: UI issues
AtelyPham Aug 31, 2023
06831e5
feat: add transfer page
AtelyPham Aug 31, 2023
831b883
feat: add transfer flow
AtelyPham Aug 31, 2023
cd92eac
ci: continue to iterate on hubble bridge v2
AtelyPham Aug 31, 2023
12d0e0d
chore: remove unused components
AtelyPham Aug 31, 2023
ceecf48
fix: build issue
AtelyPham Aug 31, 2023
a082076
Merge branch 'develop' into hubble-bridge-v2
AtelyPham Aug 31, 2023
2d57041
fix: lint and CodeQL issues
AtelyPham Sep 1, 2023
84e72ce
Merge branch 'hubble-bridge-v2' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 1, 2023
2314370
feat: identify and add stepped component to confirm and tx progressor…
AtelyPham Sep 1, 2023
8b6c2cb
chore: identify transaction steps
AtelyPham Sep 1, 2023
8e9361e
fix: pool and token render
AtelyPham Sep 1, 2023
29b1365
chore: manually config the transaction step
AtelyPham Sep 1, 2023
8b66293
refactor: TxProgressDropdown component
AtelyPham Sep 1, 2023
3434382
feat: only download note after user approve & correct the change note…
AtelyPham Sep 1, 2023
978526f
fix: display no balance for tokens on deposit flow
AtelyPham Sep 1, 2023
1ae524a
chore: add hubble-bridge-v2 to trigger deploy preview for new Hubble …
AtelyPham Sep 1, 2023
f4c2f37
fix: circular dependency when building the bridge dapp
AtelyPham Sep 1, 2023
c943de5
chore: run yarn install
AtelyPham Sep 1, 2023
c5b937c
chore: handle when on wallet connection
AtelyPham Sep 1, 2023
1f27c67
feat: add modal queue manager
AtelyPham Sep 2, 2023
f3e5ceb
feat: add SubmittedTxModal component
AtelyPham Sep 5, 2023
43e2d34
Merge branch 'develop' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 5, 2023
591edb1
Merge branch 'develop' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 5, 2023
0b367d9
fix: build errors and warnings after merge
AtelyPham Sep 5, 2023
c41d0c8
feat: add SubmittedTxModal to deposit flow
AtelyPham Sep 5, 2023
2aa19b3
feat: add submitted tx modal to transfer & withdraw
AtelyPham Sep 5, 2023
79f0f66
Merge branch 'develop' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 5, 2023
33ab592
fix: store and remove note
AtelyPham Sep 5, 2023
bd7fab1
chore: remove unused imports
AtelyPham Sep 6, 2023
a02e000
chore: remove the refund amount and default to max refund on withdraw…
AtelyPham Sep 6, 2023
deefaa8
feat: add refund input to transfer flow
AtelyPham Sep 6, 2023
765cbd3
feat: handle refund on transfer flow
AtelyPham Sep 6, 2023
1385bda
fix: refund amount when unselect the refund switch
AtelyPham Sep 6, 2023
732a9ca
Merge branch 'develop' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 6, 2023
a4d0f73
fix: storybook build
AtelyPham Sep 7, 2023
f2bdd3f
chore: remove hubble-bridge-v2 branch on the workflow files
AtelyPham Sep 7, 2023
ee765d0
chore: make archive node as default rpc on Tangle
AtelyPham Sep 7, 2023
c13f9c6
fix: make the theme switcher clickable
AtelyPham Sep 7, 2023
c9f46bc
feat: sidebar menu on small screen
AtelyPham Sep 7, 2023
dcdc7ec
feat: adding mobile detect and display bottom dialog
AtelyPham Sep 7, 2023
744c12e
fix: UI and commitment checking
AtelyPham Sep 8, 2023
9f794b4
fix: errors
AtelyPham Sep 8, 2023
fd4c5de
chore: handle errors on deposit, transfer, withdraw
AtelyPham Sep 8, 2023
65b28a3
feat: validate input notes leaf index before transacting
AtelyPham Sep 8, 2023
6308de0
chore: incoporate UI feedbacks
AtelyPham Sep 8, 2023
b0ef7d2
chore: remove fixed amount on transfer, add box shadow for bridge tab…
AtelyPham Sep 8, 2023
c822cc1
chore: anchor footer to bottom
AtelyPham Sep 8, 2023
27dcf29
chore: improve bread crumbs
AtelyPham Sep 8, 2023
fb7db1c
chore: display full chain name
AtelyPham Sep 8, 2023
6f542a8
chore: no capitalize token symbol & name
AtelyPham Sep 8, 2023
e2ffe21
Merge branch 'develop' into trung-tin/new-hubble-bridge-v2-ui
AtelyPham Sep 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
74 changes: 37 additions & 37 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "scan 🔎"
name: 'scan 🔎'

on:
pull_request:
branches: [ develop, staging, master ]
branches: [develop, staging, master]

schedule:
# ┌───────────── minute (0 - 59)
Expand All @@ -28,44 +28,44 @@ jobs:
security-events: write

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/[email protected]
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/[email protected]
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

#- run: |
# make bootstrap
# make release
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
10 changes: 7 additions & 3 deletions .github/workflows/deploy-storybook-docs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: publish
on:
on:
push:
branches:
- develop
paths: ["libs/webb-ui-components/src/stories/**", "libs/webb-ui-components/.storybook/**", ".storybook" ] # Trigger the action only when files change in the folders defined here
paths: [
'libs/webb-ui-components/src/stories/**',
'libs/webb-ui-components/.storybook/**',
'.storybook',
] # Trigger the action only when files change in the folders defined here
jobs:
component-docs:
runs-on: ubuntu-latest
Expand All @@ -22,4 +26,4 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: ~/work/webb-dapp/webb-dapp/dist/storybook/webb-ui-components/ # The folder that the build-storybook script generates files.
CLEAN: true # Automatically remove deleted files from the deploy branch
CLEAN: true # Automatically remove deleted files from the deploy branch
4 changes: 2 additions & 2 deletions .github/workflows/ui-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: 'visual ✨'
on:
pull_request:
# types: [opened, synchronize, reopened, ready_for_review]
branches: [ develop ]
branches: [develop]

workflow_dispatch:

Expand All @@ -32,4 +32,4 @@ jobs:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: 'build:storybook'
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
exitZeroOnChanges: true # 👈 Option to prevent the workflow from failing
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module.exports = {
'storybook-addon-react-router-v6',
'@storybook/theming',
'@storybook/addon-a11y',
'storybook-tailwind-dark-mode',
],
features: {
interactionsDebugger: true,
Expand Down
13 changes: 11 additions & 2 deletions apps/bridge-dapp/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"extends": ["plugin:@nx/react", "../../.eslintrc.json"],
"extends": [
"plugin:@nx/react",
"../../.eslintrc.json",
"plugin:react-hooks/recommended"
],
"ignorePatterns": ["!**/*", "node_modules/**", "build/**"],
"plugins": ["unused-imports"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
Expand All @@ -14,5 +19,9 @@
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
}
16 changes: 5 additions & 11 deletions apps/bridge-dapp/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import {
AppEvent,
RouterProvider,
WebbProvider,
} from '@webb-tools/api-provider-environment';
import { FC } from 'react';

import { WebbUIProvider } from '@webb-tools/webb-ui-components';
import { config as routerConfig } from './routes';

import * as Sentry from '@sentry/react';
import { AppEvent, WebbProvider } from '@webb-tools/api-provider-environment';
import { WebbUIProvider } from '@webb-tools/webb-ui-components';
import { FC } from 'react';
import BridgeRoutes from './routes';

// Singleton app event instance
export const appEvent = new AppEvent();
Expand All @@ -17,7 +11,7 @@ const App: FC = () => {
return (
<WebbUIProvider hasErrorBoudary>
<WebbProvider appEvent={appEvent} applicationName={'Webb DApp'}>
<RouterProvider config={routerConfig} />
<BridgeRoutes />
</WebbProvider>
</WebbUIProvider>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { useWebContext } from '@webb-tools/api-provider-environment';
import { calculateTypedChainId } from '@webb-tools/sdk-core';
import { ChainListCard, useWebbUI } from '@webb-tools/webb-ui-components';
import { ChainType } from '@webb-tools/webb-ui-components/components/ListCard/types';
import { FC, useCallback, useMemo } from 'react';
import { useConnectWallet } from '../../hooks';
import { ChainListCardWrapperProps } from './types';
import { getNativeCurrencyFromConfig } from '@webb-tools/dapp-config';
import { getActiveSourceChains } from '../../utils/getActiveSourceChains';
import { Bridge } from '@webb-tools/abstract-api-provider';
import { ChainListCardWrapperProps } from './types';

/**
* The wrapper component for the ChainListCard component
Expand Down Expand Up @@ -53,16 +52,10 @@ export const ChainListCardWrapper: FC<ChainListCardWrapperProps> = ({
if (chainsProps) return chainsProps;

return getActiveSourceChains(apiConfig.chains).map((val) => {
const currency = getNativeCurrencyFromConfig(
apiConfig.currencies,
calculateTypedChainId(val.chainType, val.id)
);

return {
name: val.name,
tag: val.tag,
symbol: currency?.symbol ?? 'Unknown',
};
} satisfies ChainType;
});
}, [apiConfig, chainsProps]);

Expand All @@ -87,13 +80,6 @@ export const ChainListCardWrapper: FC<ChainListCardWrapperProps> = ({
calculateTypedChainId(chain.chainType, chain.id)
);

let bridge: Bridge | undefined;
const bridgeConfig =
fungibleCurrency && apiConfig.bridgeByAsset[fungibleCurrency.id];
if (bridgeConfig) {
bridge = new Bridge(fungibleCurrency, bridgeConfig.anchors);
}

// If the selected chain is supported by the active wallet
if (isSupported) {
await switchChain(chain, activeWallet);
Expand All @@ -105,9 +91,7 @@ export const ChainListCardWrapper: FC<ChainListCardWrapperProps> = ({
},
[
activeWallet,
apiConfig.bridgeByAsset,
chainsConfig,
fungibleCurrency,
onChange,
setMainComponent,
switchChain,
Expand Down
35 changes: 0 additions & 35 deletions apps/bridge-dapp/src/components/Header/ChainSwitcherButton.tsx

This file was deleted.

Loading
Loading