From 98b3c418f99669285b0e02b1de8d78716f3c1faf Mon Sep 17 00:00:00 2001 From: hz002 Date: Thu, 28 Nov 2024 14:50:08 +0800 Subject: [PATCH] style: ui bugs --- .../DappSearchSection/DappSearchCardList.tsx | 3 ++ .../screens/Home/components/HomeTopArea.tsx | 38 +++++++++++-------- apps/mobile/src/screens/Receive/Receive.tsx | 2 +- .../RestoreFromCloud/BackupItem2024.tsx | 4 -- .../src/screens/Send/components/ChainInfo.tsx | 2 +- .../screens/Send/components/ChainInfo2024.tsx | 2 +- apps/mobile/src/screens/Swap/index.tsx | 4 +- 7 files changed, 30 insertions(+), 25 deletions(-) diff --git a/apps/mobile/src/screens/Dapps/components/DappSearchSection/DappSearchCardList.tsx b/apps/mobile/src/screens/Dapps/components/DappSearchSection/DappSearchCardList.tsx index 39f752d99..c22b439d9 100644 --- a/apps/mobile/src/screens/Dapps/components/DappSearchSection/DappSearchCardList.tsx +++ b/apps/mobile/src/screens/Dapps/components/DappSearchSection/DappSearchCardList.tsx @@ -67,6 +67,9 @@ export const DappSearchCardList = ({ onChainChange?.(v); removeGlobalBottomSheetModal2024(id); }, + onClose: () => { + removeGlobalBottomSheetModal2024(id); + }, }); }; diff --git a/apps/mobile/src/screens/Home/components/HomeTopArea.tsx b/apps/mobile/src/screens/Home/components/HomeTopArea.tsx index 0fa59948e..a80c709de 100644 --- a/apps/mobile/src/screens/Home/components/HomeTopArea.tsx +++ b/apps/mobile/src/screens/Home/components/HomeTopArea.tsx @@ -11,11 +11,7 @@ import { import RcInfoCC from '@/assets/icons/home/info-cc.svg'; import { BSheetModal, Tip } from '@/components'; import AutoLockView from '@/components/AutoLockView'; -import { - createGlobalBottomSheetModal, - removeGlobalBottomSheetModal, -} from '@/components/GlobalBottomSheetModal'; -import { MODAL_NAMES } from '@/components/GlobalBottomSheetModal/types'; +import { MODAL_NAMES } from '@/components2024/GlobalBottomSheetModal/types'; import { toast } from '@/components/Toast'; import TouchableView from '@/components/Touchable/TouchableView'; import { CHAINS_ENUM } from '@/constant/chains'; @@ -31,7 +27,11 @@ import { splitNumberByStep } from '@/utils/number'; import { createGetStyles2024 } from '@/utils/styles'; import { BottomSheetModal } from '@gorhom/bottom-sheet'; import { KEYRING_TYPE } from '@rabby-wallet/keyring-utils'; -import { useFocusEffect, useNavigation } from '@react-navigation/native'; +import { + StackActions, + useFocusEffect, + useNavigation, +} from '@react-navigation/native'; import { NativeStackScreenProps } from '@react-navigation/native-stack'; import { Skeleton } from '@rneui/base'; import { useMemoizedFn } from 'ahooks'; @@ -51,6 +51,10 @@ import { useApprovalAlert } from '../hooks/approvals'; import { CurveBottomSheetModal } from './CurveBottomSheet'; import { trigger } from 'react-native-haptic-feedback'; import { useSwitchSceneCurrentAccount } from '@/hooks/accountsSwitcher'; +import { + createGlobalBottomSheetModal2024, + removeGlobalBottomSheetModal2024, +} from '@/components2024/GlobalBottomSheetModal'; type HomeProps = NativeStackScreenProps; @@ -202,20 +206,22 @@ export const HomeTopArea = () => { title: 'Receive', Icon: RcIconReceive, onPress: () => { - const id = createGlobalBottomSheetModal({ + const id = createGlobalBottomSheetModal2024({ name: MODAL_NAMES.SELECT_SORTED_CHAIN, value: CHAINS_ENUM.ETH, onChange: (v: CHAINS_ENUM) => { - navigation.push(RootNames.StackTransaction, { - screen: RootNames.Receive, - params: { - chainEnum: v, - }, - }); - removeGlobalBottomSheetModal(id); + navigation.dispatch( + StackActions.push(RootNames.StackTransaction, { + screen: RootNames.Receive, + params: { + chainEnum: v, + }, + }), + ); + removeGlobalBottomSheetModal2024(id); }, - onCancel: () => { - removeGlobalBottomSheetModal(id); + onClose: () => { + removeGlobalBottomSheetModal2024(id); }, }); }, diff --git a/apps/mobile/src/screens/Receive/Receive.tsx b/apps/mobile/src/screens/Receive/Receive.tsx index 354ae49b8..7e0052661 100644 --- a/apps/mobile/src/screens/Receive/Receive.tsx +++ b/apps/mobile/src/screens/Receive/Receive.tsx @@ -126,7 +126,7 @@ function ReceiveScreen(): JSX.Element { {account?.address} - + diff --git a/apps/mobile/src/screens/RestoreFromCloud/BackupItem2024.tsx b/apps/mobile/src/screens/RestoreFromCloud/BackupItem2024.tsx index 4ed53932a..4fbcae30e 100644 --- a/apps/mobile/src/screens/RestoreFromCloud/BackupItem2024.tsx +++ b/apps/mobile/src/screens/RestoreFromCloud/BackupItem2024.tsx @@ -32,9 +32,6 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({ borderRadius: 8, backgroundColor: colors2024['neutral-card-1'], }, - rootSelected: { - borderColor: colors2024['blue-default'], - }, rootImported: { opacity: 0.5, borderColor: 'transparent', @@ -180,7 +177,6 @@ export const BackupItem: React.FC = ({ onPress={imported ? noop : onPress} style={StyleSheet.flatten([ styles.root, - selected && styles.rootSelected, imported && styles.rootImported, style, ])}> diff --git a/apps/mobile/src/screens/Send/components/ChainInfo.tsx b/apps/mobile/src/screens/Send/components/ChainInfo.tsx index da18e268d..fc4f83528 100644 --- a/apps/mobile/src/screens/Send/components/ChainInfo.tsx +++ b/apps/mobile/src/screens/Send/components/ChainInfo.tsx @@ -95,7 +95,7 @@ export function ChainInfo({ modalRef.current = createGlobalBottomSheetModal2024({ name: MODAL_NAMES.SELECT_SORTED_CHAIN, value: chainEnum, - onCancel: removeChainModal, + onClose: removeChainModal, supportChains, disabledTips, hideMainnetTab, diff --git a/apps/mobile/src/screens/Send/components/ChainInfo2024.tsx b/apps/mobile/src/screens/Send/components/ChainInfo2024.tsx index bf3458692..795e7dca2 100644 --- a/apps/mobile/src/screens/Send/components/ChainInfo2024.tsx +++ b/apps/mobile/src/screens/Send/components/ChainInfo2024.tsx @@ -89,7 +89,7 @@ export function ChainInfo2024({ modalRef.current = createGlobalBottomSheetModal2024({ name: MODAL_NAMES.SELECT_SORTED_CHAIN, value: chainEnum, - onCancel: removeChainModal, + onClose: removeChainModal, supportChains, disabledTips, hideMainnetTab, diff --git a/apps/mobile/src/screens/Swap/index.tsx b/apps/mobile/src/screens/Swap/index.tsx index 711a6f250..9b1b24d7c 100644 --- a/apps/mobile/src/screens/Swap/index.tsx +++ b/apps/mobile/src/screens/Swap/index.tsx @@ -733,6 +733,7 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({ }, rowView: { flexDirection: 'row', + justifyContent: 'space-between', alignItems: 'center', width: '100%', }, @@ -749,7 +750,7 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({ marginBottom: 12, }, flex1: { - flex: 1, + width: 128, }, arrowWrapper: { width: 45, @@ -760,7 +761,6 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({ display: 'flex', justifyContent: 'center', alignItems: 'center', - marginHorizontal: 12, }, arrow: { marginHorizontal: 8,