From d5274b030f165467e49104e6fb415c463ac0266f Mon Sep 17 00:00:00 2001 From: Daniel W Date: Sun, 17 Mar 2024 06:32:28 +0000 Subject: [PATCH] more functions --- frontend/src/components/MainPage.tsx | 2 +- frontend/src/components/Table.tsx | 94 +++++++++++++++++++++++++--- 2 files changed, 85 insertions(+), 11 deletions(-) diff --git a/frontend/src/components/MainPage.tsx b/frontend/src/components/MainPage.tsx index 43ee183..5dbe856 100644 --- a/frontend/src/components/MainPage.tsx +++ b/frontend/src/components/MainPage.tsx @@ -6,7 +6,7 @@ const MainPage = () => { return (
- + {/**/} diff --git a/frontend/src/components/Table.tsx b/frontend/src/components/Table.tsx index d6208a9..45bdcdc 100644 --- a/frontend/src/components/Table.tsx +++ b/frontend/src/components/Table.tsx @@ -1,13 +1,71 @@ import React, {useState, useEffect} from "react" import cardBackground from "../CryptoHoldem_assests/Cards new/Card Background.png" -import { Button, Modal, notification } from "antd"; +import blueA from "../CryptoHoldem_assests/Cards new/Blue/Card Blue A.png" +import blueJ from "../CryptoHoldem_assests/Cards new/Blue/Card Blue J.svg" +import blueK from "../CryptoHoldem_assests/Cards new/Blue/Card Blue Q.svg" +import blueQ from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 1.svg" +import blue2 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 2.svg" +import blue3 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 3.svg" +import blue4 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 4.svg" +import blue5 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 5.svg" +import blue6 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 6.svg" +import blue7 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 7.svg" +import blue8 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 8.svg" +import blue9 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 9.svg" +import blue10 from "../CryptoHoldem_assests/Cards new/Blue/Card Blue 10.svg" + +import pinkA from "../CryptoHoldem_assests/Cards new/Pink/Card Pink A.svg" +import pinkJ from "../CryptoHoldem_assests/Cards new/Pink/Card Pink J.svg" +import pinkK from "../CryptoHoldem_assests/Cards new/Pink/Card Pink Q.svg" +import pinkQ from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 1.svg" +import pink2 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 2.svg" +import pink3 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 3.svg" +import pink4 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 4.svg" +import pink5 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 5.svg" +import pink6 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 6.svg" +import pink7 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 7.svg" +import pink8 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 8.svg" +import pink9 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 9.svg" +import pink10 from "../CryptoHoldem_assests/Cards new/Pink/Card Pink 10.svg" + +import greenA from "../CryptoHoldem_assests/Cards new/Green/Card Green A.svg" +import greenJ from "../CryptoHoldem_assests/Cards new/Green/Card Green J.svg" +import greenK from "../CryptoHoldem_assests/Cards new/Green/Card Green Q.svg" +import greenQ from "../CryptoHoldem_assests/Cards new/Green/Card Green 1.svg" +import green2 from "../CryptoHoldem_assests/Cards new/Green/Card Green 2.svg" +import green3 from "../CryptoHoldem_assests/Cards new/Green/Card Green 3.svg" +import green4 from "../CryptoHoldem_assests/Cards new/Green/Card Green 4.svg" +import green5 from "../CryptoHoldem_assests/Cards new/Green/Card Green 5.svg" +import green6 from "../CryptoHoldem_assests/Cards new/Green/Card Green 6.svg" +import green7 from "../CryptoHoldem_assests/Cards new/Green/Card Green 7.svg" +import green8 from "../CryptoHoldem_assests/Cards new/Green/Card Green 8.svg" +import green9 from "../CryptoHoldem_assests/Cards new/Green/Card Green 9.svg" +import green10 from "../CryptoHoldem_assests/Cards new/Green/Card Green 10.svg" + +import redA from "../CryptoHoldem_assests/Cards new/Red/Card Red A.svg" +import redJ from "../CryptoHoldem_assests/Cards new/Red/Card Red J.svg" +import redK from "../CryptoHoldem_assests/Cards new/Red/Card Red Q.svg" +import redQ from "../CryptoHoldem_assests/Cards new/Red/Card Red 1.svg" +import red2 from "../CryptoHoldem_assests/Cards new/Red/Card Red 2.svg" +import red3 from "../CryptoHoldem_assests/Cards new/Red/Card Red 3.svg" +import red4 from "../CryptoHoldem_assests/Cards new/Red/Card Red 4.svg" +import red5 from "../CryptoHoldem_assests/Cards new/Red/Card Red 5.svg" +import red6 from "../CryptoHoldem_assests/Cards new/Red/Card Red 6.svg" +import red7 from "../CryptoHoldem_assests/Cards new/Red/Card Red 7.svg" +import red8 from "../CryptoHoldem_assests/Cards new/Red/Card Red 8.svg" +import red9 from "../CryptoHoldem_assests/Cards new/Red/Card Red 9.svg" +import red10 from "../CryptoHoldem_assests/Cards new/Red/Card Red 10.svg" + +import { Button, Modal, notification } from "antd"; import playerOne from "../CryptoHoldem_assests/Player/head-cat.png" import playerPlaceholder from "../CryptoHoldem_assests/Player/Placeholder Player/Placeholder Player 3.svg" import mainPlayer from "../CryptoHoldem_assests/Player/head-whale-alive.png" + + import roundTable from "../CryptoHoldem_assests/Rest/Pixel Table.png" import { Contract, Eip1193Provider, ethers } from 'ethers'; @@ -15,8 +73,24 @@ import { BrowserProvider } from "ethers"; import { use } from "chai"; const Table: React.FC = () => { + + const [ownBudget, setOwnBudget] = useState("0.00"); + const [playerBudget, setPlayerBudget] = useState("0.00"); + const [potBudget, setPotBudget] = useState("0.00"); + + const [inputField, setInputField] = useState() + + const [ownCardLeft, setOwnCardLeft] = useState() + const [ownCardRight, setOwnCardRight] = useState() + const [tableCardOne, setTableCardOne] = useState() + const [tableCardTwo, setTableCardTwo] = useState() + const [tableCardThree, setTableCardThree] = useState() + const [tableCardFour, setTableCardFour] = useState() + const [tableCardFive, setTableCardFive] = useState() + + const [api] = notification.useNotification(); - + useEffect(() => { const interval = setInterval(() => { getState(); @@ -24,7 +98,7 @@ const Table: React.FC = () => { return () => clearInterval(interval); }, []); - + const abi = ["function bet() public", "function fold() public", "function getState() public view"]; var provider = new BrowserProvider(window.ethereum as Eip1193Provider); @@ -50,7 +124,7 @@ const Table: React.FC = () => { console.warn("failed to bet..", err); //openNotification(); } - } + } const getState = async () => { try { @@ -64,7 +138,7 @@ const Table: React.FC = () => { console.warn("failed to get state...", err); //openNotification(); } - } + } const fold = async () => { try { @@ -78,16 +152,16 @@ const Table: React.FC = () => { console.warn("failed to fold..", err); //openNotification(); } - } + } return (
Table -

Total Pot: 200$

+

Total Pot: {potBudget}$

-

2000$

-

2000$

+

{playerBudget}$

+

{ownBudget}$

-