diff --git a/frontend-react/src/App.tsx b/frontend-react/src/App.tsx index d04c1d0..99ec712 100644 --- a/frontend-react/src/App.tsx +++ b/frontend-react/src/App.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useState, useRef } from "react"; import { usePetition } from "@/hooks/usePetition"; import { useLanguage } from "@/hooks/useLanguage"; import { submitSignature } from "@/lib/api"; @@ -10,6 +10,7 @@ import { AuthorCard } from "@/components/petition/AuthorCard"; import { PetitionBody } from "@/components/petition/PetitionBody"; import { SignatureForm } from "@/components/signature/SignatureForm"; import { TweetModal } from "@/components/TweetModal"; +import { PenLine } from "lucide-react"; function getPetitionIdFromUrl(): string | null { const urlParams = new URLSearchParams(window.location.search); @@ -23,6 +24,11 @@ function App() { const { petition, loading, error, refetch } = usePetition(petitionId); const { language, setLanguage } = useLanguage(); const [showTweetModal, setShowTweetModal] = useState(false); + const signatureFormRef = useRef(null); + + const scrollToSignForm = () => { + signatureFormRef.current?.scrollIntoView({ behavior: "smooth", block: "start" }); + }; const handleSubmit = async (data: { name: string; @@ -77,6 +83,14 @@ function App() { + + - +
+ +
-
+
+
+ + {!isExpanded && ( +
+ )} +
+ +
); } diff --git a/frontend-react/src/components/signature/SignatureForm.tsx b/frontend-react/src/components/signature/SignatureForm.tsx index 1c276d2..08b63e7 100644 --- a/frontend-react/src/components/signature/SignatureForm.tsx +++ b/frontend-react/src/components/signature/SignatureForm.tsx @@ -6,7 +6,7 @@ import { Checkbox } from "@/components/ui/checkbox"; import { Alert, AlertDescription } from "@/components/ui/alert"; import { SignaturePad, type SignaturePadRef } from "./SignaturePad"; import { Turnstile } from "@marsidev/react-turnstile"; -import { Eraser, Send, CheckCircle, AlertCircle } from "lucide-react"; +import { Eraser, Check, CheckCircle, AlertCircle } from "lucide-react"; import type { Language } from "@/types/petition"; interface SignatureFormProps { @@ -200,8 +200,18 @@ export function SignatureForm({ language, onSubmit }: SignatureFormProps) { -
+
+

{language === "en" @@ -243,38 +253,25 @@ export function SignatureForm({ language, onSubmit }: SignatureFormProps) { )} - {/* Turnstile */} -

+ {/* Turnstile and Submit */} +
setTurnstileToken(null)} onExpire={() => setTurnstileToken(null)} /> -
- - {/* Form Buttons */} -
-