diff --git a/public/images/generic_logo.jpg b/public/images/generic_logo.jpg new file mode 100644 index 0000000..6012302 Binary files /dev/null and b/public/images/generic_logo.jpg differ diff --git a/public/images/logo-tcg-love.png b/public/images/logo-tcg-love.png deleted file mode 100644 index 54ab053..0000000 Binary files a/public/images/logo-tcg-love.png and /dev/null differ diff --git a/src/app/admin/AdminClient.tsx b/src/app/admin/AdminClient.tsx index b416133..6df383e 100644 --- a/src/app/admin/AdminClient.tsx +++ b/src/app/admin/AdminClient.tsx @@ -5,131 +5,144 @@ import handleUpdateCoins from "./AdminServer"; import GiveawayManagement from "./GiveawayManagementCards"; interface AdminClientProps { - email: string; + email: string; } export default function AdminClient({ email }: AdminClientProps) { - const [giveaway, setGiveaway] = useState({ - title: "", - description: "", - value: 0, - prize: "", - entryCost: 70000000, - duration: 0, - endsAt: new Date(Date.now() + 24 * 60 * 60 * 1000).getTime() // Set to tomorrow + const [giveaway, setGiveaway] = useState({ + title: "", + description: "", + value: 0, + prize: "", + entryCost: 70000000, + duration: 0, + endsAt: new Date(Date.now() + 24 * 60 * 60 * 1000).getTime(), + }); + const [youtube_url, setYoutubeUrl] = useState(""); + const [coin_value, setCoinValue] = useState(0); + const [showGiveawayManagement, setShowGiveawayManagement] = useState(false); + + const handleCreateGiveaway = async () => { + const response = await fetch("/api/admin/create-giveaway", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify(giveaway), }); - const [youtube_url, setYoutubeUrl] = useState(""); - const [coin_value, setCoinValue] = useState(0); - const [showGiveawayManagement, setShowGiveawayManagement] = useState(false); + if (response.ok) { + alert("Giveaway created successfully!"); + setGiveaway({ + title: "", + description: "", + value: 0, + prize: "", + entryCost: 70000000, + duration: 0, + endsAt: new Date(Date.now() + 24 * 60 * 60 * 1000).getTime(), + }); + } else { + const error = await response.json(); + alert(`Failed to create giveaway: ${error.error}`); + } + }; - const handleCreateGiveaway = async () => { - const response = await fetch("/api/admin/create-giveaway", { - method: "POST", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify(giveaway), - }); - if (response.ok) { - alert("Giveaway created successfully!"); - - setGiveaway({ title: "", description: "", value: 0, prize: "", entryCost: 70000000, duration: 0, endsAt: new Date(Date.now() + 24 * 60 * 60 * 1000).getTime() }); // Reset form - } else { - const error = await response.json(); - alert(`Failed to create giveaway: ${error.error}`); - } - }; + return ( +
+
+

Admin Dashboard

+

+ Welcome, {email}! +

- return ( -
-
-

Admin Dashboard

-

Welcome, {email}!

- - {/* Create Giveaway Form */} -
-

๐ŸŽ Create Giveaway

-
- setGiveaway({ ...giveaway, title: e.target.value })} - className="w-full p-3 border border-pink-200 rounded-lg bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-pink-400" - /> -