Skip to content

Commit

Permalink
Merge pull request #3 from The-JW-Corp/staging
Browse files Browse the repository at this point in the history
Hotfix on buttons
  • Loading branch information
JW-Rami authored Jan 5, 2024
2 parents 1ff2dc2 + 77e6989 commit f736f6d
Show file tree
Hide file tree
Showing 12 changed files with 296 additions and 292 deletions.
12 changes: 12 additions & 0 deletions client/src/app/api/nftsSelected/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NextResponse } from "next/server";
export async function GET() {
return NextResponse.json({
hello: "world",
});
}
export async function POST(request: Request) {
const data = await request.json;
return NextResponse.json({
data,
});
}
6 changes: 6 additions & 0 deletions client/src/app/api/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { NextResponse } from "next/server";
export async function GET() {
return NextResponse.json({
hello: "world",
});
}
2 changes: 1 addition & 1 deletion client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import Navbar from "../components/Navbar.jsx";
import ButtonSocials from "../components/buttons/ButtonSocials.jsx";
import ButtonSocials from "../components/buttons/ButtonSocials.tsx";
// import { PathnameProvider } from "../../contexts/PathnameContext";
const inter = Inter({ subsets: ["latin"] });

Expand Down
140 changes: 11 additions & 129 deletions client/src/app/stake/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import React from "react";
import Image from "next/image";
import degenKongWatermark from "../../../public/Assets/image/degenkong-watermark.svg";
import styles from "../../styles/pages/page-stake.module.css";
import degenPfp from "../../../public/Assets/image/degenKong-pfp.png";
import ButtonMedium from "../../components/buttons/ButtonMedium";
import nftImage from "../../../public/Assets/image/degenKong-pfp.png";
import ButtonMedium from "../../components/buttons/ButtonMedium.tsx";
import Nft from "../../components/Nft";
function page() {
// Fake data but need to fetch nft Meta data and ID from blockchain
const nftsFromWallet = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
const nftsStaked = [0, 1, 2, 3, 4];
return (
<>
<div className={styles.stake_page_container}>
Expand All @@ -21,27 +25,7 @@ function page() {
</div>
<div className={styles.stake_page_first_bloc}>
<div className={styles.stake_page_first_bloc_wrap}>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<Nft nfts={nftsFromWallet} nftImage={nftImage} />
</div>
</div>
<div
Expand All @@ -60,114 +44,12 @@ function page() {
</div>
<div className={styles.stake_page_second_bloc}>
<div className={styles.stake_page_second_bloc_wrap}>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<div className={styles.stake_page_image_container}>
<Image
src={degenPfp}
quality={100}
alt="degen kong long background"
/>
</div>
<Nft nfts={nftsStaked} nftImage={nftImage} />
</div>
</div>
<div className={styles.stake_page_second_bloc_bottom_buttons_container}>
<div
className={styles.stake_page_second_bloc_bottom_buttons_container}
>
<ButtonMedium text="SELECT ALL (0)" />
<ButtonMedium text="UNSTAKE(0)" />
</div>
Expand Down
44 changes: 44 additions & 0 deletions client/src/components/Nft.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"use client";
import React, { useState } from "react";
import styles from "../styles/nft.module.css";
import Image from "next/image";
function Nft({ nfts, nftImage }) {
const [selectedNfts, setSelectedNfts] = useState(new Set());

function handleNftClick(index) {
setSelectedNfts((prevSelectedNfts) => {
const newSelectedNfts = new Set(prevSelectedNfts);
if (newSelectedNfts.has(index)) {
newSelectedNfts.delete(index);
} else {
newSelectedNfts.add(index);
}
return newSelectedNfts;
});
console.log(selectedNfts.size)
}

return (
<>
{nfts.map((index) => (
<div
key={index}
className={
selectedNfts.has(index)
? styles.nft_image_container_selected
: styles.nft_image_container
}
onClick={() => handleNftClick(index)}
>
<Image
src={nftImage}
quality={100}
alt="degen kong long background"
/>
</div>
))}
</>
);
}

export default Nft;
2 changes: 1 addition & 1 deletion client/src/components/buttons/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import React, { useState, useRef, useEffect } from "react";
import styles from "../../styles/button.module.css";
import Link from "next/link";
import KongHand from "../lottie/KongHand";
import KongHand from "../lottie/KongHand.tsx";
import KongMouth from "../lottie/KongMouth";
import ButtonAnimation from "../../components/lottie/ButtonAnimation";
import {handleAnimationComplete as handleAnimationCompleteUtil } from "../../utils/lottieAnimationComplete"
Expand Down
93 changes: 0 additions & 93 deletions client/src/components/buttons/ButtonSocials.jsx

This file was deleted.

Loading

0 comments on commit f736f6d

Please sign in to comment.