-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEAT]: User connects backup to instance with same backup or differen…
…t backup (#7697)
- Loading branch information
1 parent
ea1500d
commit b1a8c54
Showing
14 changed files
with
284 additions
and
127 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 | ||
--- | ||
|
||
User connects backup to instance with same backup or different backup |
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
76 changes: 76 additions & 0 deletions
76
apps/ledger-live-mobile/src/newArch/features/WalletSync/components/Error/Detailed.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,76 @@ | ||
import React from "react"; | ||
import { Flex, Text, Button, Link, Box } from "@ledgerhq/native-ui"; | ||
import { AnalyticsPage } from "../../hooks/useLedgerSyncAnalytics"; | ||
import TrackScreen from "~/analytics/TrackScreen"; | ||
import { ButtonProps } from "@ledgerhq/native-ui/components/cta/Button"; | ||
import styled from "styled-components/native"; | ||
|
||
interface Props { | ||
icon: React.ReactNode; | ||
title: string; | ||
description: string; | ||
info?: string; | ||
cta: string; | ||
ctaSecondary?: string; | ||
primaryAction: () => void; | ||
secondaryAction?: () => void; | ||
analyticsPage: AnalyticsPage; | ||
buttonType: ButtonProps["type"]; | ||
outline?: boolean; | ||
} | ||
export function DetailedError(props: Props) { | ||
const { | ||
icon, | ||
title, | ||
description, | ||
info, | ||
cta, | ||
ctaSecondary, | ||
primaryAction, | ||
secondaryAction, | ||
analyticsPage, | ||
buttonType, | ||
outline, | ||
} = props; | ||
|
||
return ( | ||
<Flex flexDirection="column" alignItems="center" justifyContent="center"> | ||
<TrackScreen category={analyticsPage} /> | ||
<Container mb={6}>{icon}</Container> | ||
<Text variant="h4" color="neutral.c100" textAlign="center" fontWeight="semiBold" mb={4}> | ||
{title} | ||
</Text> | ||
|
||
<Flex flexDirection="column" mb={8} rowGap={16}> | ||
<Text variant="bodyLineHeight" color="neutral.c70" textAlign="center"> | ||
{description} | ||
</Text> | ||
<Text variant="bodyLineHeight" color="neutral.c70" textAlign="center"> | ||
{info} | ||
</Text> | ||
</Flex> | ||
|
||
<Flex flexDirection="column" rowGap={24} mb={6} width={"100%"} px={"16px"}> | ||
<Button type={buttonType} outline={outline} onPress={primaryAction}> | ||
{cta} | ||
</Button> | ||
|
||
<Link onPress={secondaryAction}> | ||
<Text variant="paragraph" fontWeight="semiBold" color="neutral.c70"> | ||
{ctaSecondary} | ||
</Text> | ||
</Link> | ||
</Flex> | ||
</Flex> | ||
); | ||
} | ||
|
||
const Container = styled(Box)` | ||
background-color: ${p => p.theme.colors.opacityDefault.c05}; | ||
border-radius: 100px; | ||
height: 72px; | ||
width: 72px; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
`; |
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
apps/ledger-live-mobile/src/newArch/features/WalletSync/components/Error/SpecificError.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,18 @@ | ||
import React from "react"; | ||
import { ErrorReason, useSpecificError } from "../../hooks/useSpecificError"; | ||
import { DetailedError } from "./Detailed"; | ||
|
||
type Props = { | ||
error: ErrorReason; | ||
cancel?: () => void; | ||
understood?: () => void; | ||
goToDelete?: () => void; | ||
tryAgain?: () => void; | ||
}; | ||
|
||
export const SpecificError = ({ error, cancel, goToDelete, understood, tryAgain }: Props) => { | ||
const { getErrorConfig } = useSpecificError({ cancel, goToDelete, understood, tryAgain }); | ||
const config = getErrorConfig(error); | ||
|
||
return <DetailedError {...config} />; | ||
}; |
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
Oops, something went wrong.