inp update, yanma update

This commit is contained in:
Rama Priyanto 2025-02-12 15:20:38 +07:00
parent f2e3d7f731
commit d641681ee4
8 changed files with 57 additions and 38 deletions

View File

@ -6,21 +6,18 @@ import Cookies from "js-cookie";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
export default function AuthPage() { export default function AuthPage() {
// const isAuthenticated = Cookies.get("is_authenticated") || "false"; const isAuthenticated = Cookies.get("is_authenticated") || "false";
// console.log("isAuthenticated : ", isAuthenticated); console.log("isAuthenticated : ", isAuthenticated);
// const [hasMounted, setHasMounted] = useState(false); const [hasMounted, setHasMounted] = useState(false);
// useEffect(() => { useEffect(() => {
// setHasMounted(true); setHasMounted(true);
// }, []); }, []);
// // Render // Render
// if (!hasMounted) return null; if (!hasMounted) return null;
return <Login />; return isAuthenticated == "true" ? <Login /> : <QudoLogin />;
// isAuthenticated == "true" ?
// : <QudoLogin />;
} }

View File

@ -23,6 +23,12 @@ export default function CategorySatker() {
const t = useTranslations("Landing"); const t = useTranslations("Landing");
const list = [ const list = [
{
id: 6,
img: "/assets/satker2/yanma.png",
title: "Yanma",
path: "/news/yanma",
},
{ {
id: 1, id: 1,
img: "/assets/satker2/siber.svg", img: "/assets/satker2/siber.svg",
@ -53,15 +59,21 @@ export default function CategorySatker() {
title: "Itwasum", title: "Itwasum",
path: "/news/itwasum", path: "/news/itwasum",
}, },
{ // {
id: 6, // id: 6,
img: "/assets/satker2/stik-ptik.svg", // img: "/assets/satker2/stik-ptik.svg",
title: "STIK-PTIK", // title: "STIK-PTIK",
path: "/news/stik-ptik", // path: "/news/stik-ptik",
}, // },
]; ];
const SatkerAll = [ const SatkerAll = [
{
id: 36,
img: "/assets/satker2/yanma.png",
title: "Yanma",
path: "/news/yanma",
},
{ {
id: 1, id: 1,
img: "/assets/satker2/siber.svg", img: "/assets/satker2/siber.svg",
@ -328,7 +340,13 @@ export default function CategorySatker() {
key={index} key={index}
className="w-[157px] h-[140px] flex flex-col items-center justify-evenly " className="w-[157px] h-[140px] flex flex-col items-center justify-evenly "
> >
<Image radius="lg" src={item.img} /> <Image
radius="lg"
src={item.img}
className="w-10 h-10"
height={480}
width={480}
/>
<p className="text-xs font-bold text-white">{item.title}</p> <p className="text-xs font-bold text-white">{item.title}</p>
</div> </div>
</Link> </Link>
@ -378,8 +396,10 @@ export default function CategorySatker() {
> >
{" "} {" "}
<Image <Image
height={480}
width={480}
radius="lg" radius="lg"
className="h-[59px] " className="h-[59px] w-[50px]"
src={item.img} src={item.img}
/> />
</Link> </Link>

View File

@ -67,8 +67,8 @@ export default function HeaderNews() {
); );
}} }}
> >
{article?.map((newsItem: any) => ( {article?.map((newsItem: any, index: number) => (
<SwiperSlide key={newsItem.id}> <SwiperSlide key={newsItem.id + index}>
<Card isFooterBlurred radius="lg" className="border-none"> <Card isFooterBlurred radius="lg" className="border-none">
<Image <Image
width={1920} width={1920}
@ -113,10 +113,10 @@ export default function HeaderNews() {
{t("berita")} {t("berita")}
</p> </p>
<ScrollShadow hideScrollBar className="h-[34vh] lg:h-[53vh] "> <ScrollShadow hideScrollBar className="h-[34vh] lg:h-[53vh] ">
{article?.map((data: any) => ( {article?.map((data: any, index: number) => (
<div <div
className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md flex flex-row gap-2" className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md flex flex-row gap-2"
key={data.id} key={data.id + index}
> >
<Image <Image
height={480} height={480}
@ -197,8 +197,8 @@ export default function HeaderNews() {
); );
}} }}
> >
{article?.map((newsItem: any) => ( {article?.map((newsItem: any, index: number) => (
<SwiperSlide key={newsItem.id} className="h-[67vh]"> <SwiperSlide key={newsItem.id + index} className="h-[67vh]">
<Card <Card
isFooterBlurred isFooterBlurred
radius="lg" radius="lg"
@ -271,9 +271,9 @@ export default function HeaderNews() {
{selectedTab === "media" ? ( {selectedTab === "media" ? (
<div className="lg:!h-[62vh] p-2 dark:bg-stone-800 bg-[#f0f0f0] dark:text-white text-black rounded-lg"> <div className="lg:!h-[62vh] p-2 dark:bg-stone-800 bg-[#f0f0f0] dark:text-white text-black rounded-lg">
<ScrollShadow hideScrollBar className=" h-[54vh]"> <ScrollShadow hideScrollBar className=" h-[54vh]">
{article?.map((list: any) => ( {article?.map((list: any, index: number) => (
<div <div
key={list.id} key={list.id + index}
className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md" className="text-xs text-left m-2 p-2 dark:bg-[#1E1616] bg-white rounded-md"
> >
<Link href={`news/detail/${list?.id}`}> <Link href={`news/detail/${list?.id}`}>

View File

@ -33,13 +33,13 @@ export default function MedolUpdate() {
const t = useTranslations("Landing"); const t = useTranslations("Landing");
useEffect(() => { useEffect(() => {
if (selectedTab === "mediahub" && mediahubUpdate.length < 1) { if (selectedTab === "mediahub" && mediahubUpdate?.length < 1) {
getMedihubUpdate(); getMedihubUpdate();
} }
if (selectedTab === "tbnews" && tbnUpdate.length < 1) { if (selectedTab === "tbnews" && tbnUpdate?.length < 1) {
getTbnUpdate(); getTbnUpdate();
} }
if (selectedTab === "inp" && inpUpdate.length < 1) { if (selectedTab === "inp" && inpUpdate?.length < 1) {
getInpUpdate(); getInpUpdate();
} }
}, [selectedTab]); }, [selectedTab]);

View File

@ -68,11 +68,11 @@ export default function NavbarHumas(props: { size: string }) {
const language = storedLanguage((state) => state.locale); const language = storedLanguage((state) => state.locale);
const setLanguage = storedLanguage((state) => state.setLocale); const setLanguage = storedLanguage((state) => state.setLocale);
// useEffect(() => { useEffect(() => {
// if (!isAuthenticated) { if (!isAuthenticated) {
// onLogout(); onLogout();
// } }
// }, [token]); }, [token]);
const onLogout = () => { const onLogout = () => {
Object.keys(Cookies.get()).forEach((cookieName) => { Object.keys(Cookies.get()).forEach((cookieName) => {

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 562 KiB

View File

@ -7,7 +7,8 @@ const tbnInstance = axios.create({
}, },
}); });
const inpInstance = axios.create({ const inpInstance = axios.create({
baseURL: "https://inp.demoaplikasi.web.id/api", baseURL: "https://inp.polri.go.id/api",
// baseURL: "https://inp.indoplusmedia.id/wp-json/wp/v2/posts",
headers: { headers: {
"content-type": "application/json", "content-type": "application/json",
}, },
@ -39,7 +40,7 @@ async function inpGetNews(pathUrl: any, headers: any) {
const response = await inpInstance const response = await inpInstance
.get(pathUrl, { headers }) .get(pathUrl, { headers })
.catch(function (error: any) { .catch(function (error: any) {
console.log(error); console.log(error, "inp");
return error.response; return error.response;
}); });
console.log("Response base svc : ", response); console.log("Response base svc : ", response);
@ -71,6 +72,7 @@ export async function topNewsInp() {
const headers = { const headers = {
"content-type": "application/json", "content-type": "application/json",
}; };
// return await inpGetNews(`/media`, headers);
return await inpGetNews(`/artikel/data?per_page=10&page=1`, headers); return await inpGetNews(`/artikel/data?per_page=10&page=1`, headers);
} }