-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
166 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,10 @@ | ||
import React, { useCallback, useRef, useState } from "react"; | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { useRouter } from "next/router"; | ||
import { Bars3Icon, BugAntIcon, MagnifyingGlassIcon, SparklesIcon } from "@heroicons/react/24/outline"; | ||
import { Bars3Icon } from "@heroicons/react/24/outline"; | ||
import { FaucetButton, RainbowKitCustomConnectButton } from "~~/components/scaffold-eth"; | ||
import { useOutsideClick } from "~~/hooks/scaffold-eth"; | ||
|
||
interface HeaderMenuLink { | ||
label: string; | ||
href: string; | ||
icon?: React.ReactNode; | ||
} | ||
|
||
export const menuLinks: HeaderMenuLink[] = [ | ||
{ | ||
label: "Home", | ||
href: "/", | ||
}, | ||
{ | ||
label: "Debug Contracts", | ||
href: "/debug", | ||
icon: <BugAntIcon className="h-4 w-4" />, | ||
}, | ||
{ | ||
label: "Example UI", | ||
href: "/example-ui", | ||
icon: <SparklesIcon className="h-4 w-4" />, | ||
}, | ||
{ | ||
label: "Block Explorer", | ||
href: "/blockexplorer", | ||
icon: <MagnifyingGlassIcon className="h-4 w-4" />, | ||
}, | ||
]; | ||
|
||
export const HeaderMenuLinks = () => { | ||
const router = useRouter(); | ||
|
||
return ( | ||
<> | ||
{menuLinks.map(({ label, href, icon }) => { | ||
const isActive = router.pathname === href; | ||
return ( | ||
<li key={href}> | ||
<Link | ||
href={href} | ||
passHref | ||
className={`${ | ||
isActive ? "bg-secondary shadow-md" : "" | ||
} hover:bg-secondary hover:shadow-md focus:!bg-secondary active:!text-neutral py-1.5 px-3 text-sm rounded-full gap-2 grid grid-flow-col`} | ||
> | ||
{icon} | ||
<span>{label}</span> | ||
</Link> | ||
</li> | ||
); | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
/** | ||
* Site header | ||
*/ | ||
|
@@ -91,23 +36,15 @@ 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-10 h-10"> | ||
<Image alt="SE2 logo" className="cursor-pointer" fill src="/logo.svg" /> | ||
</div> | ||
<div className="flex flex-col"> | ||
<span className="font-bold leading-tight">Scaffold-ETH</span> | ||
<span className="text-xs">Ethereum dev stack</span> | ||
<div className="flex relative"> | ||
<Image alt="FitFam logo" className="cursor-pointer" width={100} height={100} src="/[email protected]" /> | ||
</div> | ||
</Link> | ||
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2"> | ||
<HeaderMenuLinks /> | ||
</ul> | ||
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2"></ul> | ||
</div> | ||
<div className="navbar-end flex-grow mr-4"> | ||
<RainbowKitCustomConnectButton /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,154 @@ | ||
const deployedContracts = null; | ||
const contracts = { | ||
31337: [ | ||
{ | ||
chainId: "31337", | ||
name: "localhost", | ||
contracts: { | ||
YourContract: { | ||
address: "0x5FbDB2315678afecb367f032d93F642f64180aa3", | ||
abi: [ | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "address", | ||
name: "_owner", | ||
type: "address", | ||
}, | ||
], | ||
stateMutability: "nonpayable", | ||
type: "constructor", | ||
}, | ||
{ | ||
anonymous: false, | ||
inputs: [ | ||
{ | ||
indexed: true, | ||
internalType: "address", | ||
name: "greetingSetter", | ||
type: "address", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "string", | ||
name: "newGreeting", | ||
type: "string", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "bool", | ||
name: "premium", | ||
type: "bool", | ||
}, | ||
{ | ||
indexed: false, | ||
internalType: "uint256", | ||
name: "value", | ||
type: "uint256", | ||
}, | ||
], | ||
name: "GreetingChange", | ||
type: "event", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "greeting", | ||
outputs: [ | ||
{ | ||
internalType: "string", | ||
name: "", | ||
type: "string", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "owner", | ||
outputs: [ | ||
{ | ||
internalType: "address", | ||
name: "", | ||
type: "address", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "premium", | ||
outputs: [ | ||
{ | ||
internalType: "bool", | ||
name: "", | ||
type: "bool", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "string", | ||
name: "_newGreeting", | ||
type: "string", | ||
}, | ||
], | ||
name: "setGreeting", | ||
outputs: [], | ||
stateMutability: "payable", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "totalCounter", | ||
outputs: [ | ||
{ | ||
internalType: "uint256", | ||
name: "", | ||
type: "uint256", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [ | ||
{ | ||
internalType: "address", | ||
name: "", | ||
type: "address", | ||
}, | ||
], | ||
name: "userGreetingCounter", | ||
outputs: [ | ||
{ | ||
internalType: "uint256", | ||
name: "", | ||
type: "uint256", | ||
}, | ||
], | ||
stateMutability: "view", | ||
type: "function", | ||
}, | ||
{ | ||
inputs: [], | ||
name: "withdraw", | ||
outputs: [], | ||
stateMutability: "nonpayable", | ||
type: "function", | ||
}, | ||
{ | ||
stateMutability: "payable", | ||
type: "receive", | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
], | ||
} as const; | ||
|
||
export default deployedContracts; | ||
export default contracts; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,7 @@ p { | |
|
||
.btn { | ||
@apply shadow-md; | ||
text-transform: none; | ||
} | ||
|
||
.btn.btn-ghost { | ||
|