-
-
Notifications
You must be signed in to change notification settings - Fork 251
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(suite-native): revise navigation and spacing of the Sync my coins…
… flow
- Loading branch information
Showing
16 changed files
with
105 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 15 additions & 50 deletions
65
suite-native/module-accounts-import/src/components/AccountImportSubHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,26 @@ | ||
import { useSelector } from 'react-redux'; | ||
|
||
import { useNavigation } from '@react-navigation/core'; | ||
|
||
import { IconButton, Text, VStack } from '@suite-native/atoms'; | ||
import { useTranslate } from '@suite-native/intl'; | ||
import { | ||
AccountsImportStackParamList, | ||
AccountsImportStackRoutes, | ||
AppTabsRoutes, | ||
HomeStackRoutes, | ||
RootStackParamList, | ||
RootStackRoutes, | ||
CloseActionType, | ||
ScreenSubHeader, | ||
StackToTabCompositeProps, | ||
useNavigateToInitialScreen, | ||
} from '@suite-native/navigation'; | ||
import { Translation } from '@suite-native/intl'; | ||
import { selectIsDeviceAccountless } from '@suite-common/wallet-core'; | ||
|
||
type NavigationProp = StackToTabCompositeProps< | ||
AccountsImportStackParamList, | ||
AccountsImportStackRoutes.AccountImportSummary, | ||
RootStackParamList | ||
>; | ||
|
||
export const AccountImportSubHeader = () => { | ||
const navigation = useNavigation<NavigationProp>(); | ||
const isDeviceAccountless = useSelector(selectIsDeviceAccountless); | ||
type AccountImportSubHeaderProps = { | ||
closeActionType?: CloseActionType; | ||
}; | ||
|
||
const handleCloseOnboarding = () => { | ||
navigation.navigate(RootStackRoutes.AppTabs, { | ||
screen: AppTabsRoutes.HomeStack, | ||
params: { | ||
screen: HomeStackRoutes.Home, | ||
}, | ||
}); | ||
}; | ||
export const AccountImportSubHeader = ({ | ||
closeActionType = 'close', | ||
}: AccountImportSubHeaderProps) => { | ||
const { translate } = useTranslate(); | ||
const navigateToInitialScreen = useNavigateToInitialScreen(); | ||
|
||
return ( | ||
<ScreenSubHeader | ||
leftIcon={ | ||
!isDeviceAccountless ? ( | ||
<IconButton | ||
iconName="x" | ||
colorScheme="tertiaryElevation0" | ||
onPress={handleCloseOnboarding} | ||
accessibilityRole="button" | ||
accessibilityLabel="close" | ||
size="medium" | ||
/> | ||
) : null | ||
} | ||
content={ | ||
<VStack alignItems="center" spacing="sp8"> | ||
<Text variant="titleSmall" adjustsFontSizeToFit numberOfLines={1}> | ||
<Translation id="moduleAccountImport.title" /> | ||
</Text> | ||
</VStack> | ||
} | ||
customHorizontalPadding="sp16" | ||
closeActionType={closeActionType} | ||
closeAction={closeActionType === 'close' ? navigateToInitialScreen : undefined} | ||
content={translate('moduleAccountImport.title')} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.