Skip to content

Commit

Permalink
chore(rxPage): fix wired connections layout
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Mar 25, 2024
1 parent 3a54c5c commit 19776ed
Showing 1 changed file with 25 additions and 28 deletions.
53 changes: 25 additions & 28 deletions plugins/lime-plugin-rx/src/sections/wired.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,34 @@ const Ports = ({ switches }: { switches: SwitchStatus[] }) => {
acc[role].push(obj);
return acc;
}, {});

return (
<div className={"flex flex-row px-10"} data-testid="ports-container">
<div
className={"flex flex-wrap px-10 gap-4 justify-between"}
data-testid="ports-container"
>
{Object.keys(ports).map((role) => {
if (
role.toLowerCase() === "wan" ||
role.toLowerCase() === "lan"
)
return (
<div key={role} className={"flex-1 flex flex-column"}>
<h2 className={"font-bold"}>
{role.toUpperCase()}
</h2>
<h2>{ports[role][0].device.toLowerCase()}</h2>
<div className={"flex flex-row gap-5 "}>
{ports[role].map((port) => {
const link =
port.link.toLowerCase() === "up"
? "fill-primary-dark"
: "fill-disabled";
return (
<div key={`${role}-${port.num}`}>
<PortsIcon
className={`h-7 w-7 ${link}`}
/>
</div>
);
})}
</div>
if (role.toLowerCase() === "cpu") return null;
return (
<div key={role} className={"flex flex-col h-fit"}>
<h2 className={"font-bold"}>{role.toUpperCase()}</h2>
<h2>{ports[role][0].device.toLowerCase()}</h2>
<div className={"flex flex-row gap-5 "}>
{ports[role].map((port) => {
const link =
port.link.toLowerCase() === "up"
? "fill-primary-dark"
: "fill-disabled";
return (
<div key={`${role}-${port.num}`}>
<PortsIcon
className={`h-7 w-7 ${link}`}
/>
</div>
);
})}
</div>
);
</div>
);
})}
</div>
);
Expand Down

0 comments on commit 19776ed

Please sign in to comment.