diff --git a/src/app/submit/page.tsx b/src/app/submit/page.tsx index 45bcf7a..f8b414c 100644 --- a/src/app/submit/page.tsx +++ b/src/app/submit/page.tsx @@ -5,15 +5,43 @@ import SubmitAuthOverlay from "@/components/Submit/SubmitAuthOverlay"; export default async function SubmitPage() { const supabase = await createClient(); const { data: { user } } = await supabase.auth.getUser(); + let needsInitialSetup = false; + if (user) { + const { data: profile } = await supabase + .from('profiles') + .select('username') + .eq('id', user.id) + .maybeSingle(); + needsInitialSetup = !profile || profile.username == null; + } return (

Submit your ROM hack

Share your hack so others can discover and play it.

- +
- {!user && } + {!user ? ( + + ) : ( + needsInitialSetup ? ( + + ) : null + )}
); } diff --git a/src/components/Submit/SubmitAuthOverlay.tsx b/src/components/Submit/SubmitAuthOverlay.tsx index e555292..7627997 100644 --- a/src/components/Submit/SubmitAuthOverlay.tsx +++ b/src/components/Submit/SubmitAuthOverlay.tsx @@ -3,7 +3,25 @@ import React, { useEffect } from 'react' import Link from 'next/link' -const SubmitAuthOverlay: React.FC = () => { +type SubmitAuthOverlayProps = { + title: string; + message: string; + primaryHref?: string; + primaryLabel?: string; + secondaryHref?: string; + secondaryLabel?: string; + ariaLabel?: string; +} + +const SubmitAuthOverlay: React.FC = ({ + title, + message, + primaryHref, + primaryLabel, + secondaryHref, + secondaryLabel, + ariaLabel, +}) => { useEffect(() => { const html = document.documentElement; const body = document.body; @@ -31,29 +49,31 @@ const SubmitAuthOverlay: React.FC = () => {
-
Creators only
-

- You need an account to submit new romhacks for others to play. It only takes a minute. -

+
{title}
+

{message}

- - Create account - - - Log in - + {primaryHref && primaryLabel && ( + + {primaryLabel} + + )} + {secondaryHref && secondaryLabel && ( + + {secondaryLabel} + + )}