Fixed jumping icon on selected
This commit is contained in:
@@ -137,6 +137,18 @@ function CrudSpeedDial(props: {selected: string | undefined}) {
|
||||
|
||||
const isSomethingSelected = selected != undefined;
|
||||
|
||||
function editDial() {
|
||||
if (isSomethingSelected) {
|
||||
return (
|
||||
<Link href="/nodes/edit" style={{marginTop: 7.5}}>
|
||||
<EditIcon color="action" />
|
||||
</Link>
|
||||
);
|
||||
} else {
|
||||
return <EditIcon color="disabled" />;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@@ -161,7 +173,7 @@ function CrudSpeedDial(props: {selected: string | undefined}) {
|
||||
<SpeedDialAction
|
||||
key="Add"
|
||||
icon={
|
||||
<Link href="/nodes/add">
|
||||
<Link href="/nodes/add" style={{marginTop: 7.5}}>
|
||||
<AddIcon color="action" />
|
||||
</Link>
|
||||
}
|
||||
@@ -170,18 +182,12 @@ function CrudSpeedDial(props: {selected: string | undefined}) {
|
||||
|
||||
<SpeedDialAction
|
||||
key="Delete"
|
||||
icon={<DeleteIcon color={isSomethingSelected ? "action" : "disabled"} />}
|
||||
icon={
|
||||
<DeleteIcon color={isSomethingSelected ? "action" : "disabled"} />
|
||||
}
|
||||
tooltipTitle="Delete"
|
||||
/>
|
||||
<SpeedDialAction
|
||||
key="Edit"
|
||||
icon={
|
||||
<Link href="/nodes/edit">
|
||||
<EditIcon color={isSomethingSelected ? "action" : "disabled"} />
|
||||
</Link>
|
||||
}
|
||||
tooltipTitle="Edit"
|
||||
/>
|
||||
<SpeedDialAction key="Edit" icon={editDial()} tooltipTitle="Edit" />
|
||||
</SpeedDial>
|
||||
</Box>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user