From 5ac72d2f77e66ecb10165a808193a553e0e19147 Mon Sep 17 00:00:00 2001 From: orta Date: Fri, 10 Nov 2023 09:55:43 +0000 Subject: [PATCH] More fixes for subdomain --- .gitignore | 2 + next.config.js | 8 +- pages/index.tsx | 3 +- src/incidents/hooks/useIncidents.tsx | 2 +- src/incidents/index.tsx | 144 ++++++++++++++------------- 5 files changed, 84 insertions(+), 75 deletions(-) diff --git a/.gitignore b/.gitignore index d093a0b52004..1800473f129c 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +out \ No newline at end of file diff --git a/next.config.js b/next.config.js index 53f26c3aa1e9..21275280113b 100644 --- a/next.config.js +++ b/next.config.js @@ -3,10 +3,14 @@ const production = process.env.NODE_ENV === "production"; /** @type {import('next').NextConfig} */ const nextConfig = { - assetPrefix: production ? '/' : '', + // assetPrefix: production ? '/' : '', reactStrictMode: true, swcMinify: true, - basePath: "/status" + basePath: "/status", + images: { + unoptimized: true, + } + } module.exports = nextConfig diff --git a/pages/index.tsx b/pages/index.tsx index f5d508f9e142..d40334fb0241 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,5 +1,4 @@ import type { NextPage } from 'next' -import Image from 'next/image' import IncidentsSection from "../src/incidents" import ServicesSection from "../src/services" @@ -9,7 +8,7 @@ const Home: NextPage = () => {
- Tailwind Play + Tailwind Play
diff --git a/src/incidents/hooks/useIncidents.tsx b/src/incidents/hooks/useIncidents.tsx index 8c9839a498c1..b68aa9cd5748 100644 --- a/src/incidents/hooks/useIncidents.tsx +++ b/src/incidents/hooks/useIncidents.tsx @@ -15,7 +15,7 @@ function useIncidents() { const monthlyIncident = divideMonthly(issues.map((issue: any) => ({ id: issue.id, title: issue.title, - desciption: issue.body, + description: issue.body, status: issue.state, created_at: issue.created_at, closed_at: issue.closed_at, diff --git a/src/incidents/index.tsx b/src/incidents/index.tsx index 9fe6d39f91c1..0f08ec5c2a7d 100644 --- a/src/incidents/index.tsx +++ b/src/incidents/index.tsx @@ -1,79 +1,83 @@ import useIncidents from "./hooks/useIncidents"; import type { NextPage } from "next"; -import {Incident} from "./types/Incident"; -import {MonthlyIncident} from "./types/MonthlyIncident"; +import { Incident } from "./types/Incident"; +import { MonthlyIncident } from "./types/MonthlyIncident"; const IncidentsSection: NextPage = () => { - const [monthlyIncidents, isIncidentsLoading] = useIncidents(); + const [monthlyIncidents, isIncidentsLoading] = useIncidents(); - const formatDate = (date: string) => { - return new Date(date).toLocaleString([], { - month: "short", - day: "numeric", - hour: "numeric", - minute: "numeric", - }); - }; + const formatDate = (date: string) => { + return new Date(date).toLocaleString([], { + month: "short", + day: "numeric", + hour: "numeric", + minute: "numeric", + }); + }; - return ( -
- {isIncidentsLoading ? ( -

Loading...

- ) : ( -
- {(monthlyIncidents as MonthlyIncident[]).map((incidents) => ( -
-

{incidents.month}

-
-
- {(incidents.incidents as Incident[]).map((incident) => ( -
-
- - - -
-
-

- {incident.title} -

- {incident.status === "closed" ? ( -
-

- This incident has been resolved. -

-

- {formatDate(incident.created_at)} -{" "} - {formatDate(incident.closed_at)} -

-
- ) : ( -
-

- This incident is currently being investigated. -

-

- {formatDate(incident.created_at)} -

-
- )} -
-
- ))} -
-
- ))} -
- )} -
- ); + if (isIncidentsLoading) { + return ( +
+

Loading...

+
+ ); + } + + return ( +
+ {(monthlyIncidents as MonthlyIncident[]).map((incidents) => ( +
+

+ {incidents.month} +

+
+
+ {(incidents.incidents as Incident[]).map((incident) => ( +
+
+ + + +
+
+

+ {incident.title} +

+ {incident.status === "closed" ? ( +
+

+ This incident has been resolved. +

+

+ {formatDate(incident.created_at)} -{" "} + {formatDate(incident.closed_at)} +

+
+ ) : ( +
+

+ This incident is currently being investigated. +

+

+ {formatDate(incident.created_at)} +

+
+ )} +
+
+ ))} +
+
+ ))} +
+ ); }; export default IncidentsSection;