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

feat: Some ui updates & Header chain switch update #38

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
101199d
feat: Some ui updates & Header chain switch update
aiden-cao Oct 23, 2024
36beeb4
feat: Release new alpha version
wenty22 Oct 23, 2024
7271850
chore: Add change log
wenty22 Oct 23, 2024
04a95fa
Merge branch 'main' into feat/update-switch-network
wenty22 Oct 23, 2024
99e6e07
chore: Test release
wenty22 Oct 23, 2024
9a52a22
Merge branch 'main' into feat/update-switch-network
wenty22 Oct 23, 2024
c090bb9
chore: Test release
wenty22 Oct 23, 2024
5946352
chore: Update versions (alpha)
github-actions[bot] Oct 23, 2024
8d16a93
Merge pull request #44 from bnb-chain/changeset-release/feat/update-s…
wenty22 Oct 23, 2024
d2c4330
chore: Add change log
wenty22 Oct 23, 2024
da29147
chore: Add command to publish alpha packages
wenty22 Oct 23, 2024
66ec1c0
feat: Update switch network copy
aiden-cao Oct 23, 2024
d8b47c6
Merge branch 'main' into feat/update-switch-network
aiden-cao Oct 24, 2024
50c8a09
fix: Fix input focus issue
Halibao-Lala Oct 25, 2024
784dafd
Merge pull request #67 from bnb-chain/fix/meson
Halibao-Lala Oct 25, 2024
04279ef
fix: Fix checkbox styling
Halibao-Lala Oct 25, 2024
f68313e
Merge pull request #68 from bnb-chain/fix/meson
Halibao-Lala Oct 25, 2024
8dc4f60
chore: Update version
Halibao-Lala Oct 25, 2024
a6f15d4
chore: Remove input icon
Halibao-Lala Oct 29, 2024
718feb6
Merge pull request #70 from bnb-chain/fix/meson
Halibao-Lala Oct 29, 2024
b53c9e6
chore: Test server cicd
wenty22 Oct 24, 2024
7df2257
chore: Update timeout to 30m
wenty22 Oct 24, 2024
b890d32
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
810033b
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
c3618e5
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
b7413e0
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
fc05f06
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
a3ff27b
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 29, 2024
2b8c3ef
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 30, 2024
ed223b4
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 30, 2024
a490351
feat(canonical-bridge-widget): Update widget ui
aiden-cao Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/qa-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cicd:
needs: [pre-check]
if: contains(needs.pre-check.outputs.codeowners, github.event.comment.user.login)
timeout-minutes: 10
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
cicd:
needs: [pre-check]
if: contains(needs.pre-check.outputs.codeowners, github.event.pull_request.merged_by.login)
timeout-minutes: 10
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cicd:
needs: [pre-check]
if: contains(needs.pre-check.outputs.codeowners, github.event.pull_request.merged_by.login)
timeout-minutes: 10
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
Expand Down
5 changes: 5 additions & 0 deletions .release/.changeset/chilled-lizards-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/cyan-boxes-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/early-drinks-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/fuzzy-houses-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/metal-steaks-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Fix input and checkbox style
5 changes: 5 additions & 0 deletions .release/.changeset/nice-boxes-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/polite-monkeys-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update unknown network title
25 changes: 25 additions & 0 deletions .release/.changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"mode": "pre",
"tag": "alpha",
"initialVersions": {
"@bnb-chain/canonical-bridge-sdk": "0.1.2",
"@bnb-chain/canonical-bridge-widget": "0.1.4"
},
"changesets": [
"chilled-lizards-compare",
"cyan-boxes-judge",
"early-drinks-bathe",
"fuzzy-houses-complain",
"metal-steaks-drive",
"nice-boxes-taste",
"polite-monkeys-share",
"rare-grapes-act",
"rotten-nails-drop",
"sixty-scissors-protect",
"slimy-clocks-rule",
"swift-rivers-accept",
"swift-suits-worry",
"tasty-pianos-raise",
"tough-colts-compare"
]
}
5 changes: 5 additions & 0 deletions .release/.changeset/rare-grapes-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Some ui updates & Header chain switch update
5 changes: 5 additions & 0 deletions .release/.changeset/rotten-nails-drop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/sixty-scissors-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update ui
5 changes: 5 additions & 0 deletions .release/.changeset/slimy-clocks-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/swift-rivers-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/swift-suits-worry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/tasty-pianos-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
5 changes: 5 additions & 0 deletions .release/.changeset/tough-colts-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bnb-chain/canonical-bridge-widget": patch
---

Update widget ui
2 changes: 1 addition & 1 deletion apps/canonical-bridge-server/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = {
},
ignorePatterns: ['.eslintrc.js'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
78 changes: 78 additions & 0 deletions packages/canonical-bridge-widget/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,83 @@
# @bnb-chain/canonical-bridge-widget

## 0.3.2-alpha.12

### Patch Changes

- Update widget ui

## 0.3.2-alpha.11

### Patch Changes

- Update widget ui

## 0.3.2-alpha.10

### Patch Changes

- Update widget ui

## 0.3.2-alpha.9

### Patch Changes

- Update widget ui

## 0.3.2-alpha.8

### Patch Changes

- Update widget ui

## 0.3.2-alpha.7

### Patch Changes

- Update widget ui

## 0.3.2-alpha.6

### Patch Changes

- Update widget ui

## 0.3.2-alpha.5

### Patch Changes

- Update widget ui

## 0.3.2-alpha.4

### Patch Changes

- Update widget ui

## 0.3.2-alpha.3

### Patch Changes

- Update widget ui

## 0.3.2-alpha.2

### Patch Changes

- Update widget ui

## 0.3.2-alpha.1

### Patch Changes

- Fix input and checkbox style

## 0.3.2-alpha.0

### Patch Changes

- Update ui

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/canonical-bridge-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bnb-chain/canonical-bridge-widget",
"version": "0.3.1",
"version": "0.3.2-alpha.12",
"description": "canonical bridge widget",
"author": "bnb-chain",
"private": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { Box, Icon, IconProps, useColorMode, useTheme } from '@bnb-chain/space';

export const UncheckedIcon = (props: IconProps) => {
return (
<Icon viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M9.30773 24.5C8.8026 24.5 8.37503 24.325 8.02503 23.975C7.67503 23.625 7.50003 23.1974 7.50003 22.6923V9.30772C7.50003 8.80259 7.67503 8.37502 8.02503 8.02502C8.37503 7.67502 8.8026 7.50002 9.30773 7.50002H22.6923C23.1974 7.50002 23.625 7.67502 23.975 8.02502C24.325 8.37502 24.5 8.80259 24.5 9.30772V22.6923C24.5 23.1974 24.325 23.625 23.975 23.975C23.625 24.325 23.1974 24.5 22.6923 24.5H9.30773ZM9.30773 23H22.6923C22.7692 23 22.8397 22.9679 22.9039 22.9038C22.968 22.8397 23 22.7692 23 22.6923V9.30772C23 9.23079 22.968 9.16027 22.9039 9.09615C22.8397 9.03205 22.7692 9 22.6923 9H9.30773C9.2308 9 9.16027 9.03205 9.09616 9.09615C9.03206 9.16027 9.00001 9.23079 9.00001 9.30772V22.6923C9.00001 22.7692 9.03206 22.8397 9.09616 22.9038C9.16027 22.9679 9.2308 23 9.30773 23Z"
fill="currentColor"
/>
</Icon>
);
};

export const CheckedIcon = (props: IconProps) => {
return (
<Icon viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
<path
d="M14.6 17.7462L12.2769 15.4231C12.1385 15.2846 11.9644 15.2138 11.7548 15.2106C11.5452 15.2074 11.368 15.2782 11.2231 15.4231C11.0782 15.568 11.0058 15.7436 11.0058 15.95C11.0058 16.1564 11.0782 16.332 11.2231 16.4769L13.9673 19.2211C14.1481 19.4019 14.359 19.4923 14.6 19.4923C14.841 19.4923 15.0519 19.4019 15.2327 19.2211L20.7962 13.6577C20.9346 13.5192 21.0054 13.3452 21.0087 13.1356C21.0119 12.926 20.941 12.7487 20.7962 12.6038C20.6513 12.459 20.4756 12.3865 20.2692 12.3865C20.0628 12.3865 19.8872 12.459 19.7423 12.6038L14.6 17.7462ZM9.30773 24.5C8.8026 24.5 8.37503 24.325 8.02503 23.975C7.67503 23.625 7.50003 23.1974 7.50003 22.6923V9.30772C7.50003 8.80259 7.67503 8.37502 8.02503 8.02502C8.37503 7.67502 8.8026 7.50002 9.30773 7.50002H22.6923C23.1974 7.50002 23.625 7.67502 23.975 8.02502C24.325 8.37502 24.5 8.80259 24.5 9.30772V22.6923C24.5 23.1974 24.325 23.625 23.975 23.975C23.625 24.325 23.1974 24.5 22.6923 24.5H9.30773ZM9.30773 23H22.6923C22.7692 23 22.8397 22.9679 22.9039 22.9038C22.968 22.8397 23 22.7692 23 22.6923V9.30772C23 9.23079 22.968 9.16027 22.9039 9.09615C22.8397 9.03205 22.7692 9 22.6923 9H9.30773C9.2308 9 9.16027 9.03205 9.09616 9.09615C9.03206 9.16027 9.00001 9.23079 9.00001 9.30772V22.6923C9.00001 22.7692 9.03206 22.8397 9.09616 22.9038C9.16027 22.9679 9.2308 23 9.30773 23Z"
fill="currentColor"
/>
</Icon>
);
};

export const ToAccountCheckBox = (props: { onClick: () => void; isChecked: boolean }) => {
const { onClick, isChecked } = props;
const theme = useTheme();
const { colorMode } = useColorMode();

return (
<Box onClick={onClick} cursor={'pointer'} mt={'-6px'}>
{isChecked ? (
<CheckedIcon height={'32px'} width={'32px'} color={theme.colors[colorMode].text.brand} />
) : (
<UncheckedIcon
height={'32px'}
width={'32px'}
_hover={{
color: theme.colors[colorMode].text.brand,
}}
/>
)}
</Box>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,10 @@ export function ExLinkIcon(props: IconProps) {
fill="none"
{...props}
>
<mask
id="mask0_26135_32330_ex_link"
style={{ maskType: 'alpha' }}
maskUnits="userSpaceOnUse"
x="0"
y="0"
width="16"
height="16"
>
<rect width="16" height="16" fill="#D9D9D9" />
</mask>
<g mask="url(#mask0_26135_32330_ex_link)">
<path
d="M3.33333 14C2.96667 14 2.65278 13.8694 2.39167 13.6083C2.13056 13.3472 2 13.0333 2 12.6667V3.33333C2 2.96667 2.13056 2.65278 2.39167 2.39167C2.65278 2.13056 2.96667 2 3.33333 2H7.33333C7.52222 2 7.68056 2.06389 7.80833 2.19167C7.93611 2.31944 8 2.47778 8 2.66667C8 2.85556 7.93611 3.01389 7.80833 3.14167C7.68056 3.26944 7.52222 3.33333 7.33333 3.33333H3.33333V12.6667H12.6667V8.66667C12.6667 8.47778 12.7306 8.31944 12.8583 8.19167C12.9861 8.06389 13.1444 8 13.3333 8C13.5222 8 13.6806 8.06389 13.8083 8.19167C13.9361 8.31944 14 8.47778 14 8.66667V12.6667C14 13.0333 13.8694 13.3472 13.6083 13.6083C13.3472 13.8694 13.0333 14 12.6667 14H3.33333ZM12.6667 4.26667L6.93333 10C6.81111 10.1222 6.65556 10.1833 6.46667 10.1833C6.27778 10.1833 6.12222 10.1222 6 10C5.87778 9.87778 5.81667 9.72222 5.81667 9.53333C5.81667 9.34444 5.87778 9.18889 6 9.06667L11.7333 3.33333H10C9.81111 3.33333 9.65278 3.26944 9.525 3.14167C9.39722 3.01389 9.33333 2.85556 9.33333 2.66667C9.33333 2.47778 9.39722 2.31944 9.525 2.19167C9.65278 2.06389 9.81111 2 10 2H13.3333C13.5222 2 13.6806 2.06389 13.8083 2.19167C13.9361 2.31944 14 2.47778 14 2.66667V6C14 6.18889 13.9361 6.34722 13.8083 6.475C13.6806 6.60278 13.5222 6.66667 13.3333 6.66667C13.1444 6.66667 12.9861 6.60278 12.8583 6.475C12.7306 6.34722 12.6667 6.18889 12.6667 6V4.26667Z"
fill="currentColor"
/>
</g>
<path
d="M3.33333 14C2.96667 14 2.65278 13.8694 2.39167 13.6083C2.13056 13.3472 2 13.0333 2 12.6667V3.33333C2 2.96667 2.13056 2.65278 2.39167 2.39167C2.65278 2.13056 2.96667 2 3.33333 2H7.33333C7.52222 2 7.68056 2.06389 7.80833 2.19167C7.93611 2.31944 8 2.47778 8 2.66667C8 2.85556 7.93611 3.01389 7.80833 3.14167C7.68056 3.26944 7.52222 3.33333 7.33333 3.33333H3.33333V12.6667H12.6667V8.66667C12.6667 8.47778 12.7306 8.31944 12.8583 8.19167C12.9861 8.06389 13.1444 8 13.3333 8C13.5222 8 13.6806 8.06389 13.8083 8.19167C13.9361 8.31944 14 8.47778 14 8.66667V12.6667C14 13.0333 13.8694 13.3472 13.6083 13.6083C13.3472 13.8694 13.0333 14 12.6667 14H3.33333ZM12.6667 4.26667L6.93333 10C6.81111 10.1222 6.65556 10.1833 6.46667 10.1833C6.27778 10.1833 6.12222 10.1222 6 10C5.87778 9.87778 5.81667 9.72222 5.81667 9.53333C5.81667 9.34444 5.87778 9.18889 6 9.06667L11.7333 3.33333H10C9.81111 3.33333 9.65278 3.26944 9.525 3.14167C9.39722 3.01389 9.33333 2.85556 9.33333 2.66667C9.33333 2.47778 9.39722 2.31944 9.525 2.19167C9.65278 2.06389 9.81111 2 10 2H13.3333C13.5222 2 13.6806 2.06389 13.8083 2.19167C13.9361 2.31944 14 2.47778 14 2.66667V6C14 6.18889 13.9361 6.34722 13.8083 6.475C13.6806 6.60278 13.5222 6.66667 13.3333 6.66667C13.1444 6.66667 12.9861 6.60278 12.8583 6.475C12.7306 6.34722 12.6667 6.18889 12.6667 6V4.26667Z"
fill="currentColor"
/>
</Icon>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Icon, IconProps } from '@bnb-chain/space';

export function WarningIcon(props: IconProps) {
return (
<Icon width="24px" height="24px" viewBox="0 0 24 24" fill="none" {...props}>
<g id="warning-fill">
<path
id="warning"
d="M2.72674 21C2.54341 21 2.37674 20.9542 2.22674 20.8625C2.07674 20.7708 1.96008 20.65 1.87674 20.5C1.79341 20.35 1.74758 20.1875 1.73924 20.0125C1.73091 19.8375 1.77674 19.6667 1.87674 19.5L11.1267 3.5C11.2267 3.33333 11.3559 3.20833 11.5142 3.125C11.6726 3.04167 11.8351 3 12.0017 3C12.1684 3 12.3309 3.04167 12.4892 3.125C12.6476 3.20833 12.7767 3.33333 12.8767 3.5L22.1267 19.5C22.2267 19.6667 22.2726 19.8375 22.2642 20.0125C22.2559 20.1875 22.2101 20.35 22.1267 20.5C22.0434 20.65 21.9267 20.7708 21.7767 20.8625C21.6267 20.9542 21.4601 21 21.2767 21H2.72674ZM12.0017 18C12.2851 18 12.5226 17.9042 12.7142 17.7125C12.9059 17.5208 13.0017 17.2833 13.0017 17C13.0017 16.7167 12.9059 16.4792 12.7142 16.2875C12.5226 16.0958 12.2851 16 12.0017 16C11.7184 16 11.4809 16.0958 11.2892 16.2875C11.0976 16.4792 11.0017 16.7167 11.0017 17C11.0017 17.2833 11.0976 17.5208 11.2892 17.7125C11.4809 17.9042 11.7184 18 12.0017 18ZM12.0017 15C12.2851 15 12.5226 14.9042 12.7142 14.7125C12.9059 14.5208 13.0017 14.2833 13.0017 14V11C13.0017 10.7167 12.9059 10.4792 12.7142 10.2875C12.5226 10.0958 12.2851 10 12.0017 10C11.7184 10 11.4809 10.0958 11.2892 10.2875C11.0976 10.4792 11.0017 10.7167 11.0017 11V14C11.0017 14.2833 11.0976 14.5208 11.2892 14.7125C11.4809 14.9042 11.7184 15 12.0017 15Z"
fill="#FF8A38"
/>
</g>
</Icon>
);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useEffect, useRef, useState } from 'react';

export const useDebounce = (value: any, delay = 500) => {
const [debouncedValue, setDebouncedValue] = useState('');
const [debouncedValue, setDebouncedValue] = useState(value);
const timerRef = useRef<any>();

useEffect(() => {
Expand Down
5 changes: 4 additions & 1 deletion packages/canonical-bridge-widget/src/core/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const en = {

'transfer.button.confirm': 'Send',
'transfer.button.approve': 'Approve',
'transfer.button.switch-network': 'Switch Network',
'transfer.button.switch-network': 'Switch Network in Wallet',
'transfer.button.wallet-connect': 'Connect Wallet',
'transfer.button.switch-wallet': 'Switch Wallet',

Expand Down Expand Up @@ -96,6 +96,9 @@ export const en = {
'select-modal.destination.incompatible.tooltip':
'The token you’ve selected is incompatible with this network. Please select another token.',

'wallet.network.switch-network': 'Please switch the network',
'wallet.network.unknown-network': 'Unsupported Network',
'wallet.network.unknown-network-mobile': 'Network',
'wallet.button.connect-wallet': 'Connect Wallet',
'wallet.network.wrong-network': 'Wrong network',
'wallet.error.switch-network':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect } from 'react';
import { useAccount } from 'wagmi';

import { useAppDispatch } from '@/modules/store/StoreProvider';
import { useAppDispatch, useAppSelector } from '@/modules/store/StoreProvider';
import { setSendValue } from '@/modules/transfer/action';
import { useSelection } from '@/modules/aggregator/hooks/useSelection';
import { useAggregator } from '@/modules/aggregator/components/AggregatorProvider';
Expand All @@ -9,12 +10,14 @@ export function useDefaultSelectedInfo() {
const { isReady, defaultSelectedInfo } = useAggregator();
const { selectDefault } = useSelection();
const dispatch = useAppDispatch();
const { chainId } = useAccount();
const sendValue = useAppSelector((state) => state.transfer.sendValue);

useEffect(() => {
if (isReady) {
selectDefault(defaultSelectedInfo);
dispatch(setSendValue(defaultSelectedInfo.amount));
dispatch(setSendValue(sendValue || defaultSelectedInfo.amount));
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [isReady]);
}, [isReady, chainId]);
}
Loading