-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Harmonize headers and pixel polish LLM sync onboarding (#1486)
* refactor(mobile): use unified header navigation in sync onboarding screens * refactor(mobile): change the resync overlay into a gradient * fix(mobile): remove useless padding in ble scanning * refactor(mobile): rename the SyncOnboardingView and simplify it * refactor(mobile): delete old sync onboarding view files * fix: svg illustrations for device selection * fix(mobile): update after rebase * fix(mobile): remove rebase conflicts * chore: generate changeset * fix(mobile): remove rebase conflicts Co-authored-by: Alexandre Magaud <[email protected]>
- Loading branch information
1 parent
d5128ba
commit 10984d0
Showing
10 changed files
with
359 additions
and
402 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"live-mobile": patch | ||
--- | ||
|
||
Small visual fixes on the new sync onboarding flow |
79 changes: 79 additions & 0 deletions
79
apps/ledger-live-mobile/src/components/DeviceSetupView.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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React, { ReactNode } from "react"; | ||
import { Flex } from "@ledgerhq/native-ui"; | ||
import { ArrowLeftMedium, CloseMedium } from "@ledgerhq/native-ui/assets/icons"; | ||
import { useNavigation } from "@react-navigation/native"; | ||
import { TouchableOpacity } from "react-native-gesture-handler"; | ||
import { SafeAreaView } from "react-native-safe-area-context"; | ||
import { useTheme } from "styled-components/native"; | ||
|
||
export type Props = { | ||
hasBackButton?: boolean; | ||
hasCloseButton?: boolean; | ||
onBack?: () => void; | ||
onClose?: () => void; | ||
renderLeft?: () => ReactNode; | ||
renderRight?: () => ReactNode; | ||
children?: ReactNode; | ||
}; | ||
|
||
const DeviceSetupView = ({ | ||
hasBackButton, | ||
hasCloseButton, | ||
onBack, | ||
onClose, | ||
renderLeft, | ||
renderRight, | ||
children, | ||
}: Props) => { | ||
const navigation = useNavigation(); | ||
const { colors } = useTheme(); | ||
|
||
const canGoBack = navigation.canGoBack(); | ||
const canRenderBackButton = (canGoBack && hasBackButton) || onBack; | ||
const canRenderCloseButton = (canGoBack && hasCloseButton) || onClose; | ||
|
||
const handleBack = () => { | ||
navigation.goBack(); | ||
}; | ||
|
||
return ( | ||
// eslint-disable-next-line react-native/no-inline-styles | ||
<SafeAreaView style={{ flex: 1, background: colors.background.main }}> | ||
<Flex | ||
px={6} | ||
pt={8} | ||
mb={7} | ||
height={64} | ||
flexDirection="row" | ||
justifyContent="space-between" | ||
alignItems="center" | ||
> | ||
{renderLeft ? ( | ||
renderLeft() | ||
) : canRenderBackButton ? ( | ||
<Flex> | ||
<TouchableOpacity onPress={onBack || handleBack}> | ||
<ArrowLeftMedium size={24} /> | ||
</TouchableOpacity> | ||
</Flex> | ||
) : ( | ||
<Flex /> | ||
)} | ||
{renderRight ? ( | ||
renderRight() | ||
) : canRenderCloseButton ? ( | ||
<Flex> | ||
<TouchableOpacity onPress={onClose || handleBack}> | ||
<CloseMedium size={24} /> | ||
</TouchableOpacity> | ||
</Flex> | ||
) : ( | ||
<Flex /> | ||
)} | ||
</Flex> | ||
{children} | ||
</SafeAreaView> | ||
); | ||
}; | ||
|
||
export default DeviceSetupView; |
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.