mirror of
https://github.com/EdiFarcas/Giveaway-app.git
synced 2026-06-22 05:00:55 +03:00
Update 3
This commit is contained in:
@@ -19,6 +19,7 @@ const GiveawayCard: React.FC<GiveawayCardProps> = ({ giveawayId, title, descript
|
||||
const [entrynumber, setEntrynumber] = useState<number>(0);
|
||||
const [activeUserCoins, setActiveUserCoins] = useState<number>(0);
|
||||
const [entryMultiplier, setEntryMultiplier] = useState<number>(1);
|
||||
const [entryToBuy, setEntryToBuy] = useState<number>(1);
|
||||
|
||||
|
||||
|
||||
@@ -101,6 +102,19 @@ const GiveawayCard: React.FC<GiveawayCardProps> = ({ giveawayId, title, descript
|
||||
<p className="text-gray-600 mb-4">Value: {value} coins</p>
|
||||
<p className="text-gray-600 mb-4">Entry cost: {Math.ceil(value*0.01*entryMultiplier)}</p>
|
||||
<img src={imageUrl} alt={title} className="w-full h-48 object-cover mb-4" />
|
||||
<div className="flex items-center mb-4 text-black">
|
||||
<label className="mr-2 font-medium">Entries to buy:</label>
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
value={entryToBuy}
|
||||
onChange={e => {
|
||||
const value = Math.max(1, Number(e.target.value));
|
||||
setEntryToBuy(value);
|
||||
}}
|
||||
className="border rounded px-2 py-1 w-20"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex justify-between mt-4 text-black">
|
||||
<button
|
||||
className="bg-red-500 text-white px-4 py-2 rounded hover:bg-red-600"
|
||||
|
||||
Reference in New Issue
Block a user