Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dark mode docs #1506

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions docs/sliver-docs/pages/docs/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Themes } from "@/util/themes";
import {
Card,
CardBody,
Expand All @@ -8,6 +9,7 @@ import {
} from "@nextui-org/react";
import { useQuery } from "@tanstack/react-query";
import { NextPage } from "next";
import { useTheme } from "next-themes";
import React from "react";
import Markdown from "react-markdown";
import remarkGfm from "remark-gfm";
Expand All @@ -22,6 +24,8 @@ type Docs = {
};

const DocsIndexPage: NextPage = () => {
const { theme } = useTheme();

const { data: docs, isLoading } = useQuery({
queryKey: ["docs"],
queryFn: async (): Promise<Docs> => {
Expand All @@ -48,7 +52,7 @@ const DocsIndexPage: NextPage = () => {
<div className="grid grid-cols-12">
<div className="col-span-2 mt-6 ml-4">
<div className="flex flex-row justify-center text-lg mb-2 gap-2">
Sliver Docs
Topics
</div>
<div className="mt-2">
<Listbox
Expand All @@ -74,12 +78,16 @@ const DocsIndexPage: NextPage = () => {
</div>
</div>
<div className="col-span-10">
<Card className="mt-4 ml-4 mr-4 mb-4">
<Card className="mt-8 ml-8 mr-8 mb-8">
<CardHeader>
<span className="text-3xl">{name}</span>
</CardHeader>
<Divider />
<CardBody className="prose prose-slate">
<CardBody
className={
theme === Themes.DARK ? "prose prose-invert" : "prose prose-slate"
}
>
<Markdown remarkPlugins={[remarkGfm]}>{markdown}</Markdown>
</CardBody>
</Card>
Expand Down
Loading