Skip to content

Commit 6c60675

Browse files
authored
improvement(signup): modify signup and login pages to not show social sign in when not configured, increase logo size (#1103)
1 parent e13adab commit 6c60675

File tree

4 files changed

+21
-60
lines changed

4 files changed

+21
-60
lines changed

apps/sim/app/(auth)/components/social-login-buttons.tsx

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { useEffect, useState } from 'react'
44
import { GithubIcon, GoogleIcon } from '@/components/icons'
55
import { Button } from '@/components/ui/button'
6-
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
76
import { client } from '@/lib/auth-client'
87

98
interface SocialLoginButtonsProps {
@@ -114,58 +113,16 @@ export function SocialLoginButtons({
114113
</Button>
115114
)
116115

117-
const renderGithubButton = () => {
118-
if (githubAvailable) return githubButton
119-
120-
return (
121-
<TooltipProvider>
122-
<Tooltip>
123-
<TooltipTrigger asChild>
124-
<div>{githubButton}</div>
125-
</TooltipTrigger>
126-
<TooltipContent className='border-neutral-700 bg-neutral-800 text-white'>
127-
<p>
128-
GitHub login requires OAuth credentials to be configured. Add the following
129-
environment variables:
130-
</p>
131-
<ul className='mt-2 space-y-1 text-neutral-300 text-xs'>
132-
<li>• GITHUB_CLIENT_ID</li>
133-
<li>• GITHUB_CLIENT_SECRET</li>
134-
</ul>
135-
</TooltipContent>
136-
</Tooltip>
137-
</TooltipProvider>
138-
)
139-
}
116+
const hasAnyOAuthProvider = githubAvailable || googleAvailable
140117

141-
const renderGoogleButton = () => {
142-
if (googleAvailable) return googleButton
143-
144-
return (
145-
<TooltipProvider>
146-
<Tooltip>
147-
<TooltipTrigger asChild>
148-
<div>{googleButton}</div>
149-
</TooltipTrigger>
150-
<TooltipContent className='border-neutral-700 bg-neutral-800 text-white'>
151-
<p>
152-
Google login requires OAuth credentials to be configured. Add the following
153-
environment variables:
154-
</p>
155-
<ul className='mt-2 space-y-1 text-neutral-300 text-xs'>
156-
<li>• GOOGLE_CLIENT_ID</li>
157-
<li>• GOOGLE_CLIENT_SECRET</li>
158-
</ul>
159-
</TooltipContent>
160-
</Tooltip>
161-
</TooltipProvider>
162-
)
118+
if (!hasAnyOAuthProvider) {
119+
return null
163120
}
164121

165122
return (
166123
<div className='grid gap-3'>
167-
{renderGithubButton()}
168-
{renderGoogleButton()}
124+
{githubAvailable && githubButton}
125+
{googleAvailable && googleButton}
169126
</div>
170127
)
171128
}

apps/sim/app/(auth)/layout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ export default function AuthLayout({ children }: { children: React.ReactNode })
2828
<img
2929
src={brand.logoUrl}
3030
alt={`${brand.name} Logo`}
31-
width={42}
32-
height={42}
33-
className='h-[42px] w-[42px] object-contain'
31+
width={56}
32+
height={56}
33+
className='h-[56px] w-[56px] object-contain'
3434
/>
3535
) : (
36-
<Image src='/sim.svg' alt={`${brand.name} Logo`} width={42} height={42} />
36+
<Image src='/sim.svg' alt={`${brand.name} Logo`} width={56} height={56} />
3737
)}
3838
</Link>
3939
</div>

apps/sim/app/(auth)/login/login-form.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,13 @@ export default function LoginPage({
366366
callbackURL={callbackUrl}
367367
/>
368368

369-
<div className='relative mt-2 py-4'>
370-
<div className='absolute inset-0 flex items-center'>
371-
<div className='w-full border-neutral-700/50 border-t' />
369+
{(githubAvailable || googleAvailable) && (
370+
<div className='relative mt-2 py-4'>
371+
<div className='absolute inset-0 flex items-center'>
372+
<div className='w-full border-neutral-700/50 border-t' />
373+
</div>
372374
</div>
373-
</div>
375+
)}
374376

375377
<form onSubmit={onSubmit} className='space-y-5'>
376378
<div className='space-y-4'>

apps/sim/app/(auth)/signup/signup-form.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,13 @@ function SignupFormContent({
381381
isProduction={isProduction}
382382
/>
383383

384-
<div className='relative mt-2 py-4'>
385-
<div className='absolute inset-0 flex items-center'>
386-
<div className='w-full border-neutral-700/50 border-t' />
384+
{(githubAvailable || googleAvailable) && (
385+
<div className='relative mt-2 py-4'>
386+
<div className='absolute inset-0 flex items-center'>
387+
<div className='w-full border-neutral-700/50 border-t' />
388+
</div>
387389
</div>
388-
</div>
390+
)}
389391

390392
<form onSubmit={onSubmit} className='space-y-5'>
391393
<div className='space-y-4'>

0 commit comments

Comments
 (0)