diff --git a/src/app/giveaways/page.tsx b/src/app/giveaways/page.tsx
index 2724e36..89f5542 100644
--- a/src/app/giveaways/page.tsx
+++ b/src/app/giveaways/page.tsx
@@ -82,10 +82,11 @@ export default async function GiveawaysPage() {
);
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 91b6a85..b35bf3c 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -18,7 +18,7 @@ export default function RootLayout({ children }: { children: React.ReactNode })
{/* Logo / Title */}
- TCG Love - Giveaway Page
+ Giveaway System
{/* Navigation */}
diff --git a/src/components/GiveawayCard.tsx b/src/components/GiveawayCard.tsx
index ca80192..c4fd847 100644
--- a/src/components/GiveawayCard.tsx
+++ b/src/components/GiveawayCard.tsx
@@ -11,12 +11,15 @@ interface GiveawayCardProps {
imageUrl: string;
value: number;
userId: string;
+ time_remaining: string;
}
-const GiveawayCard: React.FC
= ({ giveawayId, title, description, imageUrl, value, userId}) => {
+const GiveawayCard: React.FC = ({ giveawayId, title, description, imageUrl, value, userId, time_remaining}) => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [entrynumber, setEntrynumber] = useState(0);
const [activeUserCoins, setActiveUserCoins] = useState(0);
+ const [entryMultiplier, setEntryMultiplier] = useState(1);
+
const fetchEntryCount = async () => {
@@ -28,6 +31,16 @@ const GiveawayCard: React.FC = ({ giveawayId, title, descript
}
};
+ useEffect(() => {
+ let multiplier = 1;
+ let entries = entrynumber;
+ while (entries >= 3) {
+ entries -= 3;
+ multiplier *= 1.5;
+ }
+ setEntryMultiplier(multiplier);
+ }, [entrynumber]);
+
useEffect(() => {
fetchEntryCount();
}, [userId, giveawayId]);
@@ -66,7 +79,7 @@ const GiveawayCard: React.FC = ({ giveawayId, title, descript
{title}
{description}
-
Value: {value} coins
+
Time Remaining: {time_remaining}
Your entries: {entrynumber}
@@ -85,6 +98,8 @@ const GiveawayCard: React.FC
= ({ giveawayId, title, descript
{title}
{description}
+
Value: {value} coins
+
Entry cost: {Math.ceil(value*0.01*entryMultiplier)}