Skip to content

Commit

Permalink
fix: hide delete buttons for already deleted configs
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Nov 1, 2023
1 parent 06b8f4f commit 38c5b28
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/components/Sidebars/configs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,30 @@ export function ConfigsList({
config={config}
className="overflow-hidden text-ellipsis flex-1 whitespace-nowrap"
/>
{config.deleted_at && (
{config.deleted_at ? (
<Badge
text="deleted"
colorClass="text-white bg-gray-400"
className="ml-2"
/>
)}
{topologyId && (
<div className="flex flex-row justify-end items-center">
<IconButton
className="bg-transparent flex items-center"
ovalProps={{
stroke: "blue",
height: "18px",
width: "18px",
fill: "transparent"
}}
icon={<BsTrash />}
onClick={() => {
setDeletedConfigLinkId(config.id);
}}
/>
</div>
) : (
topologyId && (
<div className="flex flex-row justify-end items-center">
<IconButton
className="bg-transparent flex items-center"
ovalProps={{
stroke: "blue",
height: "18px",
width: "18px",
fill: "transparent"
}}
icon={<BsTrash />}
onClick={() => {
setDeletedConfigLinkId(config.id);
}}
/>
</div>
)
)}
</li>
))}
Expand Down

0 comments on commit 38c5b28

Please sign in to comment.