chore: adds vercel style guide to docs app (#4561)

This commit is contained in:
Piyush Gupta
2025-01-09 10:23:10 +05:30
committed by GitHub
parent b44d6e60bd
commit 6e1ee6df12
237 changed files with 1346 additions and 1314 deletions

View File

@@ -1,13 +1,13 @@
"use client";
import { Button } from "@/components/Button";
import { LoadingSpinner } from "@/components/icons/LoadingSpinner";
import { useTheme } from "next-themes";
import { useState } from "react";
import { RedocStandalone } from "redoc";
import { LoadingSpinner } from "@/components/icons/loading-spinner";
import { Button } from "@/components/button";
import "./style.css";
export const ApiDocs = () => {
export function ApiDocs() {
const { resolvedTheme } = useTheme();
const redocTheme = {
@@ -61,8 +61,8 @@ export const ApiDocs = () => {
<Button href="/developer-docs/rest-api" arrow="left" className="mb-4 mt-8">
Back to docs
</Button>
<RedocStandalone specUrl="/docs/openapi.yaml" onLoaded={() => setLoading(false)} options={redocTheme} />
{loading && <LoadingSpinner />}
<RedocStandalone specUrl="/docs/openapi.yaml" onLoaded={() => { setLoading(false); }} options={redocTheme} />
{loading ? <LoadingSpinner /> : null}
</div>
);
};
}