-
Are you sure to join this bet?
-
Wager: {selectedBet.wager} SOL | Prize: {(selectedBet.wager * 2).toFixed(2)} SOL
-
Game: {games.find(g => g.id === selectedBet.id)?.name}
-
- {selectedBet.ownerProfile && (
- <>
-
-
Offered by: {selectedBet.ownerProfile.username}
- >
- )}
-
-
-
-
-
+
+
+ {isProcessing ? (
+
+
+
Processing...
+
Joining the bet, please wait...
+
+ ) : (
+ <>
+
Are you sure to join this bet?
+
+
+ g.id === selectedBet.id)?.thumbnail || ''}
+ alt={games.find(g => g.id === selectedBet.id)?.name || ''}
+ layout="fill"
+ objectFit="cover"
+ />
+
+
+ {selectedBet.ownerProfile && (
+ <>
+
Offered by:
+
+
+
{selectedBet.ownerProfile.username}
+
+ >
+ )}
+
+ Wager:
+ {selectedBet.wager} SOL
+
+
+ Prize:
+ {(selectedBet.wager * 2).toFixed(2)} SOL
+
+
+
+
+
+
+
+ >
+ )}
)}
diff --git a/src/components/PriceSelection.tsx b/src/components/PriceSelection.tsx
index 28ed7e2..6fb7812 100644
--- a/src/components/PriceSelection.tsx
+++ b/src/components/PriceSelection.tsx
@@ -1,3 +1,4 @@
+import { useState, useEffect } from "react";
import Image from "next/image";
interface PriceSelectionProps {
@@ -6,27 +7,74 @@ interface PriceSelectionProps {
}
export function PriceSelection({ selectedPrice, onSelect }: PriceSelectionProps) {
- const prices = [0.2, 0.5, 0.8];
+ const presets = [0.05, 0.1, 0.2, 0.5, 1.0];
+ const [inputValue, setInputValue] = useState
("");
+ const MIN_AMOUNT = 0.05;
+
+ useEffect(() => {
+ if (selectedPrice !== null) {
+ setInputValue(selectedPrice.toString());
+ }
+ }, [selectedPrice]);
+
+ const handleInputChange = (e: React.ChangeEvent) => {
+ const value = e.target.value;
+ setInputValue(value);
+ const parsed = parseFloat(value);
+ if (!isNaN(parsed) && parsed >= MIN_AMOUNT) {
+ onSelect(parsed);
+ }
+ };
+
+ const handlePresetClick = (value: number) => {
+ onSelect(value);
+ setInputValue(value.toString());
+ };
return (
- {prices.map((price) => (
-
onSelect(price)}
- >
-
- {price} SOL
-
- ))}
+
+
+
+
+
+
+
+
+
+
+ {presets.map((price) => (
+
+ ))}
+
);
}
diff --git a/src/data/games.ts b/src/data/games.ts
index 76df1d2..a62f75f 100644
--- a/src/data/games.ts
+++ b/src/data/games.ts
@@ -6,19 +6,22 @@ export const games = [
name: "Block Drop",
entryFee: "0.1 SOL",
thumbnail: "/duelfiassets/Block Drop Illustration.jpeg",
+ isAvailable: true
},
{
id: "snakes",
name: "Venom Trails",
entryFee: "0.02 ETH",
thumbnail: "/duelfiassets/Venom Trail Game Cover Illustration.png",
+ isAvailable: false
},
{
id: "bubbles",
name: "Wall Smash",
entryFee: "0.05 ETH",
thumbnail: "/duelfiassets/Wall Smash Game Cover Illustration.png",
- },
+ isAvailable: false
+ }
];
export function GetGameByID(id:string):Game | undefined{
diff --git a/src/shared/constants.ts b/src/shared/constants.ts
index fc9c0fb..8a3a7bc 100644
--- a/src/shared/constants.ts
+++ b/src/shared/constants.ts
@@ -3,4 +3,8 @@ import { Commitment, PublicKey } from "@solana/web3.js";
export const FEE_COLLECTOR_PUBKEY = new PublicKey("cocD4r4yNpHxPq7CzUebxEMyLki3X4d2Y3HcTX5ptUc");
export const WAGER_PRIZE_MULT = 0.95;
-export const CONFIRMATION_THRESHOLD:Commitment = 'finalized';
\ No newline at end of file
+export const CONFIRMATION_THRESHOLD:Commitment = 'finalized';
+
+export const URL_TELEGRAM = "https://t.me/duelfidotio";
+export const URL_TWITTER = "https://x.com/duelfidotio";
+export const URL_WHITEPAPER = "https://duelfi-io.gitbook.io/whitepaper";
\ No newline at end of file
diff --git a/src/types/Game.ts b/src/types/Game.ts
index a68ff0c..ffb2d8e 100644
--- a/src/types/Game.ts
+++ b/src/types/Game.ts
@@ -3,4 +3,5 @@ export interface Game {
name: string;
entryFee: string;
thumbnail: string;
+ isAvailable: boolean;
}
\ No newline at end of file