From aaba2071659b6b96b24fd461a8b81be2ef76c879 Mon Sep 17 00:00:00 2001 From: "fredy.siswanto" Date: Sun, 2 Mar 2025 12:15:31 +0700 Subject: [PATCH] feat: add KAJIAN section to news page and update content structure --- app/components/ui/carousel-section.tsx | 176 +------------------------ app/data/contents.ts | 32 ++++- app/pages/news-detail/index.tsx | 7 +- app/pages/news/index.tsx | 13 +- 4 files changed, 43 insertions(+), 185 deletions(-) diff --git a/app/components/ui/carousel-section.tsx b/app/components/ui/carousel-section.tsx index 0597254..a348b91 100644 --- a/app/components/ui/carousel-section.tsx +++ b/app/components/ui/carousel-section.tsx @@ -1,7 +1,6 @@ import useEmblaCarousel from 'embla-carousel-react' import { useCallback } from 'react' import { Link } from 'react-router' -import { twMerge } from 'tailwind-merge' import { CarouselNextIcon } from '~/components/icons/carousel-next' import { CarouselPreviousIcon } from '~/components/icons/carousel-previous' @@ -55,21 +54,21 @@ export const CarouselSection = (properties: TNews) => { className="embla overflow-hidden" ref={emblaReference} > - {/*
+
{items.map( ({ featured, title, content, tags, slug, isPremium }, index) => (
-
+
{title}
-
+
{tags?.map((item) => ( { }, to: '', } - : { as: Link, to: `/news/detail/${slug}` })} + : { as: Link, to: `/detail/${slug}` })} className="mb-5" > View More @@ -112,173 +111,8 @@ export const CarouselSection = (properties: TNews) => {
), )} -
*/} -
- {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/data/contents.ts b/app/data/contents.ts index 2606211..cb2233b 100644 --- a/app/data/contents.ts +++ b/app/data/contents.ts @@ -89,29 +89,47 @@ export const BERITA: TNews = { export const KAJIAN: TNews = { title: 'KAJIAN', - description: 'Berita Terhangat hari ini', + description: 'Berita Terhangat hari ini ', type: 'grid', items: [ { - title: 'Travelling as a way of self-discovery and progress', + title: 'Travelling as a way of self-discovery and progress ', content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', featured: '/images/news-2.jpg', tags: ['Hukum Property'], isPremium: true, - slug: 'travelling-as-a-way-of-self-discovery-and-progress', + slug: 'travelling-as-a-way-of-self-discovery-and-progress ', }, { - title: 'Travelling as a way of self-discovery and progress', + title: 'Travelling as a way of self-discovery and progress ', + content: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', + featured: '/images/news-2.jpg', + tags: ['Hukum Property'], + isPremium: true, + slug: 'travelling-as-a-way-of-self-discovery-and-progress ', + }, + { + title: 'Travelling as a way of self-discovery and progress ', + content: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', + featured: '/images/news-2.jpg', + tags: ['Hukum Property'], + isPremium: true, + slug: 'travelling-as-a-way-of-self-discovery-and-progress ', + }, + { + title: 'Travelling as a way of self-discovery and progress ', content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', featured: 'https://placehold.co/600x400.png', tags: ['Hukum Property'], isPremium: true, - slug: 'travelling-as-a-way-of-self-discovery-and-progress', + slug: 'travelling-as-a-way-of-self-discovery-and-progress ', }, { - title: 'How does writing influence your personal brand?', + title: 'How does writing influence your personal brand? ', content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', featured: '/images/news-3.jpg', @@ -120,7 +138,7 @@ export const KAJIAN: TNews = { slug: 'how-does-writing-influence-your-personal-brand', }, { - title: 'Helping a local business reinvent itself', + title: 'Helping a local business reinvent itself ', content: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros.', featured: '/images/news-4.jpg', diff --git a/app/pages/news-detail/index.tsx b/app/pages/news-detail/index.tsx index eea5db5..954d239 100644 --- a/app/pages/news-detail/index.tsx +++ b/app/pages/news-detail/index.tsx @@ -4,13 +4,14 @@ import { Breadcrumb } from '~/components/ui/breadcrumb' import { Card } from '~/components/ui/card' import { CarouselSection } from '~/components/ui/carousel-section' import { IconsSocial } from '~/components/ui/social-share' +import { BERITA } from '~/data/contents' -import { BERITA, CONTENT } from './data' +import { CONTENT } from './data' export const NewsDetailPage = () => { const { title, content, featured, slug, author, date, tags } = CONTENT return ( -
+
@@ -80,7 +81,7 @@ export const NewsDetailPage = () => {
- +
diff --git a/app/pages/news/index.tsx b/app/pages/news/index.tsx index 9004fcb..4ca0737 100644 --- a/app/pages/news/index.tsx +++ b/app/pages/news/index.tsx @@ -2,7 +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 { BERITA, SPOTLIGHT } from '~/data/contents' +import { BERITA, KAJIAN, SPOTLIGHT } from '~/data/contents' export const NewsPage = () => { return ( @@ -13,9 +13,14 @@ export const NewsPage = () => {
- - - +
+ + + + + + +
) }