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

Add waitlist #10

Open
wants to merge 7 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .env.development
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
GENERATE_SOURCEMAP=false
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
NEXT_PUBLIC_YANDEX_METRICA_ID=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=
NEXT_PUBLIC_COIN_GECKO_API_KEY=
NEXT_PUBLIC_GOOGLE_FORM_ID=
NEXT_PUBLIC_ENVIRONMENT=
4 changes: 1 addition & 3 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
GENERATE_SOURCEMAP=false
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID=
NEXT_PUBLIC_YANDEX_METRICA_ID=
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_WEB3AUTH_CLIENT_ID=
NEXT_PUBLIC_COIN_GECKO_API_KEY=
NEXT_PUBLIC_GOOGLE_FORM_ID=
NEXT_PUBLIC_ENVIRONMENT=
38 changes: 12 additions & 26 deletions app/Providers.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
'use client'
import { ReactNode, useRef, useState } from 'react'
import { ReactNode, useRef } from 'react'
import { Provider } from 'react-redux'
import { AppStore, makeStore } from '@/store/store'
import { NEXT_PUBLIC_GOOGLE_ANALYTICS_ID, NEXT_PUBLIC_YANDEX_METRICA_ID } from '@/lib/config'
import ReactGA from "react-ga4";
import { type State, WagmiProvider } from 'wagmi'
import { getConfig } from '@/lib/web3Auth'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import WalletModal from '@/components/WalletModal'
import SwitchChainModal from '@/components/SwitchChainModal'
import { YMInitializer } from 'react-yandex-metrika'

type Props = {
children: ReactNode,
initialState: State | undefined,
}

export default function Providers({ children, initialState }: Props) {
export default function Providers({ children }: Props) {
const storeRef = useRef<AppStore>()
const queryClient = new QueryClient()
const [config] = useState(() => getConfig())

if (!storeRef.current) {
// Create the store instance the first time this renders
Expand All @@ -29,22 +21,16 @@ export default function Providers({ children, initialState }: Props) {

return (
<Provider store={storeRef.current}>
<WagmiProvider config={config} initialState={initialState}>
<QueryClientProvider client={queryClient}>
<YMInitializer
accounts={[parseInt(NEXT_PUBLIC_YANDEX_METRICA_ID)]}
options={{
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
}}
/>
<WalletModal />
<SwitchChainModal />
{children}
</QueryClientProvider>
</WagmiProvider>
<YMInitializer
accounts={[parseInt(NEXT_PUBLIC_YANDEX_METRICA_ID)]}
options={{
clickmap: true,
trackLinks: true,
accurateTrackBounce: true,
webvisor: true
}}
/>
{children}
</Provider>
)
}
27 changes: 27 additions & 0 deletions app/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use server'

import { NEXT_PUBLIC_GOOGLE_FORM_ID } from "@/lib/config"

export async function joinWaitlist(prevState: any, formData: FormData) {
const email = formData.get('email')
const data = new URLSearchParams()

if(email) {
data.append('entry.797678204', email.toString())
}

try {
await fetch(`https://docs.google.com/forms/d/e/${NEXT_PUBLIC_GOOGLE_FORM_ID}/formResponse`, {
method: 'POST',
body: data,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
})
prevState.type = 'success';
} catch (error) {
prevState.type = 'error';
}

return prevState;
}
12 changes: 0 additions & 12 deletions app/globals.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Chrome, Safari, Edge, Opera */
.public-sale-amount::-webkit-outer-spin-button,
.public-sale-amount::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}

/* Firefox */
.public-sale-amount[type=number] {
-moz-appearance: textfield;
}
10 changes: 1 addition & 9 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import type { Metadata } from "next";
import localFont from 'next/font/local'
import "./globals.css";
import Providers from "./Providers";
import { cookieToInitialState } from "wagmi";
import { headers } from "next/headers";
import { getConfig } from "@/lib/web3Auth";

const monaSans = localFont({
src: './MonaSans.woff2',
Expand All @@ -22,15 +19,10 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
const initialState = cookieToInitialState(
getConfig(),
headers().get('cookie')
)

return (
<html lang="en" className="scroll-smooth">
<body className={monaSans.variable}>
<Providers initialState={initialState}>
<Providers>
{children}
</Providers>
</body>
Expand Down
Loading