From d99828289be978c673c9ef049cf1b8daff3be2a9 Mon Sep 17 00:00:00 2001 From: Michael Amponsah Date: Wed, 15 Jan 2025 18:54:20 +0000 Subject: [PATCH 01/28] rewire waitlist page --- frontend/package.json | 2 +- frontend/public/images/linkedin.png | Bin 0 -> 431 bytes frontend/src/app/layout.tsx | 18 +- frontend/src/app/page.tsx | 12 +- frontend/src/app/waitListPage.tsx | 72 +------ frontend/src/components/Footer.tsx | 32 ++- frontend/src/components/Header.tsx | 67 ++++--- frontend/src/components/landing/Features.tsx | 87 ++++++++ frontend/src/components/landing/FinalCta.tsx | 38 ++++ frontend/src/components/landing/Hero.tsx | 65 ++++++ .../src/components/waitlist/WaitlistForm.tsx | 86 ++++++++ frontend/src/data/socials.ts | 13 ++ frontend/tailwind.config.ts | 186 +++++++++--------- 13 files changed, 473 insertions(+), 205 deletions(-) create mode 100644 frontend/public/images/linkedin.png create mode 100644 frontend/src/components/landing/Features.tsx create mode 100644 frontend/src/components/landing/FinalCta.tsx create mode 100644 frontend/src/components/landing/Hero.tsx create mode 100644 frontend/src/components/waitlist/WaitlistForm.tsx create mode 100644 frontend/src/data/socials.ts diff --git a/frontend/package.json b/frontend/package.json index fe45f83..18443f7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,8 +28,8 @@ "@web3auth/modal": "^9.4.0", "@web3auth/web3auth-wagmi-connector": "^7.0.0", "aos": "^2.3.4", + "class-variance-authority": "^0.7.1", "emailjs-com": "^3.2.0", - "class-variance-authority": "^0.7.0", "framer-motion": "^11.12.0", "lucide-react": "^0.460.0", "next": "^14.2.13", diff --git a/frontend/public/images/linkedin.png b/frontend/public/images/linkedin.png new file mode 100644 index 0000000000000000000000000000000000000000..8f490e0d07995c1668e52d47d70919277fbb0baa GIT binary patch literal 431 zcmV;g0Z{&lP)baZ(LT{m{fIbM%+gidXk7F zV<2+jjGy9;eDFCUT6BJjTV6txNMgn(U5U0P$^Uy}$&d~5Jn{|H)CPht+&c=tIm$rb z4=|CQhTI3>i>+~6@1?(S<12fNknmSu+KE{`Y)jnqbcQ_#Eie5`6f$=P`Eiq^(vN>| ZQFr0Zecx>a(&_*J002ovPDHLkV1g#(ve5tl literal 0 HcmV?d00001 diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index 4db67a9..6c27585 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -19,8 +19,11 @@ const afacad = Afacad({ variable: "--font-afacad", }); +const fonts = [afacad, space_grotesk, roboto_flex]; +const fontClasses = fonts.map((font) => font.variable).join(" "); + export const metadata: Metadata = { - title: "ABVS", + title: "Truecast | Landing", description: "BUIDL with Mowblox", }; @@ -30,17 +33,16 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + - + {/* */} +
{children} - - +
+ + {/*
*/}
diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index 6db430e..aa2404e 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -1,6 +1,8 @@ import { Metadata } from "next"; import Footer from "@/components/Footer"; -import WaitListPage from "./waitListPage"; +import Hero from "@/components/landing/Hero"; +import Features from "@/components/landing/Features"; +import FinalCta from "@/components/landing/FinalCta"; export const metadata: Metadata = { title: "TrueCast | Landing", @@ -8,9 +10,11 @@ export const metadata: Metadata = { export default function LandingPage() { return ( - <> - +
+ + +
- +
); } diff --git a/frontend/src/app/waitListPage.tsx b/frontend/src/app/waitListPage.tsx index a77acc2..3a7cd62 100644 --- a/frontend/src/app/waitListPage.tsx +++ b/frontend/src/app/waitListPage.tsx @@ -2,22 +2,18 @@ import React, { useEffect, useState, FormEvent, useRef } from "react"; import Image from "next/image"; import bell from "../../public/images/bell.png"; -import { Separator } from "@radix-ui/react-select"; -import mowblox from "../../public/images/mowblox.png"; -import scroll from "../../public/images/scroll.png"; -import creya from "../../public/images/creya.png"; import sheild from "../../public/images/Shield.svg"; import lighting from "../../public/images/Lightning.svg"; import user from "../../public/images/User.svg"; import gradient from "../../public/images/Gradient.png"; import eclipse from "../../public/images/Gradient-2.png"; import eclipse2 from "../../public/images/card-gradient.png"; -import background from "../../public/images/hero_bg.svg"; import LoadingSpinner from "../components/ui/LoadingSpinner"; import emailjs from "emailjs-com"; import { toast } from "sonner"; import Aos from "aos"; import "aos/dist/aos.css"; +import Hero from "@/components/landing/Hero"; const WaitListPage = () => { const [email, setEmail] = useState(""); @@ -56,70 +52,8 @@ const WaitListPage = () => { }, []); return ( -
- {/* Hero Section */} -
-
- Background -

- Future Of Fair Elections -

-

- Remember that feeling after casting your vote? That moment of - "I hope it makes it"? Yeah, we weren't fans either. - That's why we’re building something better. -

-
- setEmail(e.target.value)} - className="w-full bg-[#07070702] font-afacad rounded-full p-3 focus:outline-none focus:[#0707074D]" - /> - -
-
- - {/* Support Section */} -
-

Support by

-
- Mowblox - - Scroll - - Creya -
-
-
+
+ {/* Features Section */}
diff --git a/frontend/src/components/Footer.tsx b/frontend/src/components/Footer.tsx index 527463e..0ac5a32 100644 --- a/frontend/src/components/Footer.tsx +++ b/frontend/src/components/Footer.tsx @@ -1,23 +1,37 @@ +import { socials } from "@/data/socials"; import Image from "next/image"; +import Link from "next/link"; export default function Footer() { return ( -
-
- Logo +
+
+ Logo

Secure, Transparent, and Fair Voting for Everyone

-
-

© 2024 TRUECAST. All Rights Reserved.

- {/*

Privacy Policy

*/} +
+

+ © {new Date().getFullYear()} TRUECAST. All Rights Reserved. +

); diff --git a/frontend/src/components/Header.tsx b/frontend/src/components/Header.tsx index 53c5fda..0a5c92f 100644 --- a/frontend/src/components/Header.tsx +++ b/frontend/src/components/Header.tsx @@ -1,33 +1,56 @@ -'use client'; -import { ConnectButton } from '@rainbow-me/rainbowkit'; +"use client"; import Image from "next/image"; import Link from "next/link"; +const socials = [ + { + url: "https://linkedin.com/truecastio", + image: "/images/linkedin.png", + name: "LinkedIn", + }, + { url: "https://twitter.com/truecastio", name: "X (Twitter)" }, + { + url: "mailto:info@truecastio.com", + image: "/images/email.png", + name: "Email", + }, +]; export default function Header() { - return ( -
-
- ); -} diff --git a/frontend/src/components/elections/CreateElection.tsx b/frontend/src/components/elections/CreateElection.tsx deleted file mode 100644 index ddff601..0000000 --- a/frontend/src/components/elections/CreateElection.tsx +++ /dev/null @@ -1,233 +0,0 @@ -"use client"; - -import { useState } from "react"; -import { useChainId, useAccount } from "wagmi"; -import { useRouter } from "next/navigation"; -import { - ELECTION_FACTORY_ABI, - getFactoryAddress, -} from "@/contracts/ElectionFactory"; -import Web3 from "web3"; -import { z } from "zod"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { useForm } from "react-hook-form"; -import { CalendarIcon, Loader2 } from "lucide-react"; -import { Calendar } from "@/components/ui/calendar"; -import { Button } from "@/components/ui/button"; -import { - Popover, - PopoverTrigger, - PopoverContent, -} from "@/components/ui/popover"; -import LoadingSpinner from "../ui/LoadingSpinner"; -import { toast } from "sonner"; -import { format } from "date-fns"; - -const ElectionFormSchema = z.object({ - title: z.string().nonempty("Title is required"), - description: z.string().nonempty("Description is required"), - startDate: z.date({ required_error: "Start date is required" }), - endDate: z.date({ required_error: "End date is required" }), - electionType: z.enum(["public", "private"]), -}); - -export default function CreateElection() { - const router = useRouter(); - const chainId = useChainId(); - const { connector, address } = useAccount(); - const [loading, setLoading] = useState(false); - - const form = useForm>({ - resolver: zodResolver(ElectionFormSchema), - }); - - const createElection = async (data: z.infer) => { - if (!connector) { - toast.error("Please connect your wallet to create an election"); - return; - } - - try { - setLoading(true); - const web3 = new Web3((await connector.getProvider()) as any); - const electionFactory = new web3.eth.Contract( - ELECTION_FACTORY_ABI, - getFactoryAddress(chainId) - ); - const receipt = await electionFactory.methods - .createElection( - data.title, - data.description, - data.electionType === "public", - data.startDate.getTime(), - data.endDate.getTime() - ) - .send({ from: address }); - - if (receipt.events?.ElectionCreated?.returnValues?.electionAddress) { - toast.success("Election contract created successfully!"); - setTimeout(() => { - router.push( - `/elections/${receipt.events?.ElectionCreated?.returnValues?.electionAddress}` - ); - }, 3000); - } else { - setLoading(false); - toast.error("You may have interacted with the wrong network"); - } - } catch (error: any) { - setLoading(false); - toast.error(error.message); - } - }; - - return ( - - {/* Title Field */} -
- - -
- - {/* Description Field */} -
- -