-
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.
Bugfix/live 4308 "Language" row bad layout in My Ledger (#1623)
* Fix layout issue in device options + make reusable component for device options * lint * lint
- Loading branch information
1 parent
a048793
commit 9d90943
Showing
4 changed files
with
68 additions
and
34 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 | ||
--- | ||
|
||
Fix device localization button layout in My Ledger |
23 changes: 10 additions & 13 deletions
23
apps/ledger-live-mobile/src/screens/Manager/Device/CustomLockScreen.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
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
37 changes: 37 additions & 0 deletions
37
apps/ledger-live-mobile/src/screens/Manager/Device/DeviceOptionRow.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,37 @@ | ||
import React from "react"; | ||
import { Flex, Icons, Link, Text } from "@ledgerhq/native-ui"; | ||
import { IconType } from "@ledgerhq/native-ui/components/Icon/type"; | ||
|
||
type Props = { | ||
Icon: IconType; | ||
iconSize?: number; | ||
label: string; | ||
linkLabel: string; | ||
onPress?: () => void; | ||
right?: React.ReactNode; | ||
}; | ||
|
||
const DeviceOptionRow: React.FC<Props> = props => { | ||
const { Icon, iconSize, label, right, linkLabel, onPress } = props; | ||
return ( | ||
<Flex flexDirection="row" alignItems="center"> | ||
<Icon size={iconSize || 24} color="neutral.c80" /> | ||
<Text ml={3} variant="bodyLineHeight" color="neutral.c80"> | ||
{label} | ||
</Text> | ||
<Flex flex={1} /> | ||
{right || ( | ||
<Link | ||
onPress={onPress} | ||
disabled={!onPress} | ||
type="color" | ||
Icon={Icons.ChevronRightMedium} | ||
> | ||
{linkLabel} | ||
</Link> | ||
)} | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default DeviceOptionRow; |