diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7c2705d..29e82d3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,9 +7,10 @@ build-dev: when: on_success only: - main - image: docker:stable + image: + name: docker:25.0.3-cli services: - - name: docker:dind + - name: docker:25.0.3-dind command: ["--insecure-registry=103.82.242.92:8900"] script: - docker logout @@ -26,4 +27,4 @@ auto-deploy: services: - docker:dind script: - - curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-asuransi-aman/build?token=autodeploymedols \ No newline at end of file + - curl --user admin:$JENKINS_PWD http://38.47.180.165:8080/job/auto-deploy-asuransi-aman/build?token=autodeploymedols diff --git a/app/page.tsx b/app/page.tsx index 5b2481c..59bd637 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,18 +1,25 @@ +import Development from "@/components/landing-page/development"; import Footer from "@/components/landing-page/footer"; -import HeaderNews from "@/components/landing-page/headers"; +import Header from "@/components/landing-page/header"; +import NewsTerkini from "@/components/landing-page/health"; +import LatestNews from "@/components/landing-page/latest-news"; import Navbar from "@/components/landing-page/navbar"; -import Story from "@/components/landing-page/story"; -import Image from "next/image"; +import OpinionNews from "@/components/landing-page/opinion-news"; +import YouTubeSection from "@/components/landing-page/youtube-selection"; export default function Home() { return (
-
- -
- +
+
+
+ + + + +
); diff --git a/components/landing-page/development.tsx b/components/landing-page/development.tsx new file mode 100644 index 0000000..d659243 --- /dev/null +++ b/components/landing-page/development.tsx @@ -0,0 +1,136 @@ +"use client"; +import { useEffect, useState } from "react"; +import Image from "next/image"; +import { getListArticle } from "@/service/article"; +import Link from "next/link"; + +type Article = { + id: number; + title: string; + description: string; + categoryName: string; + slug: string; + createdAt: string; + publishedAt: string; + createdByName: string; + customCreatorName: string; + thumbnailUrl: string; + categories: { title: string }[]; + files: { fileUrl: string; file_alt: string }[]; +}; + +export default function Development() { + const [articles, setArticles] = useState([]); + const [page, setPage] = useState(1); + const [totalPage, setTotalPage] = useState(1); + + useEffect(() => { + initState(); + }, [page]); + + async function initState() { + const req = { + limit: "10", + page, + search: "", + categorySlug: "", + sort: "desc", + isPublish: true, + sortBy: "created_at", + }; + + try { + const res = await getListArticle(req); + setArticles(res?.data?.data || []); + setTotalPage(res?.data?.meta?.totalPage || 1); + } catch (err) { + console.error("Error fetching articles:", err); + } + } + + // Format tanggal ke gaya lokal + const formatDate = (dateString: string) => { + const date = new Date(dateString); + return date.toLocaleDateString("id-ID", { + day: "2-digit", + month: "long", + year: "numeric", + }); + }; + + // Mapping struktur seperti dummy sebelumnya + const leftMain = articles[0]; + const leftList = articles.slice(1, 4); + const centerMain = articles[4]; + const centerList = articles.slice(5, 8); + const rightMain = articles[8]; + const rightList = articles.slice(9, 12); + + return ( +
+
+
+

JAGA NEGERI

+ +
+
+ +
+ +
+ {articles.slice(0, 6).map((item) => ( + +
+ {item.title} +
+ +
+

+ + {item.categories?.[0]?.title || "Kategori"} + +

+ +

+ {item.title} +

+ +

+ By{" "} + + {item.customCreatorName} + +

+ +

+ {new Date(item.publishedAt).toLocaleDateString("id-ID", { + day: "numeric", + month: "long", + year: "numeric", + })} +

+
+ + ))} +
+
+ Berita Utama +
+
+
+ ); +} diff --git a/components/landing-page/footer.tsx b/components/landing-page/footer.tsx index 897f461..e54971f 100644 --- a/components/landing-page/footer.tsx +++ b/components/landing-page/footer.tsx @@ -1,9 +1,69 @@ +// components/Footer.tsx +import Image from "next/image"; +import { Facebook, Twitter, Instagram, Youtube } from "lucide-react"; +import Link from "next/link"; + export default function Footer() { return ( -