diff --git a/public/locales/zh/dashboard.json b/public/locales/zh/dashboard.json
index da9d3a6d..90307b41 100644
--- a/public/locales/zh/dashboard.json
+++ b/public/locales/zh/dashboard.json
@@ -35,8 +35,9 @@
"Import markdown file with front matter supported": "导入 Markdown 文件(支持 Front Matter)",
"View Site": "查看站点",
"hello" : {
- "welcome" : "
@@ -162,7 +178,7 @@ export function DashboardLayout({
className={cn(
`flex px-4 h-12 items-center rounded-md space-x-2 w-full transition-colors`,
active
- ? `bg-slate-200 font-medium text-slate-800`
+ ? `bg-slate-200 font-medium text-accent`
: `hover:bg-slate-200 hover:bg-opacity-50`,
!isOpen && "justify-center",
)}
diff --git a/src/components/dashboard/DashboardMain.tsx b/src/components/dashboard/DashboardMain.tsx
index 0d7d6a89..b809cda0 100644
--- a/src/components/dashboard/DashboardMain.tsx
+++ b/src/components/dashboard/DashboardMain.tsx
@@ -1,9 +1,13 @@
import { cn } from "~/lib/utils"
+import { useTranslation } from "next-i18next"
export const DashboardMain: React.FC<{
children: React.ReactNode
fullWidth?: boolean
-}> = ({ children, fullWidth }) => {
+ title?: string
+}> = ({ children, fullWidth, title }) => {
+ const { t } = useTranslation("dashboard")
+
return (
+ {title &&
{t(title)}
}
{children}
diff --git a/src/pages/dashboard/[subdomain]/index.tsx b/src/pages/dashboard/[subdomain]/index.tsx
index 22d1d634..536d5e36 100644
--- a/src/pages/dashboard/[subdomain]/index.tsx
+++ b/src/pages/dashboard/[subdomain]/index.tsx
@@ -2,7 +2,7 @@ import { useRouter } from "next/router"
import { DashboardLayout } from "~/components/dashboard/DashboardLayout"
import { DashboardMain } from "~/components/dashboard/DashboardMain"
import { UniLink } from "~/components/ui/UniLink"
-import Image from "next/image"
+import { Image } from "~/components/ui/Image"
import { DISCORD_LINK, TWITTER_LINK, GITHUB_LINK, APP_NAME } from "~/lib/env"
import { getSiteLink } from "~/lib/helpers"
import type { ReactElement } from "react"
@@ -12,7 +12,14 @@ import { useTranslation, Trans } from "next-i18next"
import { getServerSideProps as getLayoutServerSideProps } from "~/components/dashboard/DashboardLayout.server"
import { GetServerSideProps } from "next"
import { serverSidePropsHandler } from "~/lib/server-side-props"
-import { Logo } from "~/components/common/Logo"
+import { getStorage, setStorage } from "~/lib/storage"
+import { useState } from "react"
+import { ChevronDownIcon } from "@heroicons/react/20/solid"
+import { cn } from "~/lib/utils"
+import { useGetPagesBySite } from "~/queries/page"
+import showcase from "../../../../showcase.json"
+import { useGetSites } from "~/queries/site"
+import { CharacterFloatCard } from "~/components/common/CharacterFloatCard"
export const getServerSideProps: GetServerSideProps = serverSidePropsHandler(
async (ctx) => {
@@ -62,103 +69,172 @@ export default function SubdomainIndex() {
},
]
+ const pages = useGetPagesBySite({
+ type: "post",
+ site: "xlog",
+ take: 4,
+ })
+
+ const showcaseSites = useGetSites(showcase)
+
return (
-
-
-
-
+
+
+
+
+ {statMap.map((item) => (
+
+ {t(item.name)}
+
+ {item.value}
+
+
+ ))}
+
+
+
,
+ }}
+ ns="dashboard"
+ />
+
+ -
+
+ Create a Post
+
+
+ -
+
+ Change Site Name or Icon
+
+
+
+
,
+ }}
+ ns="dashboard"
+ />
+
+ -
+
+ Join {APP_NAME}
+ {`'`}s Discord channel
+
+
+ -
+
+ Follow {APP_NAME}
+ {`'`}s xLog
+
+
+ -
+
+ Participate in the development of xLog
+
+
+ -
+
+ Follow {APP_NAME}
+ {`'`}s Twitter
+
+
+
+
+
-
{t("Site Stats")}
-
- {statMap.map((item) => (
-
+
+
- {t(item.name)}
-
- {item.value}
-
+
+ {t("More")}
+
+
+
+ {t("xLog News")}
+
+
+ {pages.data?.pages[0]?.list.map((item) => (
+
+ {item.cover && (
+
+
+
+ )}
+
+ {item.title}
+
+
+ ))}
- ))}
+
+
+
+ {t("Meet New Friends")}
+
+
+ {showcaseSites.data.slice(0, 6)?.map((site: any) => (
+ -
+
+
+
+
+
+
+
+
+ {site.metadata.content?.name}
+
+ {site.metadata.content?.bio && (
+
+ {site.metadata.content?.bio}
+
+ )}
+
+
+
+ ))}
+
+
-
,
- }}
- ns="dashboard"
- />
-
- -
-
- Create a Post
-
-
- -
-
- Change Site Name or Icon
-
-
- -
- Subscribe the{" "}
-
- posts feed
- {" "}
- and{" "}
-
- notifications feed
- {" "}
- via RSS Reader
-
-
-
,
- }}
- ns="dashboard"
- />
-
- -
-
- Join {APP_NAME}
- {`'`}s Discord channel
-
-
- -
-
- Follow {APP_NAME}
- {`'`}s xLog
-
-
- -
-
- View {APP_NAME}
- {`'`}s source code or participate in its development
-
-
- -
-
- Follow {APP_NAME}
- {`'`}s Twitter
-
-
-
)