diff --git a/frontend/src/components/dashboard/Main.tsx b/frontend/src/components/dashboard/Main.tsx index e39e37b..116ccf3 100644 --- a/frontend/src/components/dashboard/Main.tsx +++ b/frontend/src/components/dashboard/Main.tsx @@ -16,6 +16,9 @@ import { Avatar, Card, CardBody, Button, Divider } from "@nextui-org/react"; import { RechargeModal } from "@/shared/components/modal/RechargeModal"; import { useTranslation } from "@/shared/lib/useTranslation"; import { ChangePasswordModal } from "@/components/common/ChangePasswordModal"; +import { usePlatformConfig } from "@/shared/contexts/PlatformConfigContext"; +import { RegisterType } from "@/shared/store/User"; +import { EmailMode } from "@/shared/types/system"; const DashboardContent: React.FC = () => { const { t } = useTranslation(); @@ -26,6 +29,7 @@ const DashboardContent: React.FC = () => { state.user_token, state.user, ]); + const { loginConfig } = usePlatformConfig(); const [logOut, useGetUser] = useGlobalStore((state) => [ state.logOut, @@ -113,15 +117,19 @@ const DashboardContent: React.FC = () => { onLogout={handleLogout} sidebarItems={sidebarItems} bottomPanel={ - + loginConfig?.email?.is_enabled && + loginConfig?.email?.mode === EmailMode.PASSWORD && + user?.register_type === RegisterType.EMAIL && ( + + ) } userProfilePanel={ user && ( diff --git a/frontend/src/components/system-setting/PlatformConfigForm.tsx b/frontend/src/components/system-setting/PlatformConfigForm.tsx index 51e7336..b87c429 100644 --- a/frontend/src/components/system-setting/PlatformConfigForm.tsx +++ b/frontend/src/components/system-setting/PlatformConfigForm.tsx @@ -95,7 +95,7 @@ export const PlatformConfigForm: React.FC = ({ {t("Platform Information")}

- {t("Configure platform logo, name, titles, and language")} + {t("Configure platform logo, name, titles, language")}

} diff --git a/frontend/src/shared/store/User.ts b/frontend/src/shared/store/User.ts index 6381dbd..b8d7435 100644 --- a/frontend/src/shared/store/User.ts +++ b/frontend/src/shared/store/User.ts @@ -4,6 +4,11 @@ interface APIKey { create_time: number; apikey_id: string; } +export enum RegisterType { + EMAIL = "email", + GOOGLE = "google", + INNER = "inner", +} export interface User { user_id: string; user_email: string; @@ -26,4 +31,5 @@ export interface User { wallet?: { balance: number; }; + register_type: RegisterType; }