Skip to content

Commit

Permalink
added upgrade waitlist form
Browse files Browse the repository at this point in the history
  • Loading branch information
ambujraj committed Feb 27, 2024
1 parent 72e313c commit fe42ba0
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
11 changes: 0 additions & 11 deletions ui/src/app/(pages)/features/page.tsx

This file was deleted.

55 changes: 55 additions & 0 deletions ui/src/app/(pages)/upgrade/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
'use client'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import React, { useState } from 'react'
import { toast } from 'sonner'

function UpgradePage() {
const [email, setEmail] = useState('')

const handleSubscribe = async (e) => {
e.preventDefault()
const apiBaseURL = process.env.NEXT_PUBLIC_API_BASE_URL

const subscribeJSON = {
email: email,
}

await fetch(apiBaseURL + '/subscribe', {
method: 'POST',
body: JSON.stringify(subscribeJSON),
headers: {
'Content-Type': 'application/json',
},
})

toast.success('You have been subscribed!')
}

return (
<>
<form onSubmit={handleSubscribe}>
<div className="bg-black flex h-screen justify-center items-center z-10">
<div className="bg-transparent p-8 rounded-md shadow-md max-w-sm">
<h4 className="text-2xl font-semibold mb-4 text-white">
Subscribe to Waitinglist and get{' '}
<span className="text-yellow-500">20% off</span> on launch
</h4>
<div className="flex w-full max-w-sm items-center space-x-2">
<Input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
placeholder="Email"
className="bg-white"
/>
<Button type="submit">Subscribe</Button>
</div>
</div>
</div>
</form>
</>
)
}

export default UpgradePage
2 changes: 1 addition & 1 deletion ui/src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export const Header = ({ authorised, statusLoaded }) => {
<li>
<Button
variant="default"
onClick={() => router.push('/pricing')}
onClick={() => router.push('/upgrade')}
className="
block py-2 px-4
text-white rounded
Expand Down

0 comments on commit fe42ba0

Please sign in to comment.