Skip to content

Commit

Permalink
feat(web): show the toast only when email add successfully (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
bansal-harsh-2504 authored Oct 15, 2024
1 parent e8e737a commit 783c411
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions apps/web/src/components/hero/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,20 @@ function Hero(): React.JSX.Element {
'https://xyz.us18.list-manage.com/subscribe/post?u=2e44b940cafe6e54d8b9e0790&id=bd382dd7c5&f_id=00e5c2e1f0'

async function fetchData(): Promise<void> {
toast.custom((_t) => (
<div className="text-brandBlue border-brandBlue/20 w-[90vw] rounded-lg border bg-[#293234] p-2 shadow-2xl backdrop-blur-3xl md:w-[25vw]">
<h1 className="font-semibold">Welcome to Keyshade 🎉</h1>
<p className="text-sm">
You have been added to the waitlist. We will notify you once we
launch
</p>
</div>
))
try {
await fetch(`${url}&EMAIL=${email}`, {
mode: 'no-cors'
})

toast.custom((_t) => (
<div className="text-brandBlue border-brandBlue/20 w-[90vw] rounded-lg border bg-[#293234] p-2 shadow-2xl backdrop-blur-3xl md:w-[25vw]">
<h1 className="font-semibold">Welcome to Keyshade 🎉</h1>
<p className="text-sm">
You have been added to the waitlist. We will notify you once we
launch
</p>
</div>
))
setEmail('');

} catch (error) {
Expand Down

0 comments on commit 783c411

Please sign in to comment.