Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions apps/sim/app/(auth)/components/auth-button-classes.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/sim/app/(auth)/components/auth-text-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ interface AuthTextLinkProps {
/**
* The canonical inline text affordance for the auth pages — forgot-password,
* resend, and the legal links. Renders a {@link Link} when `href` is set and a
* `<button>` otherwise, both in one light-token style. Replaces the legacy dark
* `AUTH_TEXT_LINK` class string with a single props-driven source of truth.
* `<button>` otherwise, both using the shared neutral text tokens.
*/
export function AuthTextLink({
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { cn, Input, InputOTP, InputOTPGroup, InputOTPSlot, Label } from '@sim/em
import { createLogger } from '@sim/logger'
import { toError } from '@sim/utils/errors'
import { quickValidateEmail } from '@/lib/messaging/email/validation'
import { AuthSubmitButton } from '@/app/(auth)/components'
import { AUTH_TEXT_LINK } from '@/app/(auth)/components/auth-button-classes'
import { AuthSubmitButton, AuthTextLink } from '@/app/(auth)/components'
import { useChatEmailOtpRequest, useChatEmailOtpVerify } from '@/hooks/queries/chats'

const logger = createLogger('EmailAuth')
Expand Down Expand Up @@ -220,28 +219,26 @@ export default function EmailAuth({ identifier }: EmailAuthProps) {
Resend in <span className='text-[var(--text-primary)]'>{countdown}s</span>
</span>
) : (
<button
className={AUTH_TEXT_LINK}
<AuthTextLink
onClick={handleResendOtp}
disabled={verifyOtp.isPending || requestOtp.isPending}
>
Resend
</button>
</AuthTextLink>
)}
</p>
</div>

<div className='text-center font-light text-sm'>
<button
<AuthTextLink
onClick={() => {
setShowOtpVerification(false)
setOtpValue('')
setAuthError(null)
}}
className={AUTH_TEXT_LINK}
>
Change email
</button>
</AuthTextLink>
</div>
</div>
)}
Expand Down
16 changes: 5 additions & 11 deletions apps/sim/app/f/[token]/public-file-email-auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { getErrorMessage } from '@sim/utils/errors'
import { normalizeEmail } from '@sim/utils/string'
import { useRouter } from 'next/navigation'
import { quickValidateEmail } from '@/lib/messaging/email/validation'
import { AuthSubmitButton } from '@/app/(auth)/components'
import { AUTH_TEXT_LINK } from '@/app/(auth)/components/auth-button-classes'
import { AuthSubmitButton, AuthTextLink } from '@/app/(auth)/components'
import { PublicFileAuthShell } from '@/app/f/[token]/public-file-auth-shell'
import { usePublicFileOtpRequest, usePublicFileOtpVerify } from '@/hooks/queries/public-shares'

Expand Down Expand Up @@ -176,28 +175,23 @@ export function PublicFileEmailAuth({ token }: PublicFileEmailAuthProps) {
Resend in <span className='text-[var(--text-primary)]'>{countdown}s</span>
</span>
) : (
<button
className={AUTH_TEXT_LINK}
onClick={resend}
disabled={requestOtp.isPending || verifyOtp.isPending}
>
<AuthTextLink onClick={resend} disabled={requestOtp.isPending || verifyOtp.isPending}>
Resend
</button>
</AuthTextLink>
)}
</p>
</div>

<div className='text-center font-light text-sm'>
<button
<AuthTextLink
onClick={() => {
setSent(false)
setOtp('')
setError(null)
}}
className={AUTH_TEXT_LINK}
>
Change email
</button>
</AuthTextLink>
</div>
</div>
</PublicFileAuthShell>
Expand Down
Loading