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