refactor(status-page): tighten the bold/modern/editorial conversion

Apply review feedback:
- Editorial chartSwitch: drop the per-button isFirst flag and put the divider on the parent via "& > button + button { borderLeft }"; chartSwitchButton(active) now matches bold/modern's signature
- Drop the empty company: {} entries in bold/modern and the wrapper span around the company name; the parent brand row already styles it
- Editorial styles factory: keep the (tokens, isDark) signature for cross-theme uniformity but acknowledge the unused isDark with a void-statement instead of an underscore prefix
This commit is contained in:
gorkem-bwl committed 2026-04-27 18:45:45 -04:00
1 parent c6c50063d8
commit 4f8f2f1422
6 files changed
+13 -23

No files matched your search

@@ -52,12 +52,7 @@ export const BoldStatusPage = ({ statusPage, monitors }: Props) => {
) : (
<Box sx={styles.logoConic}>{monoFirstChar(statusPage.companyName)}</Box>
)}
<Box
component="span"
sx={styles.company}
>
{statusPage.companyName}
</Box>
{statusPage.companyName}
</Box>
</Box>
@@ -12,7 +12,6 @@ export interface BoldStyles {
brand: SxProps<Theme>;
logoConic: SxProps<Theme>;
logoImg: SxProps<Theme>;
company: SxProps<Theme>;
hero: SxProps<Theme>;
heroTitle: SxProps<Theme>;
heroCheck: (tone: OverallTone) => SxProps<Theme>;
@@ -128,7 +127,6 @@ export const boldStyles = (
boxShadow: `0 8px 24px color-mix(in srgb, ${tokens.up} 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.2)`,
},
logoImg: { maxHeight: 36, maxWidth: 140, objectFit: "contain" },
company: {},
hero: {
position: "relative",
@@ -108,7 +108,7 @@ export const EditorialStatusPage = ({ statusPage, monitors }: Props) => {
role="radio"
aria-checked={chartMode === "heatmap"}
onClick={() => setChartMode("heatmap")}
sx={styles.chartSwitchButton(chartMode === "heatmap", true)}
sx={styles.chartSwitchButton(chartMode === "heatmap")}
>
{t("pages.statusPages.monitorsList.chartTypeHeatmap")}
</Box>
@@ -118,7 +118,7 @@ export const EditorialStatusPage = ({ statusPage, monitors }: Props) => {
role="radio"
aria-checked={chartMode === "histogram"}
onClick={() => setChartMode("histogram")}
sx={styles.chartSwitchButton(chartMode === "histogram", false)}
sx={styles.chartSwitchButton(chartMode === "histogram")}
>
{t("pages.statusPages.monitorsList.chartTypeHistogram")}
</Box>
@@ -18,7 +18,7 @@ export interface EditorialStyles {
dateline: SxProps<Theme>;
chartSwitchWrap: SxProps<Theme>;
chartSwitch: SxProps<Theme>;
chartSwitchButton: (active: boolean, isFirst: boolean) => SxProps<Theme>;
chartSwitchButton: (active: boolean) => SxProps<Theme>;
monitorList: SxProps<Theme>;
card: SxProps<Theme>;
cardRow: SxProps<Theme>;
@@ -50,8 +50,9 @@ const sansStack = '-apple-system, "Helvetica Neue", Arial, sans-serif';
export const editorialStyles = (
tokens: StatusPageThemeTokens,
_isDark: boolean
isDark: boolean
): EditorialStyles => {
void isDark;
const heatCellBg: Record<EditorialHeatCell, string> = {
fast: tokens.up,
med: `color-mix(in srgb, ${tokens.up} 60%, ${tokens.bg})`,
@@ -150,8 +151,12 @@ export const editorialStyles = (
mb: "20px",
fontFamily: sansStack,
},
chartSwitch: { display: "inline-flex", border: `1px solid ${tokens.text}` },
chartSwitchButton: (active, isFirst) => ({
chartSwitch: {
display: "inline-flex",
border: `1px solid ${tokens.text}`,
"& > button + button": { borderLeft: `1px solid ${tokens.text}` },
},
chartSwitchButton: (active) => ({
fontFamily: "inherit",
fontSize: 10,
textTransform: "uppercase",
@@ -162,7 +167,6 @@ export const editorialStyles = (
color: active ? tokens.bg : tokens.text,
cursor: "pointer",
fontWeight: 700,
...(isFirst ? {} : { borderLeft: `1px solid ${tokens.text}` }),
}),
monitorList: {
@@ -52,12 +52,7 @@ export const ModernStatusPage = ({ statusPage, monitors }: Props) => {
) : (
<Box sx={styles.logoGrad}>{monoFirstChar(statusPage.companyName)}</Box>
)}
<Box
component="span"
sx={styles.company}
>
{statusPage.companyName}
</Box>
{statusPage.companyName}
</Box>
</Box>
@@ -13,7 +13,6 @@ export interface ModernStyles {
brand: SxProps<Theme>;
logoGrad: SxProps<Theme>;
logoImg: SxProps<Theme>;
company: SxProps<Theme>;
hero: SxProps<Theme>;
pulse: (tone: OverallTone) => SxProps<Theme>;
statusCopy: SxProps<Theme>;
@@ -135,7 +134,6 @@ export const modernStyles = (
boxShadow: `0 4px 10px color-mix(in srgb, ${tokens.up} 40%, transparent)`,
},
logoImg: { maxHeight: 32, maxWidth: 120, objectFit: "contain" },
company: {},
hero: {
position: "relative",