diff --git a/apps/landing/src/components/Bubbles.tsx b/apps/landing/src/components/Bubbles.tsx index 1e6ff5030..0ecd0c9cf 100644 --- a/apps/landing/src/components/Bubbles.tsx +++ b/apps/landing/src/components/Bubbles.tsx @@ -4,12 +4,12 @@ import { loadFull } from 'tsparticles'; export const Bubbles = () => { const particlesInit = async (main: any) => { - console.log(main); + // console.log(main); await loadFull(main); }; const particlesLoaded = (container: any) => { - console.log(container); + // console.log(container); }; return ( diff --git a/apps/landing/src/pages/index.tsx b/apps/landing/src/pages/index.tsx index de26c2974..77db7d322 100644 --- a/apps/landing/src/pages/index.tsx +++ b/apps/landing/src/pages/index.tsx @@ -1,15 +1,11 @@ -import { Apple, Github, Linux, Windows } from '@icons-pack/react-simple-icons'; -import { Button, Input } from '@sd/ui'; import clsx from 'clsx'; -import React, { useEffect } from 'react'; -import { useState } from 'react'; +import React, { useEffect, useState } from 'react'; +import { useSearchParams } from 'react-router-dom'; +import { Info } from '../../../../packages/interface/src/components/icons/Info'; import AppEmbed from '../components/AppEmbed'; import { Bubbles } from '../components/Bubbles'; -import { Footer } from '../components/Footer'; import HomeCTA from '../components/HomeCTA'; -import NavBar from '../components/NavBar'; -import NewBanner from '../components/NewBanner'; interface SectionProps { orientation: 'left' | 'right'; @@ -44,6 +40,29 @@ function Section(props: SectionProps = { orientation: 'left' }) { } function Page() { + const [searchParams, setSearchParams] = useSearchParams(); + const [unsubscribedFromWaitlist, setUnsubscribedFromWaitlist] = useState(false); + + useEffect(() => { + if (!window) return; + + const cuid = searchParams.get('wunsub'); + if (!cuid) return; + + (async () => { + const req = await fetch(`https://waitlist-api.spacedrive.com/api/waitlist?i=${cuid}`, { + method: 'DELETE' + }); + + if (req.status === 200) { + setUnsubscribedFromWaitlist(true); + window.history.replaceState({}, '', 'https://spacedrive.com/'); + } else if (req.status >= 400 && req.status < 500) { + alert('An error occurred while unsubscribing from waitlist'); + } + })(); + }, []); + return ( <>
@@ -53,6 +72,17 @@ function Page() { href="https://spacedrive.hashnode.dev/spacedrive-funding-announcement" link="Read post" /> */} + {unsubscribedFromWaitlist && ( +You have been unsubscribed from the waitlist
+