diff --git a/app/app.css b/app/app.css index 4ef6f59..99be541 100644 --- a/app/app.css +++ b/app/app.css @@ -41,7 +41,7 @@ table.dataTable tbody > tr > td { min-width: 0; } */ -.embla__slide { +/* .embla__slide { margin-right: 10px; flex: 0 0 auto; min-width: 0; @@ -51,4 +51,4 @@ table.dataTable tbody > tr > td { .embla__slide { margin-right: 30px; } -} +} */ diff --git a/app/components/ui/banner.tsx b/app/components/ui/banner.tsx index 32d4392..781730d 100644 --- a/app/components/ui/banner.tsx +++ b/app/components/ui/banner.tsx @@ -4,7 +4,7 @@ import { APP } from '~/configs/meta' export const Banner = () => { return ( -
+
{ className="embla overflow-hidden" ref={emblaReference} > -
+ {/*
{items.map( ({ featured, title, content, tags, slug, isPremium }, index) => (
{
), )} +
*/} +
+ {items.map( + ({ featured, title, content, tags, slug, isPremium }, index) => ( +
+ {title} +
+
+ {tags?.map((item) => ( + + {item} + + ))} + {isPremium && ( + + Premium Content + + )} +
+ +
+

+ {title} +

+

+ {content} +

+
+ +
+
+ ), + )}
+ + //
+ //
+ //
+ //

+ // {title} + //

+ //

+ // {description} + //

+ //
+ //
+ + //
+ // {items.map( + // ({ featured, title, content, tags, slug, isPremium }, index) => ( + //
+ // {title} + //
+ //
+ // {tags?.map((item) => ( + // + // {item} + // + // ))} + // {isPremium && ( + // + // Premium Content + // + // )} + //
+ + //
+ //

+ // {title} + //

+ //

+ // {content} + //

+ //
+ // + //
+ //
+ // ), + // )} + //
+ + //
+ //
+ // + // + //
+ //
+ //
) } diff --git a/app/components/ui/category-section.tsx b/app/components/ui/category-section.tsx new file mode 100644 index 0000000..fce4512 --- /dev/null +++ b/app/components/ui/category-section.tsx @@ -0,0 +1,123 @@ +import { Link } from 'react-router' +import { twMerge } from 'tailwind-merge' + +import { CarouselNextIcon } from '~/components/icons/carousel-next' +import { CarouselPreviousIcon } from '~/components/icons/carousel-previous' +import { Button } from '~/components/ui/button' +import { useNewsContext } from '~/contexts/news' +import type { TNews } from '~/types/news' + +export const CategorySection = (properties: TNews) => { + const { setIsSuccessOpen } = useNewsContext() + + const { title, description, items } = properties + + const nextSlide = () => { + // patch data next page + } + + const previousSlide = () => { + // patch previous page + } + + return ( +
+
+
+

+ {title} +

+

+ {description} +

+
+
+ +
+ {items.map( + ({ featured, title, content, tags, slug, isPremium }, index) => ( +
+ {title} +
+
+ {tags?.map((item) => ( + + {item} + + ))} + {isPremium && ( + + Premium Content + + )} +
+ +
+

+ {title} +

+

+ {content} +

+
+ +
+
+ ), + )} +
+ +
+
+ + +
+
+
+ ) +} diff --git a/app/pages/news-categories/index.tsx b/app/pages/news-categories/index.tsx index e3adf23..1e8768d 100644 --- a/app/pages/news-categories/index.tsx +++ b/app/pages/news-categories/index.tsx @@ -1,13 +1,13 @@ import { Card } from '~/components/ui/card' -import { Carousel } from '~/components/ui/carousel' +import { CategorySection } from '~/components/ui/category-section' import { BERITA } from './data' export const NewsCategoriesPage = () => { return ( -
+
- +
) diff --git a/app/pages/news/index.tsx b/app/pages/news/index.tsx index f4b95d0..9004fcb 100644 --- a/app/pages/news/index.tsx +++ b/app/pages/news/index.tsx @@ -2,8 +2,7 @@ import { Card } from '~/components/ui/card' import { CarouselHero } from '~/components/ui/carousel-hero' import { CarouselSection } from '~/components/ui/carousel-section' import { Newsletter } from '~/components/ui/newsletter' - -import { SPOTLIGHT, BERITA } from './data' +import { BERITA, SPOTLIGHT } from '~/data/contents' export const NewsPage = () => { return (