Skip to content

Commit

Permalink
Fix LinkCell missing key (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek authored Dec 3, 2024
1 parent e82c811 commit 07aa94e
Show file tree
Hide file tree
Showing 3 changed files with 837 additions and 824 deletions.
5 changes: 3 additions & 2 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node-linker=hoisted
save-exact=false
auto-install-peers=false
lockfile-include-tarball-url=true
save-exact=false
node-linker=hoisted
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 ? (
<>
{text}
{button}
</>
) : (
<>
{button}
{text}
</>
)}
</Cell>
);
};

/**
Expand Down
Loading

0 comments on commit 07aa94e

Please sign in to comment.