Skip to content

Commit

Permalink
Fix LinkCell missing key
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Dec 3, 2024
1 parent e82c811 commit e6511e9
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions packages/lake/src/components/Cells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export const LinkCell = ({
}: LinkCellProps) => {
const atEnd = buttonPosition === "end";

const elements = [
const button = (
<Pressable
style={[styles.button, atEnd && styles.buttonEnd]}
onPress={event => {
Expand All @@ -378,18 +378,30 @@ export const LinkCell = ({
)}
</>
)}
</Pressable>,
</Pressable>
);

const text = (
<LakeText numberOfLines={1} color={colors.gray[900]} variant={variant} tooltip={tooltip}>
{children}
</LakeText>,
];

if (atEnd) {
elements.reverse();
}
</LakeText>
);

return <Cell fadeOn={fadeOn}>{elements}</Cell>;
return (
<Cell fadeOn={fadeOn}>
{atEnd ? (
<>
{button}
{text}
</>
) : (
<>
{text}
{button}
</>
)}
</Cell>
);
};

/**
Expand Down

0 comments on commit e6511e9

Please sign in to comment.