-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Standardize betting validation, improve loading states, and add service tests #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6c90af0
Add loading states to Clerk auth pages and centralize appearance config
Isaiahriveraa 8d84073
Fix React dependency bug and remove non-existent field reference
Isaiahriveraa afdca63
Standardized betting validation to use gameDate and improved service …
Isaiahriveraa c5ba2cb
Simplified loading state cleanup on route changes
Isaiahriveraa 2087bbb
Optimized Tasks page rendering with memoized data
Isaiahriveraa cd8574f
Update src/components/experimental/ui/HuskyBidsLoader.jsx
Isaiahriveraa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,91 +1,65 @@ | ||
| 'use client'; | ||
|
|
||
| import { SignIn } from '@clerk/nextjs'; | ||
| import { SignIn, ClerkLoading, ClerkLoaded } from '@clerk/nextjs'; | ||
| import { useSearchParams } from 'next/navigation'; | ||
| import Link from 'next/link'; | ||
| import { Suspense } from 'react'; | ||
| import { HuskyBidsLoader } from '@/components/experimental'; | ||
| import { minimalClerkAppearance } from '@/shared/utils/clerk-appearance'; | ||
|
|
||
| /** | ||
| * Login Page Content | ||
| * Extracted to allow Suspense wrapping | ||
| */ | ||
| function LoginContent() { | ||
| const searchParams = useSearchParams(); | ||
| const redirectUrl = searchParams.get('redirect') || '/dashboard'; | ||
| function LoginContent() { | ||
| const searchParams = useSearchParams(); | ||
| const redirectUrl = searchParams.get('redirect') || '/dashboard'; | ||
|
|
||
| return ( | ||
| <div className="w-full max-w-md space-y-8"> | ||
| {/* Minimal header */} | ||
| <header className="text-center mb-8"> | ||
| <h1 className="text-sm tracking-[0.3em] uppercase text-zinc-400 mb-2"> | ||
| HuskyBids | ||
| </h1> | ||
| <p className="text-xs text-zinc-600"> | ||
| Log in to your account | ||
| </p> | ||
| </header> | ||
| return ( | ||
| <div className="w-full max-w-md space-y-8"> | ||
| <ClerkLoading> | ||
| <HuskyBidsLoader | ||
| centered | ||
| subtitle="Loading your account..." | ||
| /> | ||
| </ClerkLoading> | ||
|
|
||
| {/* Clerk SignIn Component with minimal styling */} | ||
| <div> | ||
| <SignIn | ||
| appearance={{ | ||
| variables: { | ||
| colorPrimary: '#71717a', | ||
| colorText: '#d4d4d8', | ||
| colorTextSecondary: '#71717a', | ||
| colorBackground: '#18181b', | ||
| colorInputBackground: '#27272a', | ||
| colorInputText: '#d4d4d8', | ||
| fontFamily: 'ui-monospace, monospace', | ||
| fontSize: '14px', | ||
| borderRadius: '0px', | ||
| }, | ||
| elements: { | ||
| rootBox: 'mx-auto', | ||
| card: 'bg-zinc-900 border border-dotted border-zinc-800 shadow-none', | ||
| headerTitle: 'text-zinc-300 text-sm font-mono', | ||
| headerSubtitle: 'text-zinc-600 text-xs font-mono', | ||
| formFieldInput: 'bg-zinc-800 border border-dotted border-zinc-700 text-zinc-300 font-mono text-sm focus:border-zinc-500 rounded-none', | ||
| formFieldLabel: 'text-zinc-500 text-xs font-mono uppercase tracking-wider', | ||
| formButtonPrimary: 'bg-zinc-800 hover:bg-zinc-700 text-zinc-300 border border-dotted border-zinc-700 font-mono text-sm shadow-none rounded-none', | ||
| footerActionLink: 'text-zinc-500 hover:text-zinc-400 font-mono text-xs', | ||
| socialButtonsBlockButton: 'border border-dotted border-zinc-700 bg-zinc-800 hover:bg-zinc-700 text-zinc-400 font-mono text-sm rounded-none shadow-none', | ||
| dividerLine: 'bg-zinc-800', | ||
| dividerText: 'text-zinc-600 font-mono text-xs', | ||
| }, | ||
| layout: { | ||
| socialButtonsPlacement: 'bottom', | ||
| socialButtonsVariant: 'iconButton', | ||
| } | ||
| }} | ||
| path="/login" | ||
| afterSignInUrl={redirectUrl} | ||
| signUpUrl="/sign-up" | ||
| /> | ||
| </div> | ||
| <ClerkLoaded> | ||
| {/* Header */} | ||
| <header className="text-center mb-8"> | ||
| <h1 className="text-sm tracking-[0.3em] uppercase text-zinc-400 mb-2"> | ||
| HuskyBids | ||
| </h1> | ||
| <p className="text-xs text-zinc-600"> | ||
| Log in to your account | ||
| </p> | ||
| </header> | ||
|
|
||
| {/* Clerk SignIn Component */} | ||
| <div> | ||
| <SignIn | ||
| appearance={minimalClerkAppearance} | ||
| path="/login" | ||
| afterSignInUrl={redirectUrl} | ||
| signUpUrl="/sign-up" | ||
| /> | ||
| </div> | ||
|
|
||
| {/* Footer link */} | ||
| <p className="text-center text-xs text-zinc-600 font-mono mt-6"> | ||
| No account?{' '} | ||
| <Link href="/sign-up" className="text-zinc-500 hover:text-zinc-400 underline"> | ||
| Sign up | ||
| </Link> | ||
| </p> | ||
| </div> | ||
| ); | ||
| } | ||
| {/* Footer link */} | ||
| <p className="text-center text-xs text-zinc-600 font-mono mt-6"> | ||
| No account?{' '} | ||
| <Link href="/sign-up" className="text-zinc-500 hover:text-zinc-400 underline"> | ||
| Sign up | ||
| </Link> | ||
| </p> | ||
|
|
||
| /** | ||
| * Login Page | ||
| * Uses Clerk's pre-built SignIn component for authentication | ||
| * Clerk handles redirects natively via afterSignInUrl | ||
| */ | ||
| export default function LoginPage() { | ||
| return ( | ||
| <div className="min-h-screen bg-zinc-950 flex items-center justify-center px-4 py-12 font-mono"> | ||
| <Suspense fallback={<div className="text-zinc-500 text-sm">Loading...</div>}> | ||
| <LoginContent /> | ||
| </Suspense> | ||
| </div> | ||
| ); | ||
| } | ||
| </ClerkLoaded> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default function LoginPage() { | ||
| return ( | ||
| <div className="min-h-screen bg-zinc-950 flex items-center justify-center px-4 py-12 font-mono"> | ||
| <Suspense fallback={<div className="text-zinc-500 text-sm">Loading...</div>}> | ||
| <LoginContent /> | ||
| </Suspense> | ||
| </div> | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation detected. The
LoginContentfunction has an extra indentation level (2 spaces) compared to the rest of the file. The function declaration should start at column 0 like theexport default function LoginPage()below it. This appears to be a formatting error introduced during refactoring.