Skip to content

Commit

Permalink
Merge pull request #63 from AElfProject/feature/provider
Browse files Browse the repository at this point in the history
Feature/provider
  • Loading branch information
yongenaelf authored Jul 25, 2024
2 parents 972d98f + e323e49 commit fe8fd90
Show file tree
Hide file tree
Showing 27 changed files with 197 additions and 360 deletions.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM cgr.dev/chainguard/nginx:latest

WORKDIR /usr/share/nginx/html
COPY out .

EXPOSE 8080
25 changes: 0 additions & 25 deletions app/admin/page.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions app/api/revalidate/route.ts

This file was deleted.

13 changes: 6 additions & 7 deletions app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { getSearchConfig } from "@/services/get-search-config";
import { NextRequest } from "next/server";

export async function GET(request: NextRequest) {
const config = await getSearchConfig();

return Response.json(config);
export async function GET() {
return Response.json({
index: "index",
host: "host",
apikey: "apikey",
});
}
96 changes: 0 additions & 96 deletions app/api/token/route.ts

This file was deleted.

10 changes: 1 addition & 9 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { Poppins as FontSans } from "next/font/google";
import { Footer } from "@/components/footer";
import Header from "@/components/Header";
import { Suspense } from "react";
import { headers } from "next/headers";
import Loading from "./loading";
import { isMobile } from "../lib/isMobile";
import { getNodeToken, NodesItem } from "../services/larkServices";

const fontSans = FontSans({
Expand All @@ -28,8 +26,6 @@ export default async function RootLayout({
children: React.ReactNode;
}>) {
const menu = await getMenu();
const userAgent = headers().get("user-agent") || "";
const isMobileDevice = isMobile(userAgent);
const nodes = await getNodeToken();
const appToken = nodes.items.find((ele: NodesItem) => {
return ele.title === "Configurations" && ele.obj_type === "bitable";
Expand All @@ -46,11 +42,7 @@ export default async function RootLayout({
)}
>
<AntdRegistry>
<Header
menu={menu}
isMobileDevice={isMobileDevice}
baseConfig={configObj}
/>
<Header menu={menu} baseConfig={configObj} />
<Suspense fallback={<Loading />}>{children}</Suspense>
<Footer baseConfig={configObj} />
</AntdRegistry>
Expand Down
11 changes: 5 additions & 6 deletions app/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
"use client";

import { Skeleton } from "@/components/ui/skeleton";
import { headers } from "next/headers";
import { isMobile } from "../lib/isMobile";
import { Desktop } from "../components/provider";

export default function Loading() {
const userAgent = headers().get("user-agent") || "";
const isMobileDevice = isMobile(userAgent);
return (
<div className="flex-1 px-4 sm:px-6 lg:px-8">
<div className="grid gap-8 py-8 min-h-[calc(100vh-225px)] grid-cols-[300px_1fr]">
{!isMobileDevice && (
<Desktop>
<div className="">
<nav className="space-y-4">
<Skeleton className="h-6 w-32" />
Expand All @@ -19,7 +18,7 @@ export default function Loading() {
<Skeleton className="h-6 w-32" />
</nav>
</div>
)}
</Desktop>
<div className="space-y-8 mt-[60px]">
<div>
<Skeleton className="h-8 w-64" />
Expand Down
24 changes: 0 additions & 24 deletions app/node/[id]/page.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Link from "next/link";

export default function NotFound() {
return (
<div className="flex items-center justify-center h-[calc(100vh-241px)] w-full bg-gray-100 mb-4">
Expand Down
31 changes: 0 additions & 31 deletions app/redirect/page.tsx

This file was deleted.

3 changes: 2 additions & 1 deletion app/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { SITE_URL } from "@/environment";
import { getChildNodes } from "@/services/get-child-nodes";
import { getPath } from "@/services/get-path";
import { getTopLevelNodes } from "@/services/get-top-level-nodes";
Expand All @@ -17,7 +18,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
if (nodes) {
for (const node of nodes) {
map.push({
url: `${process.env.SITE_URL}${await getPath(node.node_token)}`,
url: `https://${SITE_URL()}${await getPath(node.node_token)}`,
lastModified: new Date(Number(node.obj_edit_time) * 1000),
changeFrequency: "weekly",
priority: 0.5,
Expand Down
9 changes: 4 additions & 5 deletions app/wiki/[...id]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ import Sidebar from "@/components/sidebar/index";
import Breadcrumb from "@/components/Breadcrumb";
import { Suspense } from "react";
import Loading from "./loading";
import { headers } from "next/headers";
import { isMobile } from "../../../lib/isMobile";
import { Desktop } from "../../../components/provider";

export default async function WikiLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const menu = await getMenu();
const userAgent = headers().get("user-agent") || "";
const isMobileDevice = isMobile(userAgent);
return (
<main>
<div className="flex">
<div className="flex w-full">
{!isMobileDevice && <Sidebar menu={menu} />}
<Desktop>
<Sidebar menu={menu} />
</Desktop>
<div className="container pt-[60px] min-h-[calc(100vh-225px)] break-words">
<Breadcrumb menu={menu}></Breadcrumb>
<Suspense fallback={<Loading />}>{children}</Suspense>
Expand Down
Loading

0 comments on commit fe8fd90

Please sign in to comment.