mirror of
https://github.com/MvDevsUnion/WPetition.git
synced 2026-07-31 03:34:56 +00:00
reset token and fix toggle button placement
This commit is contained in:
@@ -11,7 +11,11 @@ export function LanguageSwitcher({
|
|||||||
onLanguageChange,
|
onLanguageChange,
|
||||||
}: LanguageSwitcherProps) {
|
}: LanguageSwitcherProps) {
|
||||||
return (
|
return (
|
||||||
<div className="flex gap-1 justify-end mb-6">
|
<div
|
||||||
|
className={`flex gap-1 mb-6 ${
|
||||||
|
language === "en" ? "justify-end" : "justify-start"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
<div className="bg-slate-100 p-1 rounded-full inline-flex border border-slate-200">
|
<div className="bg-slate-100 p-1 rounded-full inline-flex border border-slate-200">
|
||||||
<Button
|
<Button
|
||||||
variant={language === "en" ? "default" : "ghost"}
|
variant={language === "en" ? "default" : "ghost"}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Label } from "@/components/ui/label";
|
|||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
import { Alert, AlertDescription } from "@/components/ui/alert";
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
||||||
import { SignaturePad, type SignaturePadRef } from "./SignaturePad";
|
import { SignaturePad, type SignaturePadRef } from "./SignaturePad";
|
||||||
import { Turnstile } from "@marsidev/react-turnstile";
|
import { Turnstile, type TurnstileInstance } from "@marsidev/react-turnstile";
|
||||||
import { Eraser, Check, CheckCircle, AlertCircle } from "lucide-react";
|
import { Eraser, Check, CheckCircle, AlertCircle } from "lucide-react";
|
||||||
import type { Language } from "@/types/petition";
|
import type { Language } from "@/types/petition";
|
||||||
|
|
||||||
@@ -31,6 +31,7 @@ export function SignatureForm({ language, onSubmit }: SignatureFormProps) {
|
|||||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||||
|
|
||||||
const signaturePadRef = useRef<SignaturePadRef>(null);
|
const signaturePadRef = useRef<SignaturePadRef>(null);
|
||||||
|
const turnstileRef = useRef<TurnstileInstance>(null);
|
||||||
const isRtl = language === "dv";
|
const isRtl = language === "dv";
|
||||||
|
|
||||||
const handleClear = () => {
|
const handleClear = () => {
|
||||||
@@ -126,6 +127,8 @@ export function SignatureForm({ language, onSubmit }: SignatureFormProps) {
|
|||||||
: "ސޮއި ހުށަހެޅުމުން ކުށެއް ދިމާވެއްޖެ.",
|
: "ސޮއި ހުށަހެޅުމުން ކުށެއް ދިމާވެއްޖެ.",
|
||||||
"error",
|
"error",
|
||||||
);
|
);
|
||||||
|
turnstileRef.current?.reset();
|
||||||
|
setTurnstileToken(null);
|
||||||
} finally {
|
} finally {
|
||||||
setIsSubmitting(false);
|
setIsSubmitting(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user