From 171e8972805342bea8696eca9c91314e994329fb Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Thu, 2 Oct 2025 10:51:54 +0200 Subject: [PATCH] feat: create submit page with authentication flow - Add submit page with authentication check - Implement login modal integration for unauthenticated users - Create submission guidelines and requirements display - Add AdvancedIconSubmissionForm component integration - Handle loading states and user experience flow --- web/src/app/submit/page.tsx | 90 +++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 web/src/app/submit/page.tsx diff --git a/web/src/app/submit/page.tsx b/web/src/app/submit/page.tsx new file mode 100644 index 00000000..9895059a --- /dev/null +++ b/web/src/app/submit/page.tsx @@ -0,0 +1,90 @@ +"use client" + +import { useEffect, useState } from "react" +import { AdvancedIconSubmissionForm } from "@/components/advanced-icon-submission-form" +import { LoginModal } from "@/components/login-modal" +import { Button } from "@/components/ui/button" +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card" +import { pb } from "@/lib/pb" + +export default function SubmitPage() { + const [isAuthenticated, setIsAuthenticated] = useState(false) + const [isLoading, setIsLoading] = useState(true) + const [showLoginModal, setShowLoginModal] = useState(false) + + useEffect(() => { + const checkAuth = () => { + setIsAuthenticated(pb.authStore.isValid) + setIsLoading(false) + } + + checkAuth() + + // Subscribe to auth changes + pb.authStore.onChange(() => { + checkAuth() + }) + }, []) + + if (isLoading) { + return ( +
+
+

Loading...

+
+
+ ) + } + + if (!isAuthenticated) { + return ( + <> +
+
+ + + Submit an Icon + + Share your icons with the community and help expand our collection + + + +
+

Before you start

+
    +
  • You need to be logged in to submit icons
  • +
  • Icons should be in SVG, PNG, or WebP format
  • +
  • Maximum file size: 5MB per variant
  • +
  • All submissions are reviewed before being added to the collection
  • +
+
+ +
+ +
+
+
+
+
+ + {showLoginModal && setShowLoginModal(false)} />} + + ) + } + + return ( +
+
+

Submit an Icon

+

+ {isAuthenticated ? "Create a new icon or update an existing one" : "Sign in to submit icons"} +

+
+ + +
+ ) +} +