Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/components/ui/Skeleton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SkeletonProps {
* Compose multiple <Skeleton /> elements to build page-level loading states.
*/
const Skeleton: React.FC<SkeletonProps> = ({ className = "" }) => (
<div className={`animate-pulse bg-gray-700 rounded ${className}`} />
<div className={`animate-pulse bg-gray-200 dark:bg-white/5 rounded-2xl ${className}`} />
);

export default Skeleton;
3 changes: 2 additions & 1 deletion client/src/pages/CreatorProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import RaffleCard from "../components/cards/RaffleCard";
import { mapListItemToCardProps } from "../services/raffleService";
import ErrorMessage from "../components/ui/ErrorMessage";
import { Spinner } from "../components/ui/Spinner";
import Skeleton from "../components/ui/Skeleton";

const CreatorProfile: React.FC = () => {
const { address } = useParams<{ address: string }>();
Expand Down Expand Up @@ -123,7 +124,7 @@ const CreatorProfile: React.FC = () => {
{rafflesLoading && page === 0 ? (
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
{[1, 2, 3, 4].map((n) => (
<div key={n} className="h-[450px] bg-white dark:bg-[#11172E] rounded-3xl animate-pulse" />
<Skeleton key={n} className="h-[450px] rounded-3xl" />
))}
</div>
) : rafflesError ? (
Expand Down
5 changes: 3 additions & 2 deletions client/src/pages/MyRaffles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useWallet } from "../hooks/useWallet";
import { useUserProfile, useUserHistory } from "../hooks/useRaffles";
import ErrorMessage from "../components/ui/ErrorMessage";
import { Breadcrumbs } from "../components/ui/Breadcrumbs";
import Skeleton from "../components/ui/Skeleton";
import type { ApiUserHistoryItem } from "../types/types";

// ── Status badge ──────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -196,7 +197,7 @@ const MyRaffles: React.FC = () => {
return (
<div className="space-y-3">
{[1, 2, 3].map((i) => (
<div key={i} className="h-20 bg-gray-100 dark:bg-[#1E1932] rounded-xl animate-pulse" />
<Skeleton key={i} className="h-20 rounded-xl" />
))}
</div>
);
Expand Down Expand Up @@ -288,7 +289,7 @@ const MyRaffles: React.FC = () => {
</div>
)}
{profileLoading && (
<div className="h-28 bg-white dark:bg-[#1E1932] rounded-2xl animate-pulse mb-8" />
<Skeleton className="h-28 rounded-2xl mb-8" />
)}

{/* Tabs */}
Expand Down
15 changes: 8 additions & 7 deletions client/src/pages/RaffleDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import EnterRaffleButton from "../components/EnterRaffleButton";
import detailimage from "../assets/detailimage.png";
import { Breadcrumbs } from "../components/ui/Breadcrumbs";
import { Helmet } from "react-helmet-async";
import Skeleton from "../components/ui/Skeleton";

const RaffleDetails = () => {
const { id } = useParams();
Expand Down Expand Up @@ -69,13 +70,13 @@ const RaffleDetails = () => {
if (isLoading) {
return (
<div className="w-full mx-auto max-w-7xl px-6 md:px-12 lg:px-16 flex flex-col">
<div className="bg-white dark:bg-[#11172E] p-8 rounded-3xl animate-pulse">
<div className="w-full h-64 bg-gray-700 rounded-3xl mb-6"></div>
<div className="h-8 bg-gray-700 rounded mb-4"></div>
<div className="h-4 bg-gray-700 rounded mb-2"></div>
<div className="h-4 bg-gray-700 rounded mb-2"></div>
<div className="h-4 bg-gray-700 rounded mb-6"></div>
<div className="h-12 bg-gray-700 rounded-xl"></div>
<div className="bg-white dark:bg-[#11172E] p-8 rounded-3xl space-y-4">
<Skeleton className="w-full h-64 rounded-3xl" />
<Skeleton className="h-8 w-3/4" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-2/3" />
<Skeleton className="h-12 w-full rounded-xl" />
</div>
</div>
);
Expand Down
5 changes: 1 addition & 4 deletions client/src/pages/RafflePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ import {
Bell
} from "lucide-react";
import AddToCalendar from "../components/ui/AddToCalendar";
import Skeleton from "../components/ui/Skeleton";
import Line from "../assets/svg/Line";
import detailimage from "../assets/detailimage.png";
import { Breadcrumbs } from "../components/ui/Breadcrumbs";
import { Helmet } from "react-helmet-async";
import { useTranslation } from "react-i18next";
import { CountdownTimer } from "../components/ui/CountdownTimer";

const Skeleton = ({ className }: { className?: string }) => (
<div className={`animate-pulse bg-gray-200 dark:bg-white/5 rounded-2xl ${className}`} />
);

const RafflePage = () => {
const { t } = useTranslation();
const { id } = useParams<{ id: string }>();
Expand Down
Loading