From 62bca079cb409826c4df8c41a2be710daa299ed8 Mon Sep 17 00:00:00 2001 From: lyc8503 Date: Sat, 20 Sep 2025 22:56:26 +0800 Subject: [PATCH] feat: remove hash --- components/MaintenanceAlert.tsx | 99 ++++++++++++++------------------- pages/incidents.tsx | 5 -- 2 files changed, 43 insertions(+), 61 deletions(-) diff --git a/components/MaintenanceAlert.tsx b/components/MaintenanceAlert.tsx index 5e8d3d7..f8a9307 100644 --- a/components/MaintenanceAlert.tsx +++ b/components/MaintenanceAlert.tsx @@ -5,70 +5,57 @@ import { MaintenanceConfig, MonitorTarget } from '@/types/config' export default function MaintenanceAlert({ maintenance, style, - hash, }: { maintenance: Omit & { monitors?: MonitorTarget[] } style?: React.CSSProperties - hash?: string }) { const titleStyle: React.CSSProperties = {} - if (hash) { - titleStyle['textDecoration'] = 'underline' - titleStyle['cursor'] = 'pointer' - } - - function updateHash() { - if (!hash) return - window.location.hash = hash - } return ( -
- } - title={ - ( - - {maintenance.title || 'Scheduled Maintenance'} - - ) - } - color={maintenance.color || 'yellow'} - withCloseButton={false} - style={{ position: 'relative', margin: '16px auto 0 auto', ...style }} + } + title={ + ( + + {maintenance.title || 'Scheduled Maintenance'} + + ) + } + color={maintenance.color || 'yellow'} + withCloseButton={false} + style={{ position: 'relative', margin: '16px auto 0 auto', ...style }} + > + {/* Date range in top right */} +
- {/* Date range in top right */} -
- From: {new Date(maintenance.start).toLocaleString()} -
- To:{' '} - {maintenance.end ? new Date(maintenance.end).toLocaleString() : 'Until further notice'} -
+ From: {new Date(maintenance.start).toLocaleString()} +
+ To:{' '} + {maintenance.end ? new Date(maintenance.end).toLocaleString() : 'Until further notice'} +
- {maintenance.body} - {maintenance.monitors && maintenance.monitors.length > 0 && ( - <> - - Affected components: - - - {maintenance.monitors.map((comp, compIdx) => ( - {comp.name} - ))} - - - )} -
-
+ {maintenance.body} + {maintenance.monitors && maintenance.monitors.length > 0 && ( + <> + + Affected components: + + + {maintenance.monitors.map((comp, compIdx) => ( + {comp.name} + ))} + + + )} + ) } diff --git a/pages/incidents.tsx b/pages/incidents.tsx index 4b0ec0f..6ec4edf 100644 --- a/pages/incidents.tsx +++ b/pages/incidents.tsx @@ -119,11 +119,6 @@ export default function IncidentsPage() { monitorFilteredIncidents.map((incident, i) => ( ))