From d3e89e6014022162c7cc268ca8e618e9d44376b8 Mon Sep 17 00:00:00 2001 From: janvi01 Date: Mon, 2 Oct 2023 11:47:52 +0530 Subject: [PATCH 1/2] feat: added tooltip to buttons --- src/components/TableInformationDrawer/Details.tsx | 2 ++ .../TableInformationDrawer/TableInformationDrawer.tsx | 1 + src/components/TableSettingsDialog/ActionsMenu/ActionsMenu.tsx | 1 + src/components/TableSettingsDialog/DeleteMenu.tsx | 1 + src/pages/TablesPage.tsx | 3 +++ 5 files changed, 8 insertions(+) diff --git a/src/components/TableInformationDrawer/Details.tsx b/src/components/TableInformationDrawer/Details.tsx index 78dd02364..de5a26414 100644 --- a/src/components/TableInformationDrawer/Details.tsx +++ b/src/components/TableInformationDrawer/Details.tsx @@ -100,6 +100,7 @@ export default function Details() { {isAdmin && ( { setEditDescription(!editDescription); }} @@ -147,6 +148,7 @@ export default function Details() { {isAdmin && ( { setEditDetails(!editDetails); }} diff --git a/src/components/TableInformationDrawer/TableInformationDrawer.tsx b/src/components/TableInformationDrawer/TableInformationDrawer.tsx index 25b9a5e8e..22568666b 100644 --- a/src/components/TableInformationDrawer/TableInformationDrawer.tsx +++ b/src/components/TableInformationDrawer/TableInformationDrawer.tsx @@ -114,6 +114,7 @@ export default function SideDrawer() { setSideDrawer(RESET)} aria-label="Close" + title="Close" > diff --git a/src/components/TableSettingsDialog/ActionsMenu/ActionsMenu.tsx b/src/components/TableSettingsDialog/ActionsMenu/ActionsMenu.tsx index 3dc853a4a..49165f784 100644 --- a/src/components/TableSettingsDialog/ActionsMenu/ActionsMenu.tsx +++ b/src/components/TableSettingsDialog/ActionsMenu/ActionsMenu.tsx @@ -53,6 +53,7 @@ export default function ActionsMenu({ openTableSettingsDialog({ mode: "update", data: table }) } @@ -151,6 +152,7 @@ export default function TablesPage() { onChange={handleFavorite(table.id)} checked={favorites.includes(table.id)} icon={} + title="Favorite" checkedIcon={ @@ -163,6 +165,7 @@ export default function TablesPage() { /> Date: Mon, 2 Oct 2023 12:13:07 +0530 Subject: [PATCH 2/2] fix: added mui tooltip component --- .../TableInformationDrawer/Details.tsx | 43 ++++++------ .../TableInformationDrawer.tsx | 16 +++-- .../ActionsMenu/ActionsMenu.tsx | 25 +++---- .../TableSettingsDialog/DeleteMenu.tsx | 31 +++++---- src/pages/TablesPage.tsx | 67 ++++++++++--------- 5 files changed, 99 insertions(+), 83 deletions(-) diff --git a/src/components/TableInformationDrawer/Details.tsx b/src/components/TableInformationDrawer/Details.tsx index de5a26414..b097198a1 100644 --- a/src/components/TableInformationDrawer/Details.tsx +++ b/src/components/TableInformationDrawer/Details.tsx @@ -8,6 +8,7 @@ import { IconButton, Stack, TextField, + Tooltip, Typography, useTheme, } from "@mui/material"; @@ -98,16 +99,17 @@ export default function Details() { Description {isAdmin && ( - { - setEditDescription(!editDescription); - }} - sx={{ top: 4 }} - > - {editDescription ? : } - + + { + setEditDescription(!editDescription); + }} + sx={{ top: 4 }} + > + {editDescription ? : } + + )} {editDescription ? ( @@ -146,16 +148,17 @@ export default function Details() { Details {isAdmin && ( - { - setEditDetails(!editDetails); - }} - sx={{ top: 4 }} - > - {editDetails ? : } - + + { + setEditDetails(!editDetails); + }} + sx={{ top: 4 }} + > + {editDetails ? : } + + )} - setSideDrawer(RESET)} - aria-label="Close" - title="Close" - > - - + + setSideDrawer(RESET)} + aria-label="Close" + > + + + - - {mode === "create" ? : } - + + + {mode === "create" ? : } + + - setAnchorEl(e.currentTarget)} - > - - + + setAnchorEl(e.currentTarget)} + > + + + ( <> {userRoles.includes("ADMIN") && ( - - openTableSettingsDialog({ mode: "update", data: table }) + + + openTableSettingsDialog({ mode: "update", data: table }) + } + size={view === "list" ? "large" : undefined} + > + + + + )} + + } + checkedIcon={ + + + } + name={`favorite-${table.id}`} + inputProps={{ "aria-label": "Favorite" }} + sx={view === "list" ? { p: 1.5 } : undefined} + color="secondary" + /> + + + - + - )} - } - title="Favorite" - checkedIcon={ - - - - } - name={`favorite-${table.id}`} - inputProps={{ "aria-label": "Favorite" }} - sx={view === "list" ? { p: 1.5 } : undefined} - color="secondary" - /> - - - + );