From 63497586d82da7095ba53adeb65da05747fe38b3 Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Fri, 14 Jun 2024 15:48:52 -0300 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20(tableComponent):=20remove?= =?UTF-8?q?=20unnecessary=20comma=20and=20autoHeight=20property=20?= =?UTF-8?q?=E2=9C=A8=20(ShortcutsPage):=20add=20conditional=20rendering=20?= =?UTF-8?q?for=20TableComponent=20to=20handle=20empty=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/tableComponent/index.tsx | 1 - .../pages/ShortcutsPage/index.tsx | 26 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/frontend/src/components/tableComponent/index.tsx b/src/frontend/src/components/tableComponent/index.tsx index 7c3a540f7..b1f650f16 100644 --- a/src/frontend/src/components/tableComponent/index.tsx +++ b/src/frontend/src/components/tableComponent/index.tsx @@ -141,7 +141,6 @@ const TableComponent = forwardRef< {...props} defaultColDef={{ minWidth: 100, - autoHeight: true, }} animateRows={false} columnDefs={colDef} diff --git a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx index 90e442897..8d7036924 100644 --- a/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx +++ b/src/frontend/src/pages/SettingsPage/pages/ShortcutsPage/index.tsx @@ -40,7 +40,7 @@ export default function ShortcutsPage() { const combinationToEdit = shortcuts.filter((s) => s.name === selectedRows[0]); const [open, setOpen] = useState(false); const updateUniqueShortcut = useShortcutsStore( - (state) => state.updateUniqueShortcut + (state) => state.updateUniqueShortcut, ); function handleRestore() { @@ -97,17 +97,19 @@ export default function ShortcutsPage() {
- { - setSelectedRows([e.data.name]); - setOpen(true); - }} - /> + {colDefs && nodesRowData.length > 0 && ( + { + setSelectedRows([e.data.name]); + setOpen(true); + }} + /> + )}