Skip to content

Commit

Permalink
feat(llm): fix e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasWerey committed Jun 12, 2024
1 parent 6c0a74b commit f9aa552
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const AddAccountDrawer = ({ isOpened, currency, onClose, reopenDrawer }: AddAcco
descriptionKey: "addAccountsModal.assetsScreen.add.description",
onPress: onClickAdd,
icon: <Icons.LedgerDevices color={"primary.c80"} />,
testID: "add-accounts-modal-add-button",
});
}

Expand Down Expand Up @@ -71,6 +72,7 @@ const AddAccountDrawer = ({ isOpened, currency, onClose, reopenDrawer }: AddAcco
description={t(row.descriptionKey)}
onPress={row.onPress}
icon={row.icon}
testID={row.testID}
/>
))}
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { Flex, Text } from "@ledgerhq/native-ui";
import React from "react";
import Touchable from "~/components/Touchable";
import styled from "styled-components/native";
import { AddAccountDrawerRowProps } from "LLM/features/WalletSync/types/addAccountDrawer";

const Card = styled(Flex)`
const TouchableCard = styled(Touchable)`
background-color: ${p => p.theme.colors.opacityDefault.c05};
border-radius: 8px;
padding: 16px;
Expand All @@ -24,24 +25,21 @@ const CardDescription = styled(Text)`
line-height: 18.2px;
`;

type AddAccountDrawerRowProps = {
title: string;
description?: string;
icon: React.ReactNode;
onPress: React.ComponentProps<typeof Touchable>["onPress"];
};

const ActionRow = ({ title, description, icon, onPress }: AddAccountDrawerRowProps) => {
const ActionRow: React.FC<AddAccountDrawerRowProps> = ({
title,
description,
icon,
testID,
onPress,
}: AddAccountDrawerRowProps) => {
return (
<Touchable onPress={onPress}>
<Card>
{icon}
<Flex flexDirection={"column"} rowGap={4} flex={1}>
<CardTitle>{title}</CardTitle>
{description && <CardDescription>{description}</CardDescription>}
</Flex>
</Card>
</Touchable>
<TouchableCard onPress={onPress} testID={testID}>
{icon}
<Flex flexDirection={"column"} rowGap={4} flex={1}>
<CardTitle>{title}</CardTitle>
{description && <CardDescription>{description}</CardDescription>}
</Flex>
</TouchableCard>
);
};
export default ActionRow;
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
import Touchable from "~/components/Touchable";

export type AddAccountDrawerProps = {
isOpened: boolean;
currency?: CryptoCurrency | TokenCurrency | null;
onClose: () => void;
reopenDrawer: () => void;
};

export type AddAccountDrawerRowProps = {
title: string;
description?: string;
icon: React.ReactNode;
testID?: string;
onPress: React.ComponentProps<typeof Touchable>["onPress"];
};

0 comments on commit f9aa552

Please sign in to comment.