Skip to content

Commit 8c339d0

Browse files
Pass rowType to styled component instead of using another class name
1 parent cead0ea commit 8c339d0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,14 @@ export const DataGridRow = forwardRef(
6767
DataGridRow.displayName = "DataGridRow";
6868

6969
const StyledDataGridCell = styled.div<{
70+
$rowType: "default" | "header";
7071
$gridRow?: string | number;
7172
$gridColumn?: string | number;
7273
}>`
74+
${({ $rowType }) => ($rowType === "header" ? "font-weight: 600;" : "")}
7375
${({ $gridRow }) => ($gridRow ? `grid-row: ${$gridRow};` : "")}
7476
${({ $gridColumn }) => ($gridColumn ? `grid-column: ${$gridColumn};` : "")}
7577
padding: 4px 12px;
76-
77-
&.header {
78-
font-weight: 600;
79-
}
8078
`;
8179

8280
interface DataGridCellProps {
@@ -94,9 +92,9 @@ export function DataGridCell({
9492
className,
9593
children,
9694
}: DataGridCellProps) {
97-
className = `${className || ""} ${rowType}`;
9895
return (
9996
<StyledDataGridCell
97+
$rowType={rowType}
10098
$gridRow={gridRow}
10199
$gridColumn={gridColumn}
102100
className={className}

0 commit comments

Comments
 (0)