Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you inject custom header and footer elements ? #53

Open
mdrokz opened this issue Apr 11, 2024 · 0 comments
Open

How do you inject custom header and footer elements ? #53

mdrokz opened this issue Apr 11, 2024 · 0 comments

Comments

@mdrokz
Copy link

mdrokz commented Apr 11, 2024

Hi, i want to customize the sign in and sign up component to change the header and footer text i dont see any way to do this in the docs is it possible to do it ? currently im doing this by using an set interval like this

<script lang="ts">
	import SignUp from 'clerk-sveltekit/client/SignUp.svelte';

	let clerkFooter: Element | null = null;

	const interval = setInterval(() => {
		let c = document.querySelector('span[data-localization-key="signUp.start.actionText"]');
		if (c) {
			console.log(c);
			clerkFooter = c;
		}
	}, 500);

	$: {
		if (clerkFooter) {
			clerkFooter.innerHTML = `
					<span class="clerk_footer_link">By clicking continue, you agree to our <a class="text-underline" href="">Terms of Service</a> and <a href="">Privacy Policy</a></span>
				`;
			// clerkFooter.
			clearInterval(interval);
		}
	}
</script>

<div class="flex min-h-screen items-center w-3/5 justify-center">
	<!-- <button class=" border border-border" on:click={login}> sign in with Google </button> -->
	<SignUp
		appearance={{
			layout: {
				socialButtonsPlacement: 'bottom'
			},
			elements: {
				formButtonPrimary: {
					backgroundColor: '#16A34A',
					'&:hover': {
						backgroundColor: '#22c55e'
					}
				},
				footer: {
					display: 'flex',
					justifyContent: 'center'
				},
				footerActionLink: {
					display: 'none'
				}
			}
		}}
		redirectUrl="/"
	/>
</div>

Any help would be appreciated thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant