From 46566131d494176b0b247f119c0582690ac779bd Mon Sep 17 00:00:00 2001 From: Luis-Hebendanz Date: Tue, 15 Aug 2023 20:06:55 +0200 Subject: [PATCH 1/2] Added fixed speed dial --- pkgs/ui/src/app/nodes/NodeList.tsx | 36 ++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/pkgs/ui/src/app/nodes/NodeList.tsx b/pkgs/ui/src/app/nodes/NodeList.tsx index 978a3b135..496277f64 100644 --- a/pkgs/ui/src/app/nodes/NodeList.tsx +++ b/pkgs/ui/src/app/nodes/NodeList.tsx @@ -33,6 +33,7 @@ import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import NodePieChart, { PieData } from "./NodePieChart"; import Fab from "@mui/material/Fab"; import AddIcon from "@mui/icons-material/Add"; +import Link from "next/link"; import Grid2 from "@mui/material/Unstable_Grid2"; // Grid version 2 import { @@ -118,7 +119,8 @@ function stableSort( return stabilizedThis.map((el) => el[0]); } -function BasicSpeedDial() { +function CrudSpeedDial(props: {selected: string | undefined}) { + const { selected } = props; const [open, setOpen] = React.useState(false); function handleClose(event: any, reason: CloseReason) { @@ -133,19 +135,22 @@ function BasicSpeedDial() { } } + const isSomethingSelected = selected != undefined; + return ( } direction="down" @@ -153,13 +158,30 @@ function BasicSpeedDial() { onOpen={handleOpen} open={open} > - } tooltipTitle="Edit" /> - } tooltipTitle="Add" /> + + + + } + tooltipTitle="Add" + /> + } + icon={} tooltipTitle="Delete" /> + + + + } + tooltipTitle="Edit" + /> ); @@ -267,7 +289,7 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { return ( - + Date: Tue, 15 Aug 2023 20:37:34 +0200 Subject: [PATCH 2/2] Fixed jumping icon on selected --- pkgs/ui/src/app/nodes/NodeList.tsx | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/pkgs/ui/src/app/nodes/NodeList.tsx b/pkgs/ui/src/app/nodes/NodeList.tsx index 496277f64..f53d3757a 100644 --- a/pkgs/ui/src/app/nodes/NodeList.tsx +++ b/pkgs/ui/src/app/nodes/NodeList.tsx @@ -119,7 +119,7 @@ function stableSort( return stabilizedThis.map((el) => el[0]); } -function CrudSpeedDial(props: {selected: string | undefined}) { +function CrudSpeedDial(props: { selected: string | undefined }) { const { selected } = props; const [open, setOpen] = React.useState(false); @@ -135,7 +135,19 @@ function CrudSpeedDial(props: {selected: string | undefined}) { } } - const isSomethingSelected = selected != undefined; + const isSomethingSelected = selected != undefined; + + function editDial() { + if (isSomethingSelected) { + return ( + + + + ); + } else { + return ; + } + } return ( + } @@ -170,18 +182,12 @@ function CrudSpeedDial(props: {selected: string | undefined}) { } + icon={ + + } tooltipTitle="Delete" /> - - - - } - tooltipTitle="Edit" - /> + ); @@ -289,7 +295,7 @@ function EnhancedTableToolbar(props: EnhancedTableToolbarProps) { return ( - +