Updated md loader
This commit is contained in:
parent
9c04f13a42
commit
4245eff43e
@ -1,5 +1,5 @@
|
|||||||
import { Loader } from "@/components/loader";
|
import { MDSkeletonLoader } from "@/components/loader";
|
||||||
|
|
||||||
export default function Loading() {
|
export default function Loading() {
|
||||||
return <Loader />;
|
return <MDSkeletonLoader />;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { readMD } from "@/actions/readMD";
|
import { readMD } from "@/actions/readMD";
|
||||||
import { HelpClient } from "./client";
|
import { HelpClient } from "./client";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { Loader } from "@/components/loader";
|
import { MDSkeletonLoader } from "@/components/loader";
|
||||||
|
|
||||||
// export const
|
// export const
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ export default async function Help({
|
|||||||
"./md/help articles/" + decodeURIComponent(params.article),
|
"./md/help articles/" + decodeURIComponent(params.article),
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<Loader />}>
|
<Suspense fallback={<MDSkeletonLoader />}>
|
||||||
<HelpClient
|
<HelpClient
|
||||||
body={body}
|
body={body}
|
||||||
title={decodeURIComponent(params.article).replace(".md", "")}
|
title={decodeURIComponent(params.article).replace(".md", "")}
|
||||||
|
@ -3,7 +3,7 @@ import { TTCMD } from "@/components/ttcmd";
|
|||||||
import { readFile } from "fs/promises";
|
import { readFile } from "fs/promises";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import { HomeClient } from "./client";
|
import { HomeClient } from "./client";
|
||||||
import { Loader } from "@/components/loader";
|
import { MDSkeletonLoader } from "@/components/loader";
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
const body = readMD("./md/home.md");
|
const body = readMD("./md/home.md");
|
||||||
@ -135,7 +135,7 @@ export default function Home() {
|
|||||||
</cite>
|
</cite>
|
||||||
</section> */
|
</section> */
|
||||||
}
|
}
|
||||||
<Suspense fallback={<Loader />}>
|
<Suspense fallback={<MDSkeletonLoader />}>
|
||||||
<HomeClient body={body} />
|
<HomeClient body={body} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
|
|
||||||
export const Loader: FC = () => {
|
export const MDSkeletonLoader: FC = () => {
|
||||||
const tragedy = [
|
const tragedy = [
|
||||||
"Did you ever hear the tragedy of Darth Plagueis the Wise?",
|
"Did you ever hear the tragedy of Darth Plagueis the Wise?",
|
||||||
"No.",
|
"No.",
|
||||||
@ -13,14 +13,75 @@ export const Loader: FC = () => {
|
|||||||
"Not from a Jedi.",
|
"Not from a Jedi.",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const bucket = [
|
||||||
|
"Dear God",
|
||||||
|
"Theres more",
|
||||||
|
"No!",
|
||||||
|
"It contains, a bucket!",
|
||||||
|
];
|
||||||
|
|
||||||
|
const indentation = ["ml-0", "ml-6", "ml-12"];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="heading">
|
<section className="heading">
|
||||||
<h2 className="strapline skeleton">Do It</h2>
|
<h2 className="strapline skeleton w-min whitespace-nowrap">Do It</h2>
|
||||||
<h1 className="skeleton">Kill him. Kill him now.</h1>
|
<h1 className="skeleton w-min whitespace-nowrap">
|
||||||
|
Kill him. Kill him now.
|
||||||
|
</h1>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section className="grid grid-cols-3">
|
||||||
{tragedy.map((t) => <p key={t} className=".skeleton">{t}</p>)}
|
<div className="col-span-2">
|
||||||
|
{tragedy.map((t) => (
|
||||||
|
<p key={t} className="my-2 leading-8">
|
||||||
|
<span className="skeleton p-1">{t}</span>
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
<div className="col-span-2 grid grid-cols-3 my-6 gap-8">
|
||||||
|
<div className="card skeleton h-36"></div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
<span className="skeleton">Hey man I heard you like memes</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="skeleton">
|
||||||
|
I'll be honest, I'm just kind of phoning it in down
|
||||||
|
here. The other memes came to mind really easily, but I could
|
||||||
|
think of anything for down here. Ooh look, lorem ipsum!
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span className="skeleton">
|
||||||
|
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
|
||||||
|
Exercitationem fugiat sed odit sunt ex ab maxime qui animi
|
||||||
|
optio! Rem itaque nesciunt beatae voluptas facilis optio natus
|
||||||
|
culpa. Corrupti, error.
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div className="card skeleton h-48"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="mt-4">
|
||||||
|
<h3 className="text-3xl skeleton w-min whitespace-nowrap">
|
||||||
|
This is a bucket
|
||||||
|
</h3>
|
||||||
|
<ul className="list-disc ml-6 ">
|
||||||
|
{Array(Math.floor(Math.random() * 3) + 2).fill(bucket).flat().map((
|
||||||
|
t,
|
||||||
|
i,
|
||||||
|
) => (
|
||||||
|
<li
|
||||||
|
key={t}
|
||||||
|
className={"my-2 leading-8 text-black/20 " + indentation[
|
||||||
|
i === 0 ? 0 : Math.floor(Math.random() * indentation.length)
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<span className="skeleton p-1">{t}</span>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</>
|
</>
|
||||||
// <div className="mx-auto text-9xl flex justify-center py-24">
|
// <div className="mx-auto text-9xl flex justify-center py-24">
|
||||||
|
@ -15,7 +15,7 @@ import React, {
|
|||||||
} from "react";
|
} from "react";
|
||||||
|
|
||||||
import { sanitize } from "isomorphic-dompurify";
|
import { sanitize } from "isomorphic-dompurify";
|
||||||
import { Loader } from "../loader";
|
import { MDSkeletonLoader } from "../loader";
|
||||||
|
|
||||||
export const TTCMD: FC<
|
export const TTCMD: FC<
|
||||||
{ body: string; escapeTOC?: (tokens: Token[]) => boolean }
|
{ body: string; escapeTOC?: (tokens: Token[]) => boolean }
|
||||||
@ -44,14 +44,16 @@ export const TTCMD: FC<
|
|||||||
}, [escapeTOC, toc]);
|
}, [escapeTOC, toc]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Suspense fallback={<Loader />}>
|
<Suspense fallback={<MDSkeletonLoader />}>
|
||||||
<button
|
{
|
||||||
|
/* <button
|
||||||
className="btn-primary"
|
className="btn-primary"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigator.clipboard.writeText(JSON.stringify(elements, null, 2))}
|
navigator.clipboard.writeText(JSON.stringify(elements, null, 2))}
|
||||||
>
|
>
|
||||||
copy ast
|
copy ast
|
||||||
</button>
|
</button> */
|
||||||
|
}
|
||||||
{hasEscapedTOC !== undefined &&
|
{hasEscapedTOC !== undefined &&
|
||||||
(
|
(
|
||||||
<TTCMDRenderer
|
<TTCMDRenderer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user