Skip to content

Commit

Permalink
Cleanup landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Șerb committed Apr 3, 2024
1 parent 2021587 commit 14b0344
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 93 deletions.
72 changes: 16 additions & 56 deletions packages/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,68 +1,28 @@
"use client";

import Link from "next/link";
import type { NextPage } from "next";
import { useAccount } from "wagmi";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
import { Address } from "~~/components/scaffold-eth";

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

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>
<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 className="hero min-h-screen" style={{ backgroundImage: "url(/hero.svg)" }}>
<div className="hero-content text-center text-neutral-content">
<div className="max-w-md"></div>
</div>
</div>
<div className="w-full flex items-center flex-col py-20">
<pre className="w-2/3 m-auto p-0 whitespace-pre-wrap">
{`
Gnomish
<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.
</p>
</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>
</div>
</div>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
`}
</pre>
<a href="https://x.com/gnomish_eth" className="btn btn-ghost bg-purple-500 hover:bg-purple-300">
Follow on X
</a>
</div>
</>
);
Expand Down
58 changes: 31 additions & 27 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from "react";
import Image from "next/image";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { hardhat } from "viem/chains";
import { useAccount } from "wagmi";
import { CurrencyDollarIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
Expand All @@ -20,6 +21,7 @@ export const Footer = () => {
const { targetNetwork } = useTargetNetwork();
const isLocalNetwork = targetNetwork.id === hardhat.id;
const { address: connectedAddress } = useAccount();
const pathname = usePathname();

const { writeAsync: writeAsyncUSDC, isLoading: isLoadingUSDC } = useScaffoldContractWrite({
contractName: "WhyDidHeLeave",
Expand All @@ -32,36 +34,38 @@ export const Footer = () => {

return (
<div className="min-h-0 h-[20rem] py-5 px-1 mb-11 lg:mb-0 bg-white">
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto">
<button
className="btn btn-info btn-sm font-normal"
onClick={() => writeAsyncUSDC()}
disabled={isLoadingUSDC}
>
{isLoadingUSDC ? <span className="loading loading-spinner loading-sm"></span> : <>WhyDidHeLeave $</>}
</button>
{nativeCurrencyPrice > 0 && (
<div>
<div className="btn btn-info btn-sm font-normal gap-1 cursor-auto">
<CurrencyDollarIcon className="h-4 w-4" />
<span>{nativeCurrencyPrice}</span>
{pathname !== "/" && (
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto">
<button
className="btn btn-info btn-sm font-normal"
onClick={() => writeAsyncUSDC()}
disabled={isLoadingUSDC}
>
{isLoadingUSDC ? <span className="loading loading-spinner loading-sm"></span> : <>WhyDidHeLeave $</>}
</button>
{nativeCurrencyPrice > 0 && (
<div>
<div className="btn btn-info btn-sm font-normal gap-1 cursor-auto">
<CurrencyDollarIcon className="h-4 w-4" />
<span>{nativeCurrencyPrice}</span>
</div>
</div>
</div>
)}
{isLocalNetwork && (
<>
<Faucet />
<Link href="/blockexplorer" passHref className="btn btn-info btn-sm font-normal gap-1">
<MagnifyingGlassIcon className="h-4 w-4" />
<span>Block Explorer</span>
</Link>
</>
)}
)}
{isLocalNetwork && (
<>
<Faucet />
<Link href="/blockexplorer" passHref className="btn btn-info btn-sm font-normal gap-1">
<MagnifyingGlassIcon className="h-4 w-4" />
<span>Block Explorer</span>
</Link>
</>
)}
</div>
</div>
</div>
</div>
)}
<div className="flex flex-col justify-end items-center gap-8 h-full">
<h3 className="w-full text-center">Build with the help of Gnomes, and ...</h3>
<div className="flex justify-center items-center gap-8 align-top">
Expand Down
18 changes: 9 additions & 9 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const HeaderMenuLinks = () => {
export const Header = () => {
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
const burgerMenuRef = useRef<HTMLDivElement>(null);
const pathname = usePathname();
useOutsideClick(
burgerMenuRef,
useCallback(() => setIsDrawerOpen(false), []),
Expand All @@ -82,23 +83,22 @@ export const Header = () => {
onClick={() => {
setIsDrawerOpen(false);
}}
>
<HeaderMenuLinks />
</ul>
></ul>
)}
</div>
<Link href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
<div className="flex relative w-20 h-10">
<div className="flex relative w-20 h-20">
<Image alt="PPGF logo" className="cursor-pointer" fill src="/logo-ppgf.svg" />
</div>
</Link>
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2">
<HeaderMenuLinks />
</ul>
</div>
<div className="navbar-end flex-grow mr-4">
<RainbowKitCustomConnectButton />
<FaucetButton />
{pathname !== "/" && (
<>
<RainbowKitCustomConnectButton />
<FaucetButton />
</>
)}
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

body {
min-height: 100vh;
background: #0a0a0a;
/* background: #0a0a0a; */
}

h1,
Expand Down

0 comments on commit 14b0344

Please sign in to comment.