Skip to content

Commit cac9efa

Browse files
Introduce wrapper component for DataGridRow
1 parent 56d0f28 commit cac9efa

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

extensions/ql-vscode/src/view/common/DataGrid.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function DataGrid({ gridTemplateColumns, children }: DataGridProps) {
3131
);
3232
}
3333

34-
export const DataGridRow = styled.div<{ $focused?: boolean }>`
34+
const StyledDataGridRow = styled.div<{ $focused?: boolean }>`
3535
display: contents;
3636
3737
&:hover > * {
@@ -47,6 +47,20 @@ export const DataGridRow = styled.div<{ $focused?: boolean }>`
4747
}
4848
`;
4949

50+
interface DataGridRowProps {
51+
focused?: boolean;
52+
children: React.ReactNode;
53+
ref?: React.Ref<HTMLElement | undefined>;
54+
}
55+
56+
export function DataGridRow({ focused, children, ref }: DataGridRowProps) {
57+
return (
58+
<StyledDataGridRow $focused={focused} ref={ref}>
59+
{children}
60+
</StyledDataGridRow>
61+
);
62+
}
63+
5064
const StyledDataGridCell = styled.div<{
5165
$gridRow?: string | number;
5266
$gridColumn?: string | number;

extensions/ql-vscode/src/view/model-editor/MethodRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ const ModelableMethodRow = forwardRef<HTMLElement | undefined, MethodRowProps>(
160160
<DataGridRow
161161
data-testid="modelable-method-row"
162162
ref={ref}
163-
$focused={revealedMethodSignature === method.signature}
163+
focused={revealedMethodSignature === method.signature}
164164
>
165165
<DataGridCell>
166166
<ApiOrMethodRow>
@@ -290,7 +290,7 @@ const UnmodelableMethodRow = forwardRef<
290290
<DataGridRow
291291
data-testid="unmodelable-method-row"
292292
ref={ref}
293-
$focused={revealedMethodSignature === method.signature}
293+
focused={revealedMethodSignature === method.signature}
294294
>
295295
<DataGridCell>
296296
<ApiOrMethodRow>

0 commit comments

Comments
 (0)