Skip to content

Commit

Permalink
fixed a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgo0018 committed Apr 27, 2024
1 parent 84975c3 commit 300c6f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 53 deletions.
68 changes: 15 additions & 53 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,72 +1,34 @@
"use client";

import Link from "next/link";
import Image from "next/image";
import RegisterButton from "./_components/RegisterButton";
import type { NextPage } from "next";
import { useAccount } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Address } from "~~/components/scaffold-eth";
import HeroImage from "~~/assets/private_voting.png";
import { useAuthUserOnly } from "~~/hooks/useAuthUserOnly";

const Home: NextPage = () => {
const { address: connectedAddress } = useAccount();

useAuthUserOnly({ inverted: true });

return (
<>
<div className="flex items-center flex-col flex-grow pt-10">
<div className="px-5">
<h1 className="text-center">
<span className="block text-2xl mb-2">Welcome to</span>
<span className="block text-4xl font-bold">Scaffold-ETH 2</span>
</h1>
<div className="flex justify-center items-center space-x-2">
<p className="my-2 font-medium">Connected Address:</p>
<Address address={connectedAddress} />
</div>
<div>
<RegisterButton />
</div>
<p className="text-center text-lg">
Get started by editing{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/nextjs/app/page.tsx
</code>
</p>
<p className="text-center text-lg">
Edit your smart contract{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
YourContract.sol
</code>{" "}
in{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
packages/hardhat/contracts
</code>
</p>
</div>
{/* create a home page for private voting starter kit with maci */}
<h1 className="text-4xl font-bold text-center">Private Voting Starter Kit with MACI</h1>

<div className="flex-grow bg-base-300 w-full mt-16 px-8 py-12">
<div className="flex justify-center items-center gap-12 flex-col sm:flex-row">
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<BugAntIcon className="h-8 w-8 fill-secondary" />
<p>
Tinker with your smart contract using the{" "}
<Link href="/debug" passHref className="link">
Debug Contracts
</Link>{" "}
tab.
{/* create a split view with one side to show the registration button and the other side to show a image */}
<div className="flex flex-col-reverse md:flex-row justify-center items-center mt-10 sm:w-2/3 mx-auto gap-x-10 gap-y-5 mb-10">
<div className="flex-1">
<p className="text-lg mt-5 text-justify">
This starter kit is designed to help you get started with private voting using the Minimal
Anti-Collusion Infrastructure (MACI).
</p>
<div className="text-center">
<RegisterButton />
</div>
</div>
<div className="flex flex-col bg-base-100 px-10 py-10 text-center items-center max-w-xs rounded-3xl">
<MagnifyingGlassIcon className="h-8 w-8 fill-secondary" />
<p>
Explore your local transactions with the{" "}
<Link href="/blockexplorer" passHref className="link">
Block Explorer
</Link>{" "}
tab.
</p>
<div className="flex-1">
<Image src={HeroImage} alt="MACI" className="w-full" />
</div>
</div>
</div>
Expand Down
Binary file added packages/nextjs/assets/private_voting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 300c6f1

Please sign in to comment.