Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

⚡️ perf: delete profiles slug page & settings page (#10316)

Shinji-Life352ff330b6
diff --git a/src/app/[variants]/(main)/profile/(home)/[[...slugs]]/page.tsx b/src/app/[variants]/(main)/profile/(home)/[[...slugs]]/page.tsx
deleted file mode 100644
index 9020cbc3095..00000000000
--- a/src/app/[variants]/(main)/profile/(home)/[[...slugs]]/page.tsx
+++ /dev/null
@@ -1,40 +0,0 @@
-import { Skeleton } from 'antd';
-import dynamic from 'next/dynamic';
-
-import { enableClerk } from '@/const/auth';
-import { metadataModule } from '@/server/metadata';
-import { translation } from '@/server/translation';
-import { DynamicLayoutProps } from '@/types/next';
-import { RouteVariants } from '@/utils/server/routeVariants';
-
-import Client from '../Client';
-
-// 为了兼容 ClerkProfile, 需要使用 [[...slug]]
-
-const ClerkProfile = dynamic(() => import('../../features/ClerkProfile'), {
- loading: () => (
- <div style={{ flex: 1 }}>
- <Skeleton paragraph={{ rows: 8 }} title={false} />
- </div>
- ),
-});
-
-export const generateMetadata = async (props: DynamicLayoutProps) => {
- const locale = await RouteVariants.getLocale(props);
- const { t } = await translation('auth', locale);
- return metadataModule.generate({
- description: t('header.desc'),
- title: t('tab.profile'),
- url: '/profile',
- });
-};
-
-const Page = async (props: DynamicLayoutProps) => {
- const mobile = await RouteVariants.getIsMobile(props);
-
- if (enableClerk) return <ClerkProfile mobile={mobile} />;
-
- return <Client mobile={mobile} />;
-};
-
-export default Page;
diff --git a/src/app/[variants]/(main)/settings/error.tsx b/src/app/[variants]/(main)/settings/error.tsx
deleted file mode 100644
index fe8c9f8224f..00000000000
--- a/src/app/[variants]/(main)/settings/error.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-'use client';
-
-export { default } from '@/components/Error';
diff --git a/src/app/[variants]/(main)/settings/loading.tsx b/src/app/[variants]/(main)/settings/loading.tsx
deleted file mode 100644
index 3ae0d871289..00000000000
--- a/src/app/[variants]/(main)/settings/loading.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-import Loading from '@/components/Loading/BrandTextLoading';
-
-export default () => <Loading />;
diff --git a/src/app/[variants]/(main)/settings/not-found.tsx b/src/app/[variants]/(main)/settings/not-found.tsx
deleted file mode 100644
index 49edd856a42..00000000000
--- a/src/app/[variants]/(main)/settings/not-found.tsx
+++ /dev/null
@@ -1 +0,0 @@
-export { default } from '@/components/404';
diff --git a/src/app/[variants]/(main)/settings/page.tsx b/src/app/[variants]/(main)/settings/page.tsx
deleted file mode 100644
index f0f332f1826..00000000000
--- a/src/app/[variants]/(main)/settings/page.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import ServerLayout from '@/components/server/ServerLayout';
-import { serverFeatureFlags } from '@/config/featureFlags';
-import { metadataModule } from '@/server/metadata';
-import { translation } from '@/server/translation';
-import { DynamicLayoutProps } from '@/types/next';
-import { RouteVariants } from '@/utils/server/routeVariants';
-
-import SettingsContextProvider from './_layout/ContextProvider';
-import Desktop from './_layout/Desktop';
-import Mobile from './_layout/Mobile';
-import { LayoutProps } from './_layout/type';
-
-export const generateMetadata = async (props: DynamicLayoutProps) => {
- const locale = await RouteVariants.getLocale(props);
- const { t } = await translation('setting', locale);
- return metadataModule.generate({
- description: t('header.desc'),
- title: t('header.title'),
- url: '/settings',
- });
-};
-
-const SettingsLayout = ServerLayout<LayoutProps>({ Desktop, Mobile });
-
-const SettingsPage = async (props: DynamicLayoutProps) => {
- const { showOpenAIProxyUrl, showOpenAIApiKey } = serverFeatureFlags();
-
- return (
- <SettingsContextProvider
- value={{
- showOpenAIApiKey: showOpenAIApiKey,
- showOpenAIProxyUrl: showOpenAIProxyUrl,
- }}
- >
- {/* @ts-ignore */}
- <SettingsLayout {...props} />
- </SettingsContextProvider>
- );
-};
-
-export default SettingsPage;