Merged in fix/SW-2679-tracking-signup-details-forms (pull request #2236)

feat(SW-2679): Added form tracking for checkout and signup

* feat(SW-2679): Added form tracking for checkout and signup

* fix(SW-2679): fixes from review


Approved-by: Michael Zetterberg
This commit is contained in:
Tobias Johansson
2025-06-10 06:35:13 +00:00
parent 3688d5ece8
commit ead822fa62
5 changed files with 199 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import Title from "@/components/TempDesignSystem/Text/Title"
import { toast } from "@/components/TempDesignSystem/Toasts"
import { useFormTracking } from "@/components/TrackingSDK/hooks"
import useLang from "@/hooks/useLang"
import { type SignUpSchema, signUpSchema } from "./schema"
@@ -99,6 +100,10 @@ export default function SignupForm({ title }: SignUpFormProps) {
shouldFocusError: true,
})
const { control, subscribe } = methods
useFormTracking("signup", subscribe, control)
async function onSubmit(data: SignUpSchema) {
signup.mutate({ ...data, language: lang })
}