Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristiaanScheermeijer committed Sep 19, 2024
1 parent 008a9dd commit 6feac0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ui-react/src/components/LayoutGrid/LayoutGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ type Props<Item> = {
columnCount: number;
data: Item[];
renderCell: (item: Item, tabIndex: number) => JSX.Element;
getCellKey: (item: Item, rowIndex: number, columnIndex: number) => string;
getCellKey: (item: Item) => string;
};

const scrollIntoViewThrottled = throttle(function (focusedElement: HTMLElement) {
focusedElement.scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300);

// Keyboard-accessible grid layout, with focus management
const LayoutGrid = <Item extends { mediaid: string }>({ className, columnCount, data, renderCell, getCellKey }: Props<Item>) => {
const LayoutGrid = <Item extends object>({ className, columnCount, data, renderCell, getCellKey }: Props<Item>) => {
const [currentRowIndex, setCurrentRowIndex] = useState(0);
const [currentColumnIndex, setCurrentColumnIndex] = useState(0);
const gridRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -121,7 +121,7 @@ const LayoutGrid = <Item extends { mediaid: string }>({ className, columnCount,
<div
role="gridcell"
id={`layout_grid_${rowIndex}-${columnIndex}`}
key={getCellKey(item, rowIndex, columnIndex)}
key={getCellKey(item)}
aria-colindex={columnIndex}
className={styles.cell}
style={gridCellStyle}
Expand Down

0 comments on commit 6feac0d

Please sign in to comment.