From 33096ab7c1b66b19f55f620c0d8bcd3517fcf555 Mon Sep 17 00:00:00 2001 From: Ardeman Date: Thu, 20 Mar 2025 18:16:15 +0800 Subject: [PATCH] feat: enhance loading state in CarouselHero with ImageSkeletonIcon --- app/components/ui/carousel-hero.tsx | 86 +++++++++++++++++++---------- 1 file changed, 58 insertions(+), 28 deletions(-) diff --git a/app/components/ui/carousel-hero.tsx b/app/components/ui/carousel-hero.tsx index a381bfa..4923028 100644 --- a/app/components/ui/carousel-hero.tsx +++ b/app/components/ui/carousel-hero.tsx @@ -4,6 +4,7 @@ import { Await, useRouteLoaderData } from 'react-router' import { stripHtml } from 'string-strip-html' import { ErrorAwait } from '~/components/error/await' +import { ImageSkeletonIcon } from '~/components/icons/image-skeleton' import { CarouselButton } from '~/components/ui/button-slide' import { useNewsContext } from '~/contexts/news' import type { loader } from '~/routes/_news' @@ -74,7 +75,38 @@ export const CarouselHero = (properties: TNews) => { ref={emblaReference} >
- Loading...
}> + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading... +
+ } + > } @@ -86,36 +118,34 @@ export const CarouselHero = (properties: TNews) => { index, ) => (
-
- {title} -
-
-

- {title} -

-

- {stripHtml(content).result} -

-
- + {title} +
+
+

+ {title} +

+

+ {stripHtml(content).result} +

+
),