-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: horizontal section and label for Clear Signing (#7529)
* feat: add label clear signing * add clear signing horizontal list
- Loading branch information
Showing
12 changed files
with
330 additions
and
36 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 | ||
--- | ||
|
||
Add label clear signing |
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
42 changes: 42 additions & 0 deletions
42
...mobile/src/newArch/features/Web3Hub/components/ManifestsList/ManifestItem/Label/index.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,42 @@ | ||
import React from "react"; | ||
import { Text } from "@ledgerhq/native-ui"; | ||
|
||
type ItemStyle = { | ||
badgeColor: string; | ||
borderColor: string; | ||
backgroundColor: string; | ||
}; | ||
|
||
type Props = { | ||
text: string; | ||
style: ItemStyle; | ||
}; | ||
|
||
const Label: React.FC<Props> = ({ text, style }) => { | ||
const { badgeColor, borderColor, backgroundColor } = style; | ||
return ( | ||
<Text | ||
role="banner" | ||
fontSize="9px" | ||
width="auto" | ||
paddingX={2} | ||
paddingY={1} | ||
borderWidth={1} | ||
borderRadius={3} | ||
borderStyle={"solid"} | ||
flexGrow={0} | ||
flexShrink={0} | ||
overflow={"hidden"} | ||
textTransform="uppercase" | ||
color={badgeColor} | ||
borderColor={borderColor} | ||
backgroundColor={backgroundColor} | ||
fontWeight="semiBold" | ||
marginLeft={3} | ||
> | ||
{text} | ||
</Text> | ||
); | ||
}; | ||
|
||
export default Label; |
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
29 changes: 29 additions & 0 deletions
29
...h/features/Web3Hub/screens/Web3HubMain/components/HorizontalList/MinimalAppCard/index.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,29 @@ | ||
import React, { useCallback, useMemo } from "react"; | ||
import { TouchableOpacity } from "react-native"; | ||
import { Flex, Text } from "@ledgerhq/native-ui"; | ||
import AppIcon from "LLM/features/Web3Hub/components/AppIcon"; | ||
import { AppManifest } from "@ledgerhq/live-common/wallet-api/types"; | ||
|
||
export default function MinimalAppCard({ | ||
item, | ||
onPress, | ||
}: { | ||
item: AppManifest; | ||
onPress: (manifest: AppManifest) => void; | ||
}) { | ||
const disabled = useMemo(() => item.branch === "soon", [item]); | ||
const handlePress = useCallback(() => { | ||
if (!disabled) { | ||
onPress(item); | ||
} | ||
}, [disabled, item, onPress]); | ||
|
||
return ( | ||
<TouchableOpacity disabled={disabled} onPress={handlePress}> | ||
<Flex rowGap={6} marginRight={3} width={70} alignItems={"center"}> | ||
<AppIcon isDisabled={disabled} size={48} name={item.name} icon={item.icon} /> | ||
<Text numberOfLines={1}>{item.name}</Text> | ||
</Flex> | ||
</TouchableOpacity> | ||
); | ||
} |
70 changes: 70 additions & 0 deletions
70
...bile/src/newArch/features/Web3Hub/screens/Web3HubMain/components/HorizontalList/index.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,70 @@ | ||
import React from "react"; | ||
import { StyleSheet } from "react-native"; | ||
import { FlashList } from "@shopify/flash-list"; | ||
import { Box, Flex, InfiniteLoader, Text } from "@ledgerhq/native-ui"; | ||
import { AppManifest } from "@ledgerhq/live-common/wallet-api/types"; | ||
import MinimalAppCard from "./MinimalAppCard"; | ||
|
||
type Props = { | ||
title: string; | ||
isLoading: boolean; | ||
data: AppManifest[]; | ||
onEndReached?: () => void; | ||
onPressItem: (manifest: AppManifest) => void; | ||
testID?: string; | ||
}; | ||
|
||
type PropRenderItem = { | ||
item: AppManifest; | ||
extraData?: (manifest: AppManifest) => void; | ||
}; | ||
|
||
const identityFn = (item: AppManifest) => item.id; | ||
|
||
const renderItem = ({ item, extraData: onPressItem = () => {} }: PropRenderItem) => ( | ||
<MinimalAppCard item={item} onPress={onPressItem} /> | ||
); | ||
|
||
export default function HorizontalList({ | ||
title, | ||
isLoading, | ||
data, | ||
onEndReached, | ||
onPressItem, | ||
testID, | ||
}: Props) { | ||
return ( | ||
<> | ||
<Text mt={2} mb={5} numberOfLines={1} variant="h5" mx={5} accessibilityRole="header"> | ||
{title} | ||
</Text> | ||
<Box mb={2}> | ||
<FlashList | ||
testID={testID} | ||
horizontal | ||
contentContainerStyle={styles.container} | ||
keyExtractor={identityFn} | ||
renderItem={renderItem} | ||
ListFooterComponent={ | ||
isLoading ? ( | ||
<Flex marginRight={4} justifyContent={"center"} paddingTop={3}> | ||
<InfiniteLoader size={30} /> | ||
</Flex> | ||
) : null | ||
} | ||
estimatedItemSize={70} | ||
data={data} | ||
showsHorizontalScrollIndicator={false} | ||
extraData={onPressItem} | ||
onEndReached={onEndReached} | ||
/> | ||
</Box> | ||
</> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
paddingHorizontal: 5, | ||
}, | ||
}); |
Oops, something went wrong.
a409ecc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Bot] Weekly non-reg on develop with 'Oxygen' ✅ 29 txs ❌ 7 txs 💰 2 miss funds ($375.66) ⏲ 11min 51s
4 critical spec errors
Spec secret_network failed!
Spec Filecoin failed!
Spec Telos failed!
Spec Polkadot failed!
❌ 7 mutation errors
Please increase the account target to at least 6 accounts
Please increase the account target to at least 4 accounts
Details of the 36 mutations
Spec axelar (18)
Spec cosmos (15)
Spec secret_network (failed)
Spec Filecoin (0)
Spec Qtum (6)
Spec Decred (5)
Spec cardano (7)
Spec Avalanche C-Chain (10)
Spec Binance Smart Chain (10)
Spec Cronos (6)
Spec Fantom (6)
Spec Boba (failed)
Spec Telos (failed)
Spec Polygon zkEVM (5)
Spec Polkadot (failed)
Spec Tron (9)
Details of the 36 uncovered mutations
Spec axelar (2)
Spec cosmos (1)
Spec secret_network (6)
Spec Filecoin (5)
Spec Qtum (1)
Spec Decred (1)
Spec cardano (2)
Spec Binance Smart Chain (1)
Spec Cronos (3)
Spec Fantom (1)
Spec Boba (3)
Spec Telos (2)
Spec Polygon zkEVM (1)
Spec Polkadot (7)
Portfolio ($375.66) – Details of the 16 currencies
axelar123r3dwfylykx0fugawn6mu2h2smq3047pn5n9g
cosmos123r3dwfylykx0fugawn6mu2h2smq30479azmwf
MW7geTsz4hDQb38ZFAM8vcZVKHydzVWRjc
DscpdewrnJJYEWxG7UXRkxRVC7zU6tdKsYw
addr1qx7wsgcsg0t5lac6tty6j6v89can4tfn26nklmkuw5kf6ehgyf2nkgrrlvjz49cn9cqr4el6y74l85d0z3jfj75gmamq2tfxdt
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
TT2eHJXo5tRV2wYyZExr9W18mXghe6NFM1
Performance ⏲ 11min 51s
Time spent for each spec: (total across mutations)