diff --git a/src/components/donate/DonorWall.tsx b/src/components/donate/DonorWall.tsx index 9c7140f1..98645978 100644 --- a/src/components/donate/DonorWall.tsx +++ b/src/components/donate/DonorWall.tsx @@ -5,7 +5,7 @@ interface Donor { name: string; amount: number; message?: string; - date: string; + date: string; // Consider using a Date object for better date handling } interface DonorWallProps { @@ -14,28 +14,35 @@ interface DonorWallProps { export function DonorWall({ donors }: DonorWallProps) { return ( -
-

Recent Supporters

+
+

+ Recent Supporters +

-
+
{donors.map((donor, index) => ( - + ))} diff --git a/src/components/donate/KeySponsors.tsx b/src/components/donate/KeySponsors.tsx index cce34375..f2884683 100644 --- a/src/components/donate/KeySponsors.tsx +++ b/src/components/donate/KeySponsors.tsx @@ -4,40 +4,40 @@ import { motion } from 'framer-motion'; // Dummy list of sponsors with GitHub usernames const keySponsors = [ { - username: 'TIAsCode', // GitHub username + username: 'TIAsCode', description: 'Enterprise Partner & Server Provider', - amount: '₹82,025.36', // Example of amount, could be fetched or hardcoded + amount: '₹82,025.36', }, { - username: 'ixintl', // GitHub username + username: 'ixintl', description: 'Strategic Development Partner', - amount: '₹54,399.36', // Example of amount, could be fetched or hardcoded + amount: '₹54,399.36', }, { - username: 'SkullSync', // GitHub username + username: 'SkullSync', description: 'Strategic Development Partner', - amount: '₹12,181.36', // Example of amount, could be fetched or hardcoded + amount: '₹12,181.36', }, ]; // Dummy list of individual donors with GitHub usernames const individualDonors = [ { - username: 'd3v1l0n', // GitHub username - amount: '₹4,183.00', // Example of donation amount + username: 'd3v1l0n', + amount: '₹4,183.00', }, { - username: 'myself-meghna', // GitHub username - amount: '₹8,554', // Example of donation amount + username: 'myself-meghna', + amount: '₹8,554', }, { - username: 'lawrencecracker', // GitHub username - amount: '₹3,220', // Example of donation amount + username: 'lawrencecracker', + amount: '₹3,220', }, ]; // Fetch GitHub user data -async function fetchGitHubUser(username: string) { +async function fetchGitHubUser (username: string) { const response = await fetch(`https://api.github.com/users/${username}`); const data = await response.json(); return data; @@ -46,44 +46,49 @@ async function fetchGitHubUser(username: string) { export function KeySponsors() { const [sponsorsData, setSponsorsData] = useState([]); const [donorsData, setDonorsData] = useState([]); + const [loading, setLoading] = useState(true); // Fetch sponsor and donor data from GitHub useEffect(() => { const fetchSponsorsAndDonorsData = async () => { - // Fetching data for sponsors + setLoading(true); const sponsorsWithData = await Promise.all( keySponsors.map(async (sponsor) => { - const user = await fetchGitHubUser(sponsor.username); + const user = await fetchGitHubUser (sponsor.username); return { ...sponsor, name: user.name || sponsor.username, - avatar_url: user.avatar_url, // Fetch GitHub profile picture + avatar_url: user.avatar_url, }; }) ); setSponsorsData(sponsorsWithData); - // Fetching data for donors const donorsWithData = await Promise.all( individualDonors.map(async (donor) => { - const user = await fetchGitHubUser(donor.username); + const user = await fetchGitHubUser (donor.username); return { ...donor, name: user.name || donor.username, - avatar_url: user.avatar_url, // Fetch GitHub profile picture + avatar_url: user.avatar_url, }; }) ); setDonorsData(donorsWithData); + setLoading(false); }; fetchSponsorsAndDonorsData(); }, []); + if (loading) { + return
Loading...
; + } + return (
{/* Key Sponsors Section */} -
+

Key Sponsors

@@ -94,15 +99,14 @@ export function KeySponsors() { initial={{ opacity: 0, y: 20 }} whileInView={{ opacity: 1, y: 0 }} transition={{ delay: index * 0.1 }} - className="bg-white/90 backdrop-blur-sm rounded-xl p-6 border border-cornflower-blue/20 shadow-xl hover:shadow-2xl transition-shadow" + className="bg-white rounded-xl p-6 border border-cornflower-blue/20 shadow-lg hover:shadow-2xl transition-shadow duration-300" >
- {/* Displaying the profile picture */} {sponsor.name}
@@ -119,7 +123,7 @@ export function KeySponsors() {
{/* Individual Donors Section */} -
+

Individual Donors

@@ -130,15 +134,14 @@ export function KeySponsors() { initial={{ opacity: 0, y: 20 }} whileInView={{ opacity: 1, y: 0 }} transition={{ delay: index * 0.1 }} - className="bg-white/90 backdrop-blur-sm rounded-xl p-6 border border-indigo-200/50 shadow-md hover:shadow-lg transition-shadow" + className="bg-white rounded-xl p-6 border border-indigo-200/50 shadow-md hover:shadow-lg transition-shadow duration-300" >
- {/* Displaying the profile picture */} {donor.name}
@@ -155,4 +158,4 @@ export function KeySponsors() {
); -} +} \ No newline at end of file