diff --git a/src/client/routes/login.tsx b/src/client/routes/login.tsx index a616812..e0c17c6 100644 --- a/src/client/routes/login.tsx +++ b/src/client/routes/login.tsx @@ -9,6 +9,7 @@ import { Input } from '@/components/ui/input'; import { useAuth } from '@/api/authjs/useAuth'; import { useEventWithLoading } from '@/hooks/useEvent'; import { LuGithub, LuLayers } from 'react-icons/lu'; +import { compact } from 'lodash-es'; export const Route = createFileRoute('/login')({ validateSearch: z.object({ @@ -44,6 +45,27 @@ function LoginComponent() { }); const { allowRegister, authProvider } = useGlobalConfig(); + const authProviderEl = compact([ + authProvider.includes('github') && ( + + ), + authProvider.includes('custom') && ( + + ), + ]); + return (
@@ -98,31 +120,11 @@ function LoginComponent() { )} - {authProvider.length > 0 && ( + {authProviderEl.length > 0 && ( <> {t('Or')} -
- {authProvider.includes('github') && ( - - )} - - {authProvider.includes('custom') && ( - - )} -
+
{authProviderEl}
)}