Skip to content

Commit

Permalink
Merge branch 'style/next_components' of https://github.com/RabbyHub/r…
Browse files Browse the repository at this point in the history
…abby-mobile into style/next_components
  • Loading branch information
jinming0618 committed Nov 28, 2024
2 parents 223ba5f + 98b3c41 commit 4101e31
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ export const DappSearchCardList = ({
onChainChange?.(v);
removeGlobalBottomSheetModal2024(id);
},
onClose: () => {
removeGlobalBottomSheetModal2024(id);
},
});
};

Expand Down
38 changes: 22 additions & 16 deletions apps/mobile/src/screens/Home/components/HomeTopArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand All @@ -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<RootStackParamsList>;

Expand Down Expand Up @@ -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);
},
});
},
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/screens/Receive/Receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function ReceiveScreen(): JSX.Element {
<TouchableWithoutFeedback onPress={handleCopy}>
<Text style={styles.qrCardAddress}>
{account?.address}
<IconMCopy width={17} height={17} />
<IconMCopy style={{ marginLeft: 1 }} width={17} height={17} />
</Text>
</TouchableWithoutFeedback>
</View>
Expand Down
4 changes: 0 additions & 4 deletions apps/mobile/src/screens/RestoreFromCloud/BackupItem2024.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -180,7 +177,6 @@ export const BackupItem: React.FC<BackupItemProps> = ({
onPress={imported ? noop : onPress}
style={StyleSheet.flatten([
styles.root,
selected && styles.rootSelected,
imported && styles.rootImported,
style,
])}>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/screens/Send/components/ChainInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/src/screens/Send/components/ChainInfo2024.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions apps/mobile/src/screens/Swap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({
},
rowView: {
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
width: '100%',
},
Expand All @@ -749,7 +750,7 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({
marginBottom: 12,
},
flex1: {
flex: 1,
width: 128,
},
arrowWrapper: {
width: 45,
Expand All @@ -760,7 +761,6 @@ const getStyle = createGetStyles2024(({ colors2024 }) => ({
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
marginHorizontal: 12,
},
arrow: {
marginHorizontal: 8,
Expand Down

0 comments on commit 4101e31

Please sign in to comment.