From 1b33d4f350eb8cf1b7d4698e660715e6412f91b7 Mon Sep 17 00:00:00 2001 From: wenty22 Date: Fri, 6 Dec 2024 21:04:48 +0800 Subject: [PATCH] fix: Fix searching issue --- .release/.changeset/nice-worms-turn.md | 5 +++++ .release/.changeset/pre.json | 11 +++++++++++ packages/canonical-bridge-widget/CHANGELOG.md | 6 ++++++ packages/canonical-bridge-widget/package.json | 2 +- .../modules/aggregator/adapters/meson/MesonAdapter.ts | 2 +- .../SelectModal/DestinationNetworkModal.tsx | 2 +- .../components/SelectModal/SourceNetworkModal.tsx | 2 +- 7 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 .release/.changeset/nice-worms-turn.md create mode 100644 .release/.changeset/pre.json diff --git a/.release/.changeset/nice-worms-turn.md b/.release/.changeset/nice-worms-turn.md new file mode 100644 index 00000000..0fcb293a --- /dev/null +++ b/.release/.changeset/nice-worms-turn.md @@ -0,0 +1,5 @@ +--- +"@bnb-chain/canonical-bridge-widget": patch +--- + +Fix from & to chain search diff --git a/.release/.changeset/pre.json b/.release/.changeset/pre.json new file mode 100644 index 00000000..313f62f5 --- /dev/null +++ b/.release/.changeset/pre.json @@ -0,0 +1,11 @@ +{ + "mode": "pre", + "tag": "alpha", + "initialVersions": { + "@bnb-chain/canonical-bridge-sdk": "0.4.2", + "@bnb-chain/canonical-bridge-widget": "0.5.8" + }, + "changesets": [ + "nice-worms-turn" + ] +} diff --git a/packages/canonical-bridge-widget/CHANGELOG.md b/packages/canonical-bridge-widget/CHANGELOG.md index abb9c35b..b688a18e 100644 --- a/packages/canonical-bridge-widget/CHANGELOG.md +++ b/packages/canonical-bridge-widget/CHANGELOG.md @@ -1,5 +1,11 @@ # @bnb-chain/canonical-bridge-widget +## 0.5.9-alpha.0 + +### Patch Changes + +- Fix from & to chain search + ## 0.5.8 ### Patch Changes diff --git a/packages/canonical-bridge-widget/package.json b/packages/canonical-bridge-widget/package.json index bc4e6ce7..b19a16d1 100644 --- a/packages/canonical-bridge-widget/package.json +++ b/packages/canonical-bridge-widget/package.json @@ -1,6 +1,6 @@ { "name": "@bnb-chain/canonical-bridge-widget", - "version": "0.5.8", + "version": "0.5.9-alpha.0", "description": "canonical bridge widget", "author": "bnb-chain", "private": false, diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts index 7d710baa..8fdd43ae 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts +++ b/packages/canonical-bridge-widget/src/modules/aggregator/adapters/meson/MesonAdapter.ts @@ -126,7 +126,7 @@ export class MesonAdapter extends BaseAdapter item.name.toLowerCase().includes(keyword), + filter: (item, keyword) => item.name.toLowerCase().includes(keyword?.toLowerCase()), sorter: (a) => (toChain?.id === a.id ? -1 : 0), data: toChains, }); diff --git a/packages/canonical-bridge-widget/src/modules/aggregator/components/SelectModal/SourceNetworkModal.tsx b/packages/canonical-bridge-widget/src/modules/aggregator/components/SelectModal/SourceNetworkModal.tsx index 8d30aac6..8a4ec940 100644 --- a/packages/canonical-bridge-widget/src/modules/aggregator/components/SelectModal/SourceNetworkModal.tsx +++ b/packages/canonical-bridge-widget/src/modules/aggregator/components/SelectModal/SourceNetworkModal.tsx @@ -36,7 +36,7 @@ export function SourceNetworkModal(props: SourceNetworkModalProps) { }); const { isNoResult, result, onSearch } = useSearch({ - filter: (item, keyword) => item.name.toLowerCase().includes(keyword), + filter: (item, keyword) => item.name.toLowerCase().includes(keyword?.toLowerCase()), sorter: (a) => (fromChain?.id === a.id ? -1 : 0), data: fromChains, });