Skip to content

Commit

Permalink
Merge pull request #29 from BuidlGuidl/main
Browse files Browse the repository at this point in the history
marge main
  • Loading branch information
Avelous authored Mar 2, 2024
2 parents 5f893cc + 86c8653 commit b2d8a7b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 25 deletions.
27 changes: 8 additions & 19 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getTargetNetwork } from "~~/utils/scaffold-eth";
*/
export const Footer = () => {
const nativeCurrencyPrice = useGlobalState(state => state.nativeCurrencyPrice);
const codeLink = "https://github.com/BuidlGuidl/private-key-dice";

return (
<div className="min-h-0 py-5 px-1 mb-11 lg:mb-0">
Expand All @@ -31,15 +32,13 @@ export const Footer = () => {
<div className="w-full">
<ul className="menu menu-horizontal w-full">
<div className="flex justify-center items-center gap-2 text-sm w-full">
<div className="text-center">
<a
href="https://github.com/scaffold-eth/se-2"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
Fork me
</a>
<div>
<div className="flex justify-center items-center gap-2 text-sm w-full">
📝{" "}
<a href={codeLink} target="_blank" rel="noreferrer" className="underline underline-offset-2">
Code/Repo
</a>{" "}
</div>
</div>
<span>·</span>
<div>
Expand All @@ -56,16 +55,6 @@ export const Footer = () => {
</p>
</div>
<span>·</span>
<div className="text-center">
<a
href="https://t.me/joinchat/KByvmRe5wkR-8F_zz6AjpA"
target="_blank"
rel="noreferrer"
className="underline underline-offset-2"
>
Support
</a>
</div>
</div>
</ul>
</div>
Expand Down
53 changes: 48 additions & 5 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,65 @@
import React, { useCallback, useRef, useState } from "react";
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import Wallet from "./Wallet";
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: "/",
},
];

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
*/
export const Header = () => {
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
const burgerMenuRef = useRef<HTMLDivElement>(null);

useOutsideClick(
burgerMenuRef,
useCallback(() => setIsDrawerOpen(false), []),
);

return (
<div
className="sticky lg:static top-0 navbar bg-base-100 min-h-0 flex-shrink-0 justify-between z-20 shadow-md shadow-secondary px-0 sm:px-2"
style={{ backgroundColor: "#d6fcf8" }}
>
<div className="sticky lg:static top-0 navbar bg-white min-h-0 flex-shrink-0 justify-between z-20 shadow-md shadow-secondary px-0 sm:px-2">
<div className="navbar-start w-auto lg:w-1/2">
<div className="lg:hidden dropdown" ref={burgerMenuRef}>
<label
Expand All @@ -40,7 +78,9 @@ export const Header = () => {
onClick={() => {
setIsDrawerOpen(false);
}}
></ul>
>
<HeaderMenuLinks />
</ul>
)}
</div>
<Link href="/" passHref className="hidden lg:flex items-center gap-2 ml-4 mr-6 shrink-0">
Expand All @@ -51,6 +91,9 @@ export const Header = () => {
<span className="font-bold leading-tight">Private Key Dice</span>
</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 />
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/dicedemo/Congrats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Congrats = ({
};

const privateKey = loadBurnerSK();
const pwlink = "https://punkwallet.io/pk#" + privateKey;
const pwlink = "https://punkwallet.io/opt:pk#" + privateKey;

return (
<div className=" overflow-hidden w-fit text-lg bg-base-200 h-full">
Expand Down

0 comments on commit b2d8a7b

Please sign in to comment.