feat(docs, integration): update integration documentation and redirect legacy paths
Introduced a new public documentation site for client integration at `/docs` and `/docs/integration`, removing the need for admin login. Updated the integration guide to redirect from the old admin path to the new documentation site. Added localization support for the integration documentation in English, Nepali, and Chinese. Enhanced the layout structure and improved the handling of currency display in settlement bills.
This commit is contained in:
@@ -1,18 +1,6 @@
|
||||
import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
|
||||
import { ShellAuthGate } from "@/components/admin/auth-gate";
|
||||
import { IntegrationGuideScreen } from "@/modules/docs/integration-guide-screen";
|
||||
import { PRD_INTEGRATION_ACCESS_ANY } from "@/lib/admin-prd";
|
||||
import { buildPageMetadata } from "@/lib/page-metadata";
|
||||
import type { Metadata } from "next";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export const metadata: Metadata = buildPageMetadata("config", "integrationGuide.title");
|
||||
|
||||
export default function AdminIntegrationGuidePage(): React.ReactElement {
|
||||
return (
|
||||
<ShellAuthGate>
|
||||
<AdminPermissionGate requiredAny={PRD_INTEGRATION_ACCESS_ANY}>
|
||||
<IntegrationGuideScreen />
|
||||
</AdminPermissionGate>
|
||||
</ShellAuthGate>
|
||||
);
|
||||
}
|
||||
/** 旧后台路径保留,统一跳转到公开文档站 */
|
||||
export default function AdminIntegrationGuidePage(): never {
|
||||
redirect("/docs/integration");
|
||||
}
|
||||
|
||||
5
src/app/docs/integration/errors/page.tsx
Normal file
5
src/app/docs/integration/errors/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { ErrorsDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationErrorsPage(): React.ReactElement {
|
||||
return <ErrorsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/fundamentals/page.tsx
Normal file
5
src/app/docs/integration/fundamentals/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { FundamentalsDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationFundamentalsPage(): React.ReactElement {
|
||||
return <FundamentalsDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/go-live/page.tsx
Normal file
5
src/app/docs/integration/go-live/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { GoLiveDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationGoLivePage(): React.ReactElement {
|
||||
return <GoLiveDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/iframe/page.tsx
Normal file
5
src/app/docs/integration/iframe/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { IframeDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationIframePage(): React.ReactElement {
|
||||
return <IframeDocScreen />;
|
||||
}
|
||||
11
src/app/docs/integration/layout.tsx
Normal file
11
src/app/docs/integration/layout.tsx
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { DocsSidebar } from "@/components/docs/docs-sidebar";
|
||||
import { DocsBody } from "@/components/docs/docs-shell";
|
||||
import { DOCS_NAV_GROUPS } from "@/lib/docs-nav";
|
||||
|
||||
export default function IntegrationDocsLayout({ children }: { children: ReactNode }): React.ReactElement {
|
||||
return (
|
||||
<DocsBody sidebar={<DocsSidebar groups={DOCS_NAV_GROUPS} />}>{children}</DocsBody>
|
||||
);
|
||||
}
|
||||
5
src/app/docs/integration/page.tsx
Normal file
5
src/app/docs/integration/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { OverviewDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationOverviewPage(): React.ReactElement {
|
||||
return <OverviewDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/preparation/page.tsx
Normal file
5
src/app/docs/integration/preparation/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { SetupDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationPreparationPage(): React.ReactElement {
|
||||
return <SetupDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/quickstart/page.tsx
Normal file
5
src/app/docs/integration/quickstart/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { QuickstartDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationQuickstartPage(): React.ReactElement {
|
||||
return <QuickstartDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/sso/page.tsx
Normal file
5
src/app/docs/integration/sso/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { SsoDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationSsoPage(): React.ReactElement {
|
||||
return <SsoDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/transfer/page.tsx
Normal file
5
src/app/docs/integration/transfer/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { TransferDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationTransferPage(): React.ReactElement {
|
||||
return <TransferDocScreen />;
|
||||
}
|
||||
5
src/app/docs/integration/wallet/page.tsx
Normal file
5
src/app/docs/integration/wallet/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { WalletDocScreen } from "@/modules/docs/integration/integration-doc-screens";
|
||||
|
||||
export default function IntegrationWalletPage(): React.ReactElement {
|
||||
return <WalletDocScreen />;
|
||||
}
|
||||
16
src/app/docs/layout.tsx
Normal file
16
src/app/docs/layout.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import { DocsShell } from "@/components/docs/docs-shell";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: {
|
||||
template: "%s · Integration API",
|
||||
default: "Integration API",
|
||||
},
|
||||
description: "Lottery integration docs: SSO, wallet gateway, transfers.",
|
||||
};
|
||||
|
||||
export default function DocsLayout({ children }: { children: ReactNode }): React.ReactElement {
|
||||
return <DocsShell>{children}</DocsShell>;
|
||||
}
|
||||
5
src/app/docs/page.tsx
Normal file
5
src/app/docs/page.tsx
Normal file
@@ -0,0 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
export default function DocsHomePage(): never {
|
||||
redirect("/docs/integration");
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Geist, Geist_Mono } from "next/font/google";
|
||||
import Script from "next/script";
|
||||
|
||||
import { Providers } from "@/components/providers";
|
||||
import "./globals.css";
|
||||
@@ -37,12 +36,12 @@ export default function RootLayout({
|
||||
suppressHydrationWarning
|
||||
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
||||
>
|
||||
<body className="flex min-h-full flex-col">
|
||||
<Script
|
||||
id="lottery-admin-locale-bootstrap"
|
||||
strategy="beforeInteractive"
|
||||
<head>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{ __html: ADMIN_LOCALE_BOOTSTRAP }}
|
||||
/>
|
||||
</head>
|
||||
<body className="flex min-h-full flex-col">
|
||||
<Providers>{children}</Providers>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user