Skip to content

Commit

Permalink
Merge pull request #14 from BuidlGuidl/staging
Browse files Browse the repository at this point in the history
Added some helpful texts
  • Loading branch information
Avelous authored Feb 25, 2024
2 parents 48de584 + e538cfd commit 9400547
Show file tree
Hide file tree
Showing 8 changed files with 3,613 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/nextjs/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ export const Header = () => {
</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" />
<Image alt="DICE" className="cursor-pointer" fill src="/diceLogo.svg" />
</div>
<div className="flex flex-col">
<span className="font-bold leading-tight">Scaffold-ETH</span>
<span className="text-xs">Ethereum dev stack</span>
<span className="font-bold leading-tight">Dice Hunt</span>
<span className="text-xs">Hack the private key</span>
</div>
</Link>
<ul className="hidden lg:flex lg:flex-nowrap menu menu-horizontal px-1 gap-2">{navLinks}</ul>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/MetaHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const baseUrl = process.env.NEXT_PUBLIC_VERCEL_URL ? `https://${process.env.NEXT
export const MetaHeader = ({
title = "Dice Hunt",
description = "Hack the private key",
image = "thumbnail.jpg",
image = "diceLogo.jpg",
twitterCard = "summary_large_image",
children,
}: MetaHeaderProps) => {
Expand Down
19 changes: 14 additions & 5 deletions packages/nextjs/components/dicedemo/Congrats.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Dispatch, SetStateAction } from "react";
import { loadBurnerSK } from "~~/hooks/scaffold-eth";
import { Game } from "~~/types/game/game";

const Congrats = ({
Expand All @@ -22,7 +23,8 @@ const Congrats = ({
setIsOpen(false);
};

// const { isSweeping } = useSweepWallet({ game: game, token: token });
const privateKey = loadBurnerSK();
const pwlink = "https://punkwallet.io/pk#" + privateKey;

return (
<div className=" overflow-hidden w-fit text-lg bg-base-200 h-full">
Expand All @@ -34,9 +36,16 @@ const Congrats = ({
</label>

{isWinner && (
<p className="text-center">
Congrats, you found the hidden characters and have successfully swept the private Key
</p>
<div>
<p className="text-center">
Congrats, you found the hidden characters and have successfully swept the private Key
</p>
<p className="text-center">
<a className="font-bold italic text-xl" href={pwlink} target="_blank" rel="noreferrer">
Click to open your punk wallet
</a>
</p>
</div>
)}
{!isWinner && isHacked && !game.winner && (
<p className="text-center">
Expand All @@ -51,7 +60,7 @@ const Congrats = ({
{!isWinner && !isHacked && <div>Sorry fren, you lost</div>}

<p className="text-center mt-5 text-2xl">
The hidden characters are {Object.values(game.hiddenChars).join(", ")}
The hidden characters are: {Object.values(game.hiddenChars).join(", ").toUpperCase()}
</p>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/components/dicedemo/HostAnnouncement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const HostAnnouncement = ({
<p className="text-center">The Winner is</p>
<Address address={game.winner as string} format="long" />
<p className="mt-5 text-2xl text-center">
The hidden characters are {Object.values(game.hiddenChars).join(", ")}
The hidden characters are: {Object.values(game.hiddenChars).join(", ").toUpperCase()}
</p>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion packages/nextjs/hooks/useSweepWallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ const useSweepWallet = ({ game, token }: { game?: Game; token?: string }) => {
},
);

endGame(game as Game, token as string, address as string);
await endGame(game as Game, token as string, address as string);

setIsSweeping(false);
} catch (error: any) {
setSweepMessage("Error sweeping wallet");
setIsSweeping(false);
if (notificationId) {
notification.remove(notificationId);
Expand Down
7 changes: 6 additions & 1 deletion packages/nextjs/pages/game/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,12 @@ function GamePage() {
</div>
);
} else {
return <div>No Game</div>;
return (
<div className="flex justify-center items-center text-2xl">
Oops, it appears that you are attempting to access a game that either does not exist or to which access has been
lost. Please return to the homepage to join a new game.
</div>
);
}
}

Expand Down
Binary file added packages/nextjs/public/diceLogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,585 changes: 3,585 additions & 0 deletions packages/nextjs/public/diceLogo.svg
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 9400547

Please sign in to comment.