diff --git a/app/auth/page.tsx b/app/auth/page.tsx
index 932d056..7687f9e 100644
--- a/app/auth/page.tsx
+++ b/app/auth/page.tsx
@@ -6,21 +6,18 @@ import Cookies from "js-cookie";
import React, { useEffect, useState } from "react";
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(() => {
- // setHasMounted(true);
- // }, []);
+ useEffect(() => {
+ setHasMounted(true);
+ }, []);
- // // Render
- // if (!hasMounted) return null;
+ // Render
+ if (!hasMounted) return null;
- return ;
-
- // isAuthenticated == "true" ?
- // : ;
+ return isAuthenticated == "true" ? : ;
}
diff --git a/components/landing/CategorySatker.tsx b/components/landing/CategorySatker.tsx
index 13e0b5c..554bf94 100644
--- a/components/landing/CategorySatker.tsx
+++ b/components/landing/CategorySatker.tsx
@@ -23,6 +23,12 @@ export default function CategorySatker() {
const t = useTranslations("Landing");
const list = [
+ {
+ id: 6,
+ img: "/assets/satker2/yanma.png",
+ title: "Yanma",
+ path: "/news/yanma",
+ },
{
id: 1,
img: "/assets/satker2/siber.svg",
@@ -53,15 +59,21 @@ export default function CategorySatker() {
title: "Itwasum",
path: "/news/itwasum",
},
- {
- id: 6,
- img: "/assets/satker2/stik-ptik.svg",
- title: "STIK-PTIK",
- path: "/news/stik-ptik",
- },
+ // {
+ // id: 6,
+ // img: "/assets/satker2/stik-ptik.svg",
+ // title: "STIK-PTIK",
+ // path: "/news/stik-ptik",
+ // },
];
const SatkerAll = [
+ {
+ id: 36,
+ img: "/assets/satker2/yanma.png",
+ title: "Yanma",
+ path: "/news/yanma",
+ },
{
id: 1,
img: "/assets/satker2/siber.svg",
@@ -328,7 +340,13 @@ export default function CategorySatker() {
key={index}
className="w-[157px] h-[140px] flex flex-col items-center justify-evenly "
>
-
+
{item.title}
@@ -378,8 +396,10 @@ export default function CategorySatker() {
>
{" "}
diff --git a/components/landing/HeaderNews.tsx b/components/landing/HeaderNews.tsx
index 63870b3..73ae3aa 100644
--- a/components/landing/HeaderNews.tsx
+++ b/components/landing/HeaderNews.tsx
@@ -67,8 +67,8 @@ export default function HeaderNews() {
);
}}
>
- {article?.map((newsItem: any) => (
-
+ {article?.map((newsItem: any, index: number) => (
+
- {article?.map((data: any) => (
+ {article?.map((data: any, index: number) => (
- {article?.map((newsItem: any) => (
-
+ {article?.map((newsItem: any, index: number) => (
+
- {article?.map((list: any) => (
+ {article?.map((list: any, index: number) => (
diff --git a/components/landing/MedolUpdate.tsx b/components/landing/MedolUpdate.tsx
index bdec410..6af1378 100644
--- a/components/landing/MedolUpdate.tsx
+++ b/components/landing/MedolUpdate.tsx
@@ -33,13 +33,13 @@ export default function MedolUpdate() {
const t = useTranslations("Landing");
useEffect(() => {
- if (selectedTab === "mediahub" && mediahubUpdate.length < 1) {
+ if (selectedTab === "mediahub" && mediahubUpdate?.length < 1) {
getMedihubUpdate();
}
- if (selectedTab === "tbnews" && tbnUpdate.length < 1) {
+ if (selectedTab === "tbnews" && tbnUpdate?.length < 1) {
getTbnUpdate();
}
- if (selectedTab === "inp" && inpUpdate.length < 1) {
+ if (selectedTab === "inp" && inpUpdate?.length < 1) {
getInpUpdate();
}
}, [selectedTab]);
diff --git a/components/layout/navbar/NavbarHumas.tsx b/components/layout/navbar/NavbarHumas.tsx
index 8a8371c..f8226b2 100644
--- a/components/layout/navbar/NavbarHumas.tsx
+++ b/components/layout/navbar/NavbarHumas.tsx
@@ -68,11 +68,11 @@ export default function NavbarHumas(props: { size: string }) {
const language = storedLanguage((state) => state.locale);
const setLanguage = storedLanguage((state) => state.setLocale);
- // useEffect(() => {
- // if (!isAuthenticated) {
- // onLogout();
- // }
- // }, [token]);
+ useEffect(() => {
+ if (!isAuthenticated) {
+ onLogout();
+ }
+ }, [token]);
const onLogout = () => {
Object.keys(Cookies.get()).forEach((cookieName) => {
diff --git a/public/assets/satker/yanma.png b/public/assets/satker/yanma.png
new file mode 100644
index 0000000..18ecf97
Binary files /dev/null and b/public/assets/satker/yanma.png differ
diff --git a/public/assets/satker2/yanma.png b/public/assets/satker2/yanma.png
new file mode 100644
index 0000000..18ecf97
Binary files /dev/null and b/public/assets/satker2/yanma.png differ
diff --git a/service/third-party-service.ts b/service/third-party-service.ts
index 4cdaf63..32fd21e 100644
--- a/service/third-party-service.ts
+++ b/service/third-party-service.ts
@@ -7,7 +7,8 @@ const tbnInstance = 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: {
"content-type": "application/json",
},
@@ -39,7 +40,7 @@ async function inpGetNews(pathUrl: any, headers: any) {
const response = await inpInstance
.get(pathUrl, { headers })
.catch(function (error: any) {
- console.log(error);
+ console.log(error, "inp");
return error.response;
});
console.log("Response base svc : ", response);
@@ -71,6 +72,7 @@ export async function topNewsInp() {
const headers = {
"content-type": "application/json",
};
+ // return await inpGetNews(`/media`, headers);
return await inpGetNews(`/artikel/data?per_page=10&page=1`, headers);
}