Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sshmaxime committed Aug 9, 2023
2 parents 238655c + 4b89050 commit 02a13fb
Show file tree
Hide file tree
Showing 183 changed files with 10,128 additions and 2,503 deletions.
7 changes: 7 additions & 0 deletions .changeset/cool-months-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ledgerhq/types-live": patch
"ledger-live-desktop": patch
"live-mobile": patch
---

Pixel polishing for stax (LLM) : Error states, My Ledger, CLS, Post Onboarding, Device Selection
5 changes: 5 additions & 0 deletions .changeset/fuzzy-cheetahs-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Add device language change prompt to sync onboarding on the security check step
6 changes: 6 additions & 0 deletions .changeset/modern-spiders-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@ledgerhq/native-ui": patch
"@ledgerhq/icons-ui": patch
---

Changes on the new icons to allow for correct rendering in Native environments + types changes in NativeUI
5 changes: 5 additions & 0 deletions .changeset/moody-ants-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Adding translates support for discover v2 manifests
5 changes: 5 additions & 0 deletions .changeset/six-parents-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Ledger Stax onboarding: implementation of early security checks (genuine check and fw version check + upgrade before the sync onboarding)
7 changes: 7 additions & 0 deletions apps/ledger-live-desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# ledger-live-desktop

## 2.65.1

### Patch Changes

- Updated dependencies [[`5696f24b93`](https://github.com/LedgerHQ/ledger-live/commit/5696f24b93151bc0ee063d1cb88cef1e2d052f9e)]:
- @ledgerhq/react-ui@0.14.5

## 2.65.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"license": "MIT",
"private": true,
"main": "./.webpack/main.bundle.js",
"version": "2.65.0",
"version": "2.65.1",
"scripts": {
"start:prod": "electron ./.webpack/main.bundle.js",
"start": "cross-env NODE_ENV=development node ./tools/main.js",
Expand Down
14 changes: 14 additions & 0 deletions apps/ledger-live-desktop/src/config/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const urls = {
"https://www.ledger.com/staking-cosmos?utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=cosmos",
stakingPolkadot:
"https://support.ledger.com/hc/en-us/articles/360018131260?utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=polkadot",
cardanoStakingRewards: "https://support.ledger.com/hc/articles/7880073204253?docs=true",
algorandStakingRewards:
"https://support.ledger.com/hc/en-us/articles/360015897740?utm_source=ledger_live_desktop&utm_medium=self_referral&utm_content=algorand",
nearStakingRewards:
Expand Down Expand Up @@ -278,6 +279,19 @@ export const urls = {
playStore: "https://play.google.com/store/apps/details?id=com.ledger.live",
},
howToUpdateNewLedger: "https://support.ledger.com/hc/en-us/articles/9305992683165?docs=true",
genuineCheck: {
en: "https://support.ledger.com/hc/en-us/articles/4404389367057-Is-my-Ledger-device-genuine-?docs=true",
ar: "https://support.ledger.com/hc/ar/articles/4404389367057-%D9%87%D9%84-%D8%AC%D9%87%D8%A7%D8%B2-Ledger-%D8%A7%D9%84%D8%AE%D8%A7%D8%B5-%D8%A8%D9%8A-%D8%A3%D8%B5%D9%84%D9%8A-?docs=true",
de: "https://support.ledger.com/hc/de/articles/4404389367057-Ist-mein-Ledger-Ger%C3%A4t-echt-?docs=true",
es: "https://support.ledger.com/hc/es/articles/4404389367057--Es-original-mi-dispositivo-Ledger-?docs=true",
fr: "https://support.ledger.com/hc/fr-fr/articles/4404389367057-Mon-appareil-Ledger-est-il-authentique-?docs=true",
ja: "https://support.ledger.com/hc/ja/articles/4404389367057-%E7%A7%81%E3%81%AELedger%E3%83%87%E3%83%90%E3%82%A4%E3%82%B9%E3%81%AF%E6%AD%A3%E8%A6%8F%E5%93%81%E3%81%A7%E3%81%99%E3%81%8B-?docs=true",
ko: "https://support.ledger.com/hc/ko/articles/4404389367057-%EB%82%B4-Ledger-%EC%9E%A5%EC%B9%98%EB%8A%94-%EC%A0%95%ED%92%88%EC%9D%B8%EA%B0%80%EC%9A%94-?docs=true",
pt: "https://support.ledger.com/hc/pt-br/articles/4404389367057-Meu-dispositivo-Ledger-%C3%A9-aut%C3%AAntico-?docs=true",
ru: "https://support.ledger.com/hc/ru/articles/4404389367057-%D0%AF%D0%B2%D0%BB%D1%8F%D0%B5%D1%82%D1%81%D1%8F-%D0%BB%D0%B8-%D0%BC%D0%BE%D1%91-%D1%83%D1%81%D1%82%D1%80%D0%BE%D0%B9%D1%81%D1%82%D0%B2%D0%BE-Ledger-%D0%BF%D0%BE%D0%B4%D0%BB%D0%B8%D0%BD%D0%BD%D1%8B%D0%BC-?docs=true",
tr: "https://support.ledger.com/hc/tr/articles/4404389367057-Ledger-cihaz%C4%B1m-orijinal-mi-?docs=true",
zh: "https://support.ledger.com/hc/zh-cn/articles/4404389367057-%E6%88%91%E7%9A%84-Ledger-%E8%AE%BE%E5%A4%87%E6%98%AF%E5%90%A6%E4%B8%BA%E6%AD%A3%E5%93%81-?docs=true",
},
};

export const vaultSigner = {
Expand Down
10 changes: 9 additions & 1 deletion apps/ledger-live-desktop/src/renderer/Default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,15 @@ export default function Default() {
<DisableTransactionBroadcastWarning />
) : null}
<Switch>
<Route path="/onboarding" component={Onboarding} />
<Route
path="/onboarding"
render={() => (
<>
<Onboarding />
<Drawer />
</>
)}
/>
<Route path="/sync-onboarding" component={SyncOnboarding} />
<Route
path="/post-onboarding"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ export const Title = styled(Text).attrs({
white-space: pre-line;
`;

const BulletText = styled(Text).attrs({
variant: "body",
fontWeight: "medium",
textAlign: "start",
whiteSpace: "pre-line",
})``;

export const SubTitle = styled(Text).attrs({
variant: "paragraph",
color: "palette.text.shade100",
Expand All @@ -163,6 +170,7 @@ const ErrorDescription = styled(Text).attrs({
color: "palette.text.shade60",
textAlign: "center",
fontSize: 4,
whiteSpace: "pre-wrap",
})`
user-select: text;
`;
Expand Down Expand Up @@ -619,6 +627,23 @@ export const RenderDeviceNotOnboardedError = ({ t, device }: { t: TFunction; dev
);
};

/** Renders an error icon, title and description */
export const ErrorBody: React.FC<{
Icon: (props: { color?: string | undefined; size?: number | undefined }) => JSX.Element;
title: string | React.ReactNode;
description: string | React.ReactNode;
list?: string | React.ReactNode;
}> = ({ Icon, title, description, list }) => {
return (
<Flex flex={1} flexDirection={"column"} justifyContent={"center"} alignItems={"center"}>
<BoxedIcon Icon={Icon} size={64} iconSize={24} />
<ErrorTitle>{title}</ErrorTitle>
<ErrorDescription>{description}</ErrorDescription>
{list ? <ErrorDescription>{list}</ErrorDescription> : null}
</Flex>
);
};

export const renderError = ({
error,
t,
Expand All @@ -635,6 +660,7 @@ export const renderError = ({
withOnboardingCTA,
device,
inlineRetry = true,
Icon,
}: {
error: Error | ErrorConstructor;
t: TFunction;
Expand All @@ -651,6 +677,7 @@ export const renderError = ({
withOnboardingCTA?: boolean;
device?: Device;
inlineRetry?: boolean;
Icon?: (props: { color?: string | undefined; size?: number | undefined }) => JSX.Element;
}) => {
// Redirects from renderError and not from DeviceActionDefaultRendering because renderError
// can be used directly by other component
Expand All @@ -662,27 +689,26 @@ export const renderError = ({

return (
<Wrapper id={`error-${error.name}`}>
<BoxedIcon
Icon={() => (
<Logo info={info} warning={warning}>
<ErrorIcon size={24} error={error} />
</Logo>
)}
size={64}
<ErrorBody
Icon={
Icon
? Icon
: () => (
<Logo info={info} warning={warning}>
<ErrorIcon size={24} error={error} />
</Logo>
)
}
title={<TranslatedError error={error as unknown as Error} noLink />}
description={<TranslatedError error={error as unknown as Error} field="description" />}
list={
list ? (
<ol style={{ textAlign: "justify" }}>
<TranslatedError error={error as unknown as Error} field="list" />
</ol>
) : undefined
}
/>
<ErrorTitle>
<TranslatedError error={error as unknown as Error} noLink />
</ErrorTitle>
<ErrorDescription>
<TranslatedError error={error as unknown as Error} field="description" />
</ErrorDescription>
{list ? (
<ErrorDescription>
<ol style={{ textAlign: "justify" }}>
<TranslatedError error={error as unknown as Error} field="list" />
</ol>
</ErrorDescription>
) : null}
<ButtonContainer>
{managerAppName || requireFirmwareUpdate ? (
<OpenManagerButton
Expand Down Expand Up @@ -785,47 +811,57 @@ export const renderConnectYourDevice = ({
const renderFirmwareUpdatingBase = ({
modelId,
type,
deviceHasPin = true,
}: {
modelId: DeviceModelId;
type: Theme["theme"];
}) => (
<Wrapper>
<Header />
<Box mb={8}>
<Animation animation={getDeviceAnimation(modelId, type, "firmwareUpdating")} />
</Box>
<Footer>
<Flex alignItems="flex-start" flexDirection="column">
<Flex alignItems="center">
<Circle mr={6}>
<Text color="palette.text.shade100" variant="body">
{"1"}
</Text>
</Circle>
<Title flex={1}>
<Trans
i18nKey="DeviceAction.unlockDeviceAfterFirmwareUpdateStep1"
values={{ productName: getDeviceModel(modelId).productName }}
/>
</Title>
</Flex>
<Flex alignItems="center" mt={6}>
<Circle mr={6}>
<Text color="palette.text.shade100" variant="body">
{"2"}
</Text>
</Circle>
<Title flex={1}>
<Trans
i18nKey="DeviceAction.unlockDeviceAfterFirmwareUpdateStep2"
values={{ productName: getDeviceModel(modelId).productName }}
/>
</Title>
deviceHasPin?: boolean;
}) =>
deviceHasPin ? (
<Wrapper>
<Header />
<Box mb={8}>
<Animation animation={getDeviceAnimation(modelId, type, "firmwareUpdating")} />
</Box>
<Footer>
<Flex alignItems="flex-start" flexDirection="column">
<Flex alignItems="center">
<Circle mr={6}>
<Text color="palette.text.shade100" variant="body">
{"1"}
</Text>
</Circle>
<BulletText flex={1}>
<Trans
i18nKey="DeviceAction.unlockDeviceAfterFirmwareUpdateStep1"
values={{ productName: getDeviceModel(modelId).productName }}
/>
</BulletText>
</Flex>
<Flex alignItems="center" mt={6}>
<Circle mr={6}>
<Text color="palette.text.shade100" variant="body">
{"2"}
</Text>
</Circle>
<BulletText flex={1}>
<Trans
i18nKey="DeviceAction.unlockDeviceAfterFirmwareUpdateStep2"
values={{ productName: getDeviceModel(modelId).productName }}
/>
</BulletText>
</Flex>
</Flex>
</Flex>
</Footer>
</Wrapper>
);
</Footer>
</Wrapper>
) : (
<BulletText flex={1}>
<Trans
i18nKey="DeviceAction.unlockDeviceAfterFirmwareUpdateStep1"
values={{ productName: getDeviceModel(modelId).productName }}
/>
</BulletText>
);

export const renderFirmwareUpdating = withV3StyleProvider(renderFirmwareUpdatingBase);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export type ErrorDisplayProps = {
list?: boolean;
supportLink?: string;
warning?: boolean;
Icon?: (props: { color?: string | undefined; size?: number | undefined }) => JSX.Element;
};

const ErrorDisplay = ({
Expand All @@ -17,10 +18,11 @@ const ErrorDisplay = ({
list,
supportLink,
warning,
Icon,
}: ErrorDisplayProps) => {
const { t } = useTranslation();

return renderError({ t, error, onRetry, withExportLogs, list, supportLink, warning });
return renderError({ t, error, onRetry, withExportLogs, list, supportLink, warning, Icon });
};

export default ErrorDisplay;
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,13 @@ export function Onboarding() {
<Route path={`${path}/sync`} component={SyncOnboarding} />
<Route
path={`${path}/select-use-case`}
render={props =>
setUseCase && (
<SelectUseCase
{...props}
setOpenedPedagogyModal={setOpenedPedagogyModal}
setUseCase={setUseCase}
/>
)
}
render={props => (
<SelectUseCase
{...props}
setOpenedPedagogyModal={setOpenedPedagogyModal}
setUseCase={setUseCase}
/>
)}
/>
<Route
path={[
Expand All @@ -123,7 +121,20 @@ export function Onboarding() {
`${path}/${UseCase.recoveryPhrase}`,
`${path}/${UseCase.recover}`,
]}
render={props => useCase && <Tutorial {...props} useCase={useCase} />}
render={props =>
useCase ? (
<Tutorial {...props} useCase={useCase} />
) : (
/**
* In case we navigate to another screen then do a
* history.goBack() we lose the state here so we fallback to
* displaying the stateless device selection screen
* One case for that is when we navigate to the USB
* troubleshoot screen.
*/
<SelectDevice />
)
}
/>
</Switch>
</ScreenContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const PostOnboardingActionRow: React.FC<Props> = props => {
})}
>
<Flex flexDirection="row" alignItems="center" flexShrink={1}>
<Icon size={24} color={completed ? "neutral.c70" : "primary.c80"} />
<Icon size="M" color={completed ? "neutral.c70" : "primary.c80"} />
<Flex ml={6} flexDirection="column" justifyContent="center" flex={1}>
<Text
variant="largeLineHeight"
Expand Down
Loading

0 comments on commit 02a13fb

Please sign in to comment.