Skip to content

Commit

Permalink
Improve MOTD style a tad
Browse files Browse the repository at this point in the history
  • Loading branch information
EMERALD0874 committed Nov 17, 2023
1 parent 0025c9d commit 9d8952c
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions src/components/QAMTab/MOTDDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,36 @@ export function MOTDDisplay() {
getMotd();
}, []);

function getColors() {
switch (motd?.severity) {
case "High":
return { bg: "#c3010155", border: "#560d0d", text: "#fff" };
case "Medium":
return { bg: "rgba(255, 255, 0, 0.067)", border: "rgba(255, 255, 0, 0.467)", text: "#fff" };
default:
return { bg: "#3e72b055", border: "#6680a8", text: "#fff" };
}
}
const SEVERITIES = {
High: {
color: "#bb1414",
text: "#fff",
},
Medium: {
color: "#bbbb14",
text: "#fff",
},
Low: {
color: "#1488bb",
text: "#fff",
},
};

const severity = SEVERITIES[motd?.severity || "Low"];

if (motd && motd?.name) {
return (
<PanelSection>
<Focusable
onActivate={() => {}}
style={{
backgroundColor: getColors().bg,
color: getColors().text,
borderColor: getColors().border,
borderWidth: "0.25em",
// Transparency is 20% of the color
backgroundColor: `${severity.color}33`,
color: severity.text,
borderColor: severity.color,
borderWidth: "2px",
borderStyle: "solid",
padding: "0.25em",
padding: "0.75em",
display: "flex",
flexDirection: "column",
}}
Expand Down

0 comments on commit 9d8952c

Please sign in to comment.