assets, move memories to proper location
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Component, createSignal } from 'solid-js';
|
||||
import { Component, createSignal, onMount } from 'solid-js';
|
||||
import { trackWaitlistSignup } from '../hooks/useAnalytics';
|
||||
|
||||
interface WaitlistFormProps {
|
||||
@@ -7,14 +7,29 @@ interface WaitlistFormProps {
|
||||
buttonText?: string;
|
||||
}
|
||||
|
||||
function getUtmParams() {
|
||||
if (typeof window === 'undefined') return {};
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
return {
|
||||
utmSource: params.get('utm_source') || undefined,
|
||||
utmMedium: params.get('utm_medium') || undefined,
|
||||
utmCampaign: params.get('utm_campaign') || undefined,
|
||||
};
|
||||
}
|
||||
|
||||
const WaitlistForm: Component<WaitlistFormProps> = (props) => {
|
||||
const [email, setEmail] = createSignal('');
|
||||
const [name, setName] = createSignal('');
|
||||
const [tier, setTier] = createSignal('basic');
|
||||
const [utm, setUtm] = createSignal<Record<string, string | undefined>>({});
|
||||
const [submitted, setSubmitted] = createSignal(false);
|
||||
const [loading, setLoading] = createSignal(false);
|
||||
const [error, setError] = createSignal('');
|
||||
|
||||
onMount(() => {
|
||||
setUtm(getUtmParams());
|
||||
});
|
||||
|
||||
const variant = props.variant || 'hero';
|
||||
|
||||
const handleSubmit = async (e: Event) => {
|
||||
@@ -36,6 +51,7 @@ const WaitlistForm: Component<WaitlistFormProps> = (props) => {
|
||||
email: email(),
|
||||
name: name() || undefined,
|
||||
tier: tier() !== 'basic' ? tier() : undefined,
|
||||
...utm(),
|
||||
}),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user