From 328643144e48ed3bcdb28d493caef780c6012372 Mon Sep 17 00:00:00 2001 From: MeowcaTheoRange Date: Tue, 30 Apr 2024 11:30:44 -0500 Subject: [PATCH] outage --- src/app/page.tsx | 17 +++++++++--- src/components/Outage/Outage.tsx | 8 ++++++ src/components/Outage/styles.module.css | 15 +++++++++++ src/layout/MainLayout/Sidebar/Main/Main.tsx | 30 ++++++++++----------- src/lib/mastoauth/kysely.ts | 8 ++++++ 5 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 src/components/Outage/Outage.tsx create mode 100644 src/components/Outage/styles.module.css diff --git a/src/app/page.tsx b/src/app/page.tsx index ce20ddf..1f3dc97 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,18 +2,29 @@ import { MainLayout } from "@/layout/MainLayout/MainLayout"; import Link from "next/link"; import buttons from "@/buttons.json"; import Searchbar from "@/components/Searchbar/Searchbar"; +import { Outage } from "@/components/Outage/Outage"; export default async function Home() { const data = await fetch("https://pronouns.cc/api/v1/users/mtr").then(x=>x.json()); - const domainreq = await fetch("https://blog.abtmtr.link/api/collections/paste/posts/domain") - .then(x=>x.json()); - const domains = JSON.parse(domainreq?.data?.body.replace(/[“”]/g, "\"")) ?? []; + let domains; + try { + const domainreq = await fetch("https://blog.abtmtr.link/api/collections/paste/posts/domain") + .then(x=>x.json()); + domains = JSON.parse(domainreq?.data?.body.replace(/[“”]/g, "\"")) ?? []; + } catch(err) { + domains = []; + } const goodNames = data.names.filter((x:{status:string})=>x.status == "okay"); return ( WELCOME! Enjoy your stay at abtmtr.link! + +

the server was being stinky and died on me

+

feel free to support me during these trying times

+

https://liberapay.com/abtmtr.link/

+

abtmtr.link is a domain for a suite of services, ranging from micro-blogging to web search.

I'm {goodNames[0].value}, otherwise known as {goodNames.slice(1).map((name:{value:string}, idx:number) => ( idx == goodNames.length - 2 ? (<>or {name.value}) : (<>{name.value}{goodNames.length <= 2 ? ", " : " "}) diff --git a/src/components/Outage/Outage.tsx b/src/components/Outage/Outage.tsx new file mode 100644 index 0000000..677ca00 --- /dev/null +++ b/src/components/Outage/Outage.tsx @@ -0,0 +1,8 @@ +import styles from "./styles.module.css"; + +export function Outage({title, children}:{title: string, children: React.ReactNode}) { + return

+

{title}

+ {children} +
+} \ No newline at end of file diff --git a/src/components/Outage/styles.module.css b/src/components/Outage/styles.module.css new file mode 100644 index 0000000..de5e553 --- /dev/null +++ b/src/components/Outage/styles.module.css @@ -0,0 +1,15 @@ +.Outage { + background-color: #c00000; + color: white; + padding: 8px; + border-radius: 8px; +} + +.Outage a { + color: currentColor; +} + +.Outage h1, +.Outage p { + margin: 8px 0; +} \ No newline at end of file diff --git a/src/layout/MainLayout/Sidebar/Main/Main.tsx b/src/layout/MainLayout/Sidebar/Main/Main.tsx index fbd9220..af65f1f 100644 --- a/src/layout/MainLayout/Sidebar/Main/Main.tsx +++ b/src/layout/MainLayout/Sidebar/Main/Main.tsx @@ -38,18 +38,18 @@ export function SidebarMain({currentPage}:{currentPage:string}) { NEW - currentPage === "/" ? impossiblePlay() : openPlay()} // onMouseEnter={hoverPlay} - > + > */}
search Search
- + {/* */} Projects - currentPage.includes("/characters/") ? impossiblePlay() : openPlay()} // onMouseEnter={hoverPlay} - > + > */}
group Characters
- - */} + {/* currentPage.includes("/blog/") ? impossiblePlay() : openPlay()} // onMouseEnter={hoverPlay} - > + > */}
description Blog
- - */} + {/* currentPage.includes("/gallery/") ? impossiblePlay() : openPlay()} // onMouseEnter={hoverPlay} - > + > */}
image Gallery
- - */} + {/* currentPage.includes("/stories/") ? impossiblePlay() : openPlay()} // onMouseEnter={hoverPlay} - > + > */}
book Stories
- + {/* */} ({ }); \ No newline at end of file