From 0f5862ce701c10b0180ea255c3900c62335ae877 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Mon, 8 Dec 2025 16:34:33 +0800 Subject: [PATCH 1/2] Fix Apple Reject: Add: - app/(application)/(user)/forum/terms.tsx Fix: - app/(application)/(user)/_layout.tsx - app/(application)/(user)/home.tsx - screens/Home/tabsList.ts - service/api-client/api-user.ts ### No Issue --- app/(application)/(user)/_layout.tsx | 7 + app/(application)/(user)/forum/terms.tsx | 202 +++++++++++++++++++++++ app/(application)/(user)/home.tsx | 53 ++++-- screens/Home/tabsList.ts | 4 +- service/api-client/api-user.ts | 10 ++ 5 files changed, 256 insertions(+), 20 deletions(-) create mode 100644 app/(application)/(user)/forum/terms.tsx diff --git a/app/(application)/(user)/_layout.tsx b/app/(application)/(user)/_layout.tsx index b55638e..d567847 100644 --- a/app/(application)/(user)/_layout.tsx +++ b/app/(application)/(user)/_layout.tsx @@ -595,6 +595,13 @@ export default function UserLayout() { headerLeft: () => , }} /> + , + }} + /> {/* ========== Maps Section ========= */} { + try { + setLoading(true); + const respone = await apiAcceptForumTerms({ + category: "Forum", + userId: user?.id as any, + }); + + if (respone.success) { + Toast.show({ + type: "success", + text1: "Berhasil", + text2: "Terima kasih telah menerima syarat & ketentuan forum ini", + }); + + router.replace("/(application)/forum"); + + return; + } + + Toast.show({ + type: "error", + text1: "Gagal", + text2: "Terjadi kesalahan, silahkan coba lagi", + }); + } catch (error) { + console.log("[ERROR]", error); + } finally { + setLoading(false); + } + }; + + return ( + + {/* HIPMI Badung Connect . */} + + + + + Dengan mengakses dan menggunakan Forum HIPMI Badung Connect, Anda + secara sadar menyetujui ketentuan berikut: + + + + 1. Dilarang keras memposting konten yang mengandung: + + + {forumTerms1.map((term, index) => ( + + + {term.text} + + ))} + + + + 2. Setiap pengguna bertanggung jawab penuh atas konten yang + diunggah. Konten yang melanggar ketentuan ini dapat dihapus kapan + saja tanpa pemberitahuan. + + + + 3. Jika Anda menemukan konten tidak pantas, segera: + + + {forumTerms2.map((term, index) => ( + + + {term.text} + + ))} + + + + 4. Gunakan fitur “Blokir Pengguna” di profil pengguna terkait + + + {forumTerms3.map((term, index) => ( + + + {term.text} + + ))} + + + + Pelanggaran terhadap ketentuan ini berakibat{" "} + pencabutan akses ke Forum dan/atau{" "} + pemblokiran akun secara permanen tanpa + pemberitahuan lebih lanjut. + + + + setTerm(!term)} /> + + + Saya telah membaca dan menyetujui Syarat & Ketentuan Forum ini + + + + { + handleSubmit(); + }} + > + Lanjut + + + + + ); +} + +// Data dalam format JSON (bisa juga diimpor dari file terpisah) +interface Term { + text: string; +} + +const forumTerms1: Term[] = [ + { + text: "Ujaran kebencian, diskriminasi, atau konten SARA (Suku, Agama, Ras, Antar-golongan)", + }, + { text: "Kata kasar, pelecehan, ancaman, atau bullying" }, + { text: "Pornografi, hoaks, spam, atau informasi menyesatkan" }, + { text: "Promosi aktivitas ilegal seperti perjudian atau narkoba" }, +]; + +const forumTerms2: Term[] = [ + { + text: "Gunakan tombol “Laporkan” di setiap postingan, atau", + }, + { + text: "Gunakan fitur “Blokir Pengguna” di profil pengguna terkait.", + }, +]; + +const forumTerms3: Term[] = [ + { + text: "Meninjau setiap laporan dalam waktu 24 jam", + }, + { + text: "Menghapus konten yang melanggar", + }, + { + text: "Memblokir akun pelanggar sesuai tingkat pelanggaran", + }, +]; diff --git a/app/(application)/(user)/home.tsx b/app/(application)/(user)/home.tsx index 28c45f7..645280a 100644 --- a/app/(application)/(user)/home.tsx +++ b/app/(application)/(user)/home.tsx @@ -11,35 +11,44 @@ import Home_FeatureSection from "@/screens/Home/topFeatureSection"; import { apiUser } from "@/service/api-client/api-user"; import { apiVersion } from "@/service/api-config"; import { Ionicons } from "@expo/vector-icons"; -import { Redirect, router, Stack } from "expo-router"; -import { useEffect, useState } from "react"; +import { Redirect, router, Stack, useFocusEffect } from "expo-router"; +import { useCallback, useEffect, useState } from "react"; +import { RefreshControl } from "react-native"; export default function Application() { - const { token, user } = useAuth(); + const { token, user, userData } = useAuth(); const [data, setData] = useState(); + const [refreshing, setRefreshing] = useState(false); + console.log("[User] >>", JSON.stringify(user?.id, null, 2)) + + // ‼️ Untuk cek apakah: 1. user ada, 2. user punya profile, 3. accept temrs of forum nya ada atau tidak + useFocusEffect( + useCallback(() => { + onLoadData(); + checkVersion(); + userData(token as string); + }, [user?.id, token]) + ); - console.log("[User] >>", JSON.stringify(user?.id, null, 2)); - - useEffect(() => { - onLoadData(); - checkVersion(); - }, []); - async function onLoadData() { const response = await apiUser(user?.id as string); - console.log( - "[Profile ID]>>", - JSON.stringify(response?.data?.Profile.id, null, 2) - ); - + console.log("[Profile ID]>>", JSON.stringify(response?.data?.Profile?.id, null, 2)); + setData(response.data); } - + const checkVersion = async () => { const response = await apiVersion(); console.log("[Version] >>", JSON.stringify(response.data, null, 2)); }; - + + const onRefresh = useCallback(() => { + setRefreshing(true); + onLoadData(); + checkVersion(); + setRefreshing(false); + }, []); + if (user && user?.termsOfServiceAccepted === false) { console.log("User is not accept term service"); return ; @@ -83,8 +92,16 @@ export default function Application() { }} /> + } footerComponent={ - + } > diff --git a/screens/Home/tabsList.ts b/screens/Home/tabsList.ts index f5fc139..2c01424 100644 --- a/screens/Home/tabsList.ts +++ b/screens/Home/tabsList.ts @@ -1,12 +1,12 @@ import { ITabs } from "@/components/_Interface/types"; -export const tabsHome: any = (profileId: string) => [ +export const tabsHome: any = ({acceptedForumTermsAt, profileId}: {acceptedForumTermsAt: Date, profileId: string}) => [ { id: "forum", icon: "chatbubble-ellipses-outline", activeIcon: "chatbubble-ellipses", label: "Forum", - path: "/forum", + path: acceptedForumTermsAt ? "/forum" : "/forum/terms", isActive: true, disabled: false, }, diff --git a/service/api-client/api-user.ts b/service/api-client/api-user.ts index 8c2a4b9..4775486 100644 --- a/service/api-client/api-user.ts +++ b/service/api-client/api-user.ts @@ -36,3 +36,13 @@ export async function apiForumBlockUser({ throw error; } } + +export async function apiAcceptForumTerms({category, userId}:{category:"Forum" | "Event", userId: string}) { + try { + const response = await apiConfig.post(`/mobile/user/${userId}/terms-of-app?category=${category}`); + return response.data; + } catch (error) { + throw error; + } +} + -- 2.49.1 From cccb44a835ab80091fa1800a2b23767c4d19e4e2 Mon Sep 17 00:00:00 2001 From: bagasbanuna Date: Tue, 9 Dec 2025 17:36:36 +0800 Subject: [PATCH 2/2] Fix QC Ayu Fix: - modified: app/(application)/(user)/event/[id]/publish.tsx - modified: app/(application)/(user)/event/create.tsx - modified: app/(application)/(user)/portofolio/[id]/create.tsx - modified: app/(application)/(user)/portofolio/[id]/edit.tsx - modified: app/(application)/admin/collaboration/[id]/group.tsx - modified: app/(application)/admin/collaboration/group.tsx - modified: app/(application)/admin/collaboration/publish.tsx - modified: app/(application)/admin/forum/[id]/list-report-comment.tsx - modified: app/(application)/admin/forum/[id]/list-report-posting.tsx - modified: app/(application)/admin/forum/posting.tsx - modified: app/(application)/admin/forum/report-comment.tsx - modified: app/(application)/admin/forum/report-posting.tsx - modified: app/(application)/admin/voting/[status]/status.tsx - modified: app/(application)/admin/voting/history.tsx - modified: components/Select/SelectCustom.tsx - modified: components/_ShareComponent/GridSpan_4_8.tsx - modified: screens/Authentication/LoginView.tsx - modified: screens/Collaboration/BoxPublishSection.tsx - modified: screens/Event/BoxDetailPublishSection.tsx - modified: screens/Home/topFeatureSection.tsx - modified: screens/Portofolio/ButtonCreatePortofolio.tsx Add: - components/_ShareComponent/GridSpan_NewComponent.tsx ### No Issue --- .../(user)/event/[id]/publish.tsx | 4 +- app/(application)/(user)/event/create.tsx | 2 +- .../(user)/portofolio/[id]/create.tsx | 2 +- .../(user)/portofolio/[id]/edit.tsx | 2 +- .../admin/collaboration/[id]/group.tsx | 53 +++++----- .../admin/collaboration/group.tsx | 72 +++++++------- .../admin/collaboration/publish.tsx | 55 +++++------ .../admin/forum/[id]/list-report-comment.tsx | 86 +++++++++-------- .../admin/forum/[id]/list-report-posting.tsx | 96 +++++++++++-------- app/(application)/admin/forum/posting.tsx | 77 +++++++++------ .../admin/forum/report-comment.tsx | 84 +++++++++------- .../admin/forum/report-posting.tsx | 72 +++++++------- .../admin/voting/[status]/status.tsx | 2 +- app/(application)/admin/voting/history.tsx | 2 +- components/Select/SelectCustom.tsx | 2 +- components/_ShareComponent/GridSpan_4_8.tsx | 8 +- .../_ShareComponent/GridSpan_NewComponent.tsx | 54 +++++++++++ screens/Authentication/LoginView.tsx | 4 +- screens/Collaboration/BoxPublishSection.tsx | 2 +- screens/Event/BoxDetailPublishSection.tsx | 2 +- screens/Home/topFeatureSection.tsx | 2 +- screens/Portofolio/ButtonCreatePortofolio.tsx | 4 - 22 files changed, 399 insertions(+), 288 deletions(-) create mode 100644 components/_ShareComponent/GridSpan_NewComponent.tsx diff --git a/app/(application)/(user)/event/[id]/publish.tsx b/app/(application)/(user)/event/[id]/publish.tsx index 88efb59..103c4e4 100644 --- a/app/(application)/(user)/event/[id]/publish.tsx +++ b/app/(application)/(user)/event/[id]/publish.tsx @@ -71,8 +71,6 @@ export default function EventDetailPublish() { } } - console.log("[participans]", isParticipant); - const handlePress = (item: IMenuDrawerItem) => { console.log("PATH ", item.path); router.navigate(item.path as any); @@ -139,7 +137,7 @@ export default function EventDetailPublish() { <> , headerRight: () => setOpenDrawer(true)} />, }} diff --git a/app/(application)/(user)/event/create.tsx b/app/(application)/(user)/event/create.tsx index 1d3e4dd..dffebc9 100644 --- a/app/(application)/(user)/event/create.tsx +++ b/app/(application)/(user)/event/create.tsx @@ -145,7 +145,7 @@ export default function EventCreate() { label: item.name, value: item.id, }))} - value={data?.eventMaster_TipeAcaraId || ""} + value={data?.eventMaster_TipeAcaraId || null} onChange={(value: any) => setData({ ...data, eventMaster_TipeAcaraId: value }) } diff --git a/app/(application)/(user)/portofolio/[id]/create.tsx b/app/(application)/(user)/portofolio/[id]/create.tsx index 550484c..d1c0a7a 100644 --- a/app/(application)/(user)/portofolio/[id]/create.tsx +++ b/app/(application)/(user)/portofolio/[id]/create.tsx @@ -76,7 +76,7 @@ export default function PortofolioCreate() { function handleInputValue(phoneNumber: string) { setInputValue(phoneNumber); const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || ""; - const fixNumber = inputValue.replace(/\s+/g, ""); + let fixNumber = inputValue.replace(/\s+/g, "").replace(/^0+/, ""); const realNumber = callingCode + fixNumber; setData({ ...data, tlpn: realNumber }); } diff --git a/app/(application)/(user)/portofolio/[id]/edit.tsx b/app/(application)/(user)/portofolio/[id]/edit.tsx index 8be839b..bf4b147 100644 --- a/app/(application)/(user)/portofolio/[id]/edit.tsx +++ b/app/(application)/(user)/portofolio/[id]/edit.tsx @@ -244,7 +244,7 @@ export default function PortofolioEdit() { const handleSubmitUpdate = async () => { const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || ""; - const fixNumber = data.tlpn.replace(/\s+/g, ""); + let fixNumber = data.tlpn.replace(/\s+/g, "").replace(/^0+/, ""); const realNumber = callingCode + fixNumber; const newData: IFormData = { diff --git a/app/(application)/admin/collaboration/[id]/group.tsx b/app/(application)/admin/collaboration/[id]/group.tsx index 32fc944..d6cb76f 100644 --- a/app/(application)/admin/collaboration/[id]/group.tsx +++ b/app/(application)/admin/collaboration/[id]/group.tsx @@ -2,11 +2,13 @@ import { BaseBox, Grid, + Spacing, StackCustom, TextCustom, ViewWrapper, } from "@/components"; import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle"; +import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8"; import { apiAdminCollaborationGetById } from "@/service/api-admin/api-admin-collaboration"; import { useFocusEffect, useLocalSearchParams } from "expo-router"; import { useCallback, useState } from "react"; @@ -28,6 +30,8 @@ export default function AdminCollaborationGroup() { category: "group", }); + console.log("[DATA]", JSON.stringify(response.data, null, 2)); + if (response.success) { setData(response.data); } @@ -59,38 +63,33 @@ export default function AdminCollaborationGroup() { ))} + + Anggota + - Anggota + + + + Nomor + + + Username + + {data?.ProjectCollaboration_AnggotaRoomChat?.map( (item: any, index: number) => ( - - - - Nama - - - - {item?.User?.Profile?.name || "-"} - - - - - - Username - - - {item?.User?.username || "-"} - - - + + + +{item?.User?.nomor || "-"} + + + + {item?.User?.username || "-"} + + + ) )} diff --git a/app/(application)/admin/collaboration/group.tsx b/app/(application)/admin/collaboration/group.tsx index 3a05763..f58098a 100644 --- a/app/(application)/admin/collaboration/group.tsx +++ b/app/(application)/admin/collaboration/group.tsx @@ -1,17 +1,14 @@ import { - ActionIcon, + ClickableCustom, LoaderCustom, StackCustom, TextCustom, ViewWrapper } from "@/components"; import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage"; -import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; -import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; -import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration"; -import { Octicons } from "@expo/vector-icons"; import { router, useFocusEffect } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; @@ -34,7 +31,7 @@ export default function AdminCollaborationGroup() { const response = await apiAdminCollaboration({ category: "group", }); - + if (response.success) { setList(response.data); } @@ -51,10 +48,19 @@ export default function AdminCollaborationGroup() { <> - + Jumlah Anggota + + } + text2={ + + Nama Group + + } /> @@ -67,31 +73,27 @@ export default function AdminCollaborationGroup() { ) : ( list?.map((item: any, index: number) => ( - - } - onPress={() => { - router.push(`/admin/collaboration/${item.id}/group`); - }} - /> - } - value2={ - - {item?.ProjectCollaboration_AnggotaRoomChat?.length || - "-"} - - } - value3={ - {item?.name || "-"} - } - /> + { + router.push(`/admin/collaboration/${item.id}/group`); + }} + > + + {item?.ProjectCollaboration_AnggotaRoomChat?.length || + "-"} + + } + text2={ + + {item?.name || "-"} + + } + /> + )) )} diff --git a/app/(application)/admin/collaboration/publish.tsx b/app/(application)/admin/collaboration/publish.tsx index 777296f..c6168b7 100644 --- a/app/(application)/admin/collaboration/publish.tsx +++ b/app/(application)/admin/collaboration/publish.tsx @@ -1,6 +1,8 @@ import { ActionIcon, + ClickableCustom, LoaderCustom, + Spacing, StackCustom, TextCustom, ViewWrapper, @@ -9,6 +11,7 @@ import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage" import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration"; import { Octicons } from "@expo/vector-icons"; @@ -51,11 +54,7 @@ export default function AdminCollaborationPublish() { - + Username} text2={Judul Proyek} /> {/* */} @@ -68,32 +67,26 @@ export default function AdminCollaborationPublish() { ) : ( list?.map((item: any, index: number) => ( - - } - onPress={() => { - router.push(`/admin/collaboration/${item?.id}/publish`); - }} - /> - } - value2={ - - {item?.Author?.username || "-"}{" "} - - } - value3={ - - {item?.title || "-"} - - } - /> + { + router.push(`/admin/collaboration/${item?.id}/publish`); + }} + > + + {item?.Author?.username || "-"}{" "} + + } + text2={ + + {item?.title || "-"} + + } + /> + + + )) )} diff --git a/app/(application)/admin/forum/[id]/list-report-comment.tsx b/app/(application)/admin/forum/[id]/list-report-comment.tsx index 4a4cb30..935c707 100644 --- a/app/(application)/admin/forum/[id]/list-report-comment.tsx +++ b/app/(application)/admin/forum/[id]/list-report-comment.tsx @@ -3,6 +3,7 @@ import { ActionIcon, AlertDefaultSystem, BaseBox, + CenterCustom, DrawerCustom, LoaderCustom, MenuDrawerDynamicGrid, @@ -17,6 +18,7 @@ import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage" import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { @@ -27,6 +29,7 @@ import { import { router, useFocusEffect, useLocalSearchParams } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; +import { View } from "react-native"; import { Divider } from "react-native-paper"; import Toast from "react-native-toast-message"; @@ -95,24 +98,24 @@ export default function AdminForumReportComment() { > - Username} - value={{data?.Author?.username || "-"}} + Username} + text2={{data?.Author?.username || "-"}} /> - Komentar} - value={{data?.komentar || "-"}} + Komentar} + text2={{data?.komentar || "-"}} /> - - + Aksi} + text2={Pelapor} + text3={Kategori Report} /> {loadList ? ( @@ -123,34 +126,39 @@ export default function AdminForumReportComment() { ) : ( listReport?.map((item: any, index: number) => ( - } - onPress={() => { - setOpenDrawerAction(true); - setSelectedReport({ - id: item.id, - username: item.User?.username, - kategori: item.ForumMaster_KategoriReport?.title, - keterangan: item.ForumMaster_KategoriReport?.deskripsi, - deskripsi: item.deskripsi, - }); - }} - /> - } - value2={ - - {item?.User?.username || "-"} - - } - value3={ - - {item?.ForumMaster_KategoriReport?.title || "-"} - - } - /> + + + } + onPress={() => { + setOpenDrawerAction(true); + setSelectedReport({ + id: item.id, + username: item.User?.username, + kategori: item.ForumMaster_KategoriReport?.title, + keterangan: + item.ForumMaster_KategoriReport?.deskripsi, + deskripsi: item.deskripsi, + }); + }} + /> + + } + text2={ + + {item?.User?.username || "-"} + + } + text3={ + + {item?.ForumMaster_KategoriReport?.title || "-"} + + } + /> + + )) )} diff --git a/app/(application)/admin/forum/[id]/list-report-posting.tsx b/app/(application)/admin/forum/[id]/list-report-posting.tsx index 1d82976..faedf07 100644 --- a/app/(application)/admin/forum/[id]/list-report-posting.tsx +++ b/app/(application)/admin/forum/[id]/list-report-posting.tsx @@ -4,6 +4,7 @@ import { AlertDefaultSystem, BadgeCustom, BaseBox, + CenterCustom, DrawerCustom, LoaderCustom, MenuDrawerDynamicGrid, @@ -18,6 +19,7 @@ import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage" import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { @@ -28,6 +30,7 @@ import { import { router, useFocusEffect, useLocalSearchParams } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; +import { View } from "react-native"; import { Divider } from "react-native-paper"; import Toast from "react-native-toast-message"; @@ -95,14 +98,14 @@ export default function AdminForumReportPosting() { > - Username} - value={{data?.Author?.username || "-"}} + Username} + text2={{data?.Author?.username || "-"}} /> - Status} - value={ + Status} + text2={ data && data?.ForumMaster_StatusPosting?.status ? ( - Postingan} - value={{data?.diskusi || "-"}} + Postingan} + text2={{data?.diskusi || "-"}} /> - + Aksi + + } + text2={Pelapor} + text3={Kategori Report} /> {loadListReport ? ( @@ -144,34 +151,41 @@ export default function AdminForumReportPosting() { ) : ( listReport?.map((item: any, index: number) => ( - } - onPress={() => { - setOpenDrawerAction(true); - setSelectedReport({ - id: item?.id, - username: item?.User?.username, - kategori: item?.ForumMaster_KategoriReport?.title, - keterangan: item?.ForumMaster_KategoriReport?.deskripsi, - deskripsi: item?.deskripsi, - }); - }} - /> - } - value2={ - - {item?.User?.username || "-"} - - } - value3={ - - {item?.ForumMaster_KategoriReport?.title || "-"} - - } - /> + + + + } + onPress={() => { + setOpenDrawerAction(true); + setSelectedReport({ + id: item?.id, + username: item?.User?.username, + kategori: item?.ForumMaster_KategoriReport?.title, + keterangan: + item?.ForumMaster_KategoriReport?.deskripsi, + deskripsi: item?.deskripsi, + }); + }} + /> + + } + text2={ + + {item?.User?.username || "-"} + + } + text3={ + + {item?.ForumMaster_KategoriReport?.title || "-"} + + } + /> + + )) )} diff --git a/app/(application)/admin/forum/posting.tsx b/app/(application)/admin/forum/posting.tsx index 4f9c3c0..dd7ad70 100644 --- a/app/(application)/admin/forum/posting.tsx +++ b/app/(application)/admin/forum/posting.tsx @@ -1,22 +1,22 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { - ActionIcon, + ClickableCustom, LoaderCustom, SearchInput, + Spacing, StackCustom, TextCustom, ViewWrapper, } from "@/components"; -import { IconView } from "@/components/_Icon/IconComponent"; import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage"; -import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; -import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; -import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; +import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { apiAdminForum } from "@/service/api-admin/api-admin-forum"; import { router, useFocusEffect } from "expo-router"; import _ from "lodash"; -import React, { useCallback, useState } from "react"; +import { useCallback, useState } from "react"; +import { View } from "react-native"; import { Divider } from "react-native-paper"; export default function AdminForumPosting() { @@ -37,7 +37,9 @@ export default function AdminForumPosting() { category: "posting", search: search, }); - + + console.log("DATA", JSON.stringify(response, null, 2)); + if (response.success) { setList(response.data); } @@ -51,7 +53,7 @@ export default function AdminForumPosting() { const rightComponent = ( @@ -61,9 +63,15 @@ export default function AdminForumPosting() { <> }> + Username} + text2={ Postingan} + text3={ Report Posting} + text4={ Komentar} + /> + + - - {loadList ? ( ) : _.isEmpty(list) ? ( @@ -72,25 +80,38 @@ export default function AdminForumPosting() { ) : ( list?.map((item: any, index: number) => ( - } - onPress={() => { - router.push(`/admin/forum/${item?.id}`); - }} + + { + router.push(`/admin/forum/${item.id}`); + }} + > + + {item?.Author?.username || "-"} + + } + text2={ + + {item?.diskusi || "-"} + + } + text3={ + + {item?.reportPosting || "-"} + + } + text4={ + + {item?.komentar || "-"} + + } /> - } - value2={ - - {item?.Author?.username || "-"} - - } - value3={ - {item?.diskusi || "-"} - } - /> + + + + )) )} diff --git a/app/(application)/admin/forum/report-comment.tsx b/app/(application)/admin/forum/report-comment.tsx index 654d635..b9fa90f 100644 --- a/app/(application)/admin/forum/report-comment.tsx +++ b/app/(application)/admin/forum/report-comment.tsx @@ -1,8 +1,10 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { ActionIcon, + ClickableCustom, LoaderCustom, SearchInput, + Spacing, StackCustom, TextCustom, ViewWrapper, @@ -12,12 +14,14 @@ import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage" import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { apiAdminForum } from "@/service/api-admin/api-admin-forum"; import { router, useFocusEffect } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; +import { View } from "react-native"; import { Divider } from "react-native-paper"; export default function AdminForumReportComment() { @@ -67,13 +71,26 @@ export default function AdminForumReportComment() { rightComponent={rightComponent} /> - - - + + Pelapor + + } + text2={ + + Komentar + + } + text3={ + + Jenis Laporan + + } + /> + + + {loadList ? ( ) : _.isEmpty(listData) ? ( @@ -82,34 +99,35 @@ export default function AdminForumReportComment() { ) : ( listData?.map((item: any, index: number) => ( - + + { + router.push( + `/admin/forum/${item?.Forum_Komentar?.id}/list-report-comment` + ); + }} + > + + {item?.User?.username || "-"} + + } + text2={ + + {item?.Forum_Komentar?.komentar || "-"} + + } + text3={ + + {item?.ForumMaster_KategoriReport?.title || "-"} + } - onPress={() => { - router.push( - `/admin/forum/${item?.Forum_Komentar?.id}/list-report-comment` - ); - }} /> - } - value2={ - - {item?.User?.username || "-"} - - } - value3={ - - {item?.ForumMaster_KategoriReport?.title || "-"} - - } - /> + + + + )) )} diff --git a/app/(application)/admin/forum/report-posting.tsx b/app/(application)/admin/forum/report-posting.tsx index 3e373e0..6d5ff57 100644 --- a/app/(application)/admin/forum/report-posting.tsx +++ b/app/(application)/admin/forum/report-posting.tsx @@ -1,24 +1,27 @@ /* eslint-disable react-hooks/exhaustive-deps */ import { ActionIcon, + ClickableCustom, Divider, LoaderCustom, SearchInput, StackCustom, TextCustom, - ViewWrapper + ViewWrapper, } from "@/components"; import { IconView } from "@/components/_Icon/IconComponent"; import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage"; import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle"; import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue"; import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage"; +import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent"; import { MainColor } from "@/constants/color-palet"; import { ICON_SIZE_BUTTON } from "@/constants/constans-value"; import { apiAdminForum } from "@/service/api-admin/api-admin-forum"; import { router, useFocusEffect } from "expo-router"; import _ from "lodash"; import { useCallback, useState } from "react"; +import { View } from "react-native"; export default function AdminForumReportPosting() { const [listData, setListData] = useState(null); @@ -67,46 +70,51 @@ export default function AdminForumReportPosting() { rightComponent={rightComponent} /> - - - - + + Username + + } + text2={ + + Postingan + + } + /> + + {loadList ? ( ) : _.isEmpty(listData) ? ( - + Belum ada data ) : ( listData?.map((item: any, index: number) => ( - + + { + router.push( + `/admin/forum/${item?.Forum_Posting?.id}/list-report-posting` + ); + }} + > + + {item?.User?.username || "-"} + + } + text2={ + + {item?.Forum_Posting?.diskusi || "-"} + } - onPress={() => { - router.push( - `/admin/forum/${item?.Forum_Posting?.id}/list-report-posting` - ); - }} /> - } - value2={ - - {item?.User?.username || "-"} - - } - value3={ - - {item?.Forum_Posting?.diskusi || "-"} - - } - /> + + + )) )} diff --git a/app/(application)/admin/voting/[status]/status.tsx b/app/(application)/admin/voting/[status]/status.tsx index cf3bc34..5c89295 100644 --- a/app/(application)/admin/voting/[status]/status.tsx +++ b/app/(application)/admin/voting/[status]/status.tsx @@ -103,7 +103,7 @@ export default function AdminVotingStatus() { } value3={ - + {item?.title || "-"} } diff --git a/app/(application)/admin/voting/history.tsx b/app/(application)/admin/voting/history.tsx index 8a7286b..1930004 100644 --- a/app/(application)/admin/voting/history.tsx +++ b/app/(application)/admin/voting/history.tsx @@ -91,7 +91,7 @@ export default function AdminVotingHistory() { } value2={{item?.Author?.username || "-"}} value3={ - + {item?.title || "-"} } diff --git a/components/Select/SelectCustom.tsx b/components/Select/SelectCustom.tsx index 0de3c84..7d9db20 100644 --- a/components/Select/SelectCustom.tsx +++ b/components/Select/SelectCustom.tsx @@ -87,7 +87,7 @@ const SelectCustom: React.FC = ({ borderRadius, flexDirection: "row", alignItems: "center", - paddingHorizontal: 10, + // paddingHorizontal: 0, height: 50, }, diff --git a/components/_ShareComponent/GridSpan_4_8.tsx b/components/_ShareComponent/GridSpan_4_8.tsx index d2721e6..5dbcfb5 100644 --- a/components/_ShareComponent/GridSpan_4_8.tsx +++ b/components/_ShareComponent/GridSpan_4_8.tsx @@ -1,8 +1,8 @@ import { Grid } from "@/components"; export const GridSpan_4_8 = ({ - label, - value, + label: text1, + value: text2, }: { label: React.ReactNode; value: React.ReactNode; @@ -17,10 +17,10 @@ export const GridSpan_4_8 = ({ paddingLeft: 8, }} > - {label} + {text1} - {value} + {text2} ); diff --git a/components/_ShareComponent/GridSpan_NewComponent.tsx b/components/_ShareComponent/GridSpan_NewComponent.tsx new file mode 100644 index 0000000..c17fd81 --- /dev/null +++ b/components/_ShareComponent/GridSpan_NewComponent.tsx @@ -0,0 +1,54 @@ +import { Grid } from "@/components"; + +export const GridSpan_NewComponent = ({ + text1, + text2, + text3, + text4, + span1, + span2, +}: { + text1: React.ReactNode; + text2: React.ReactNode; + text3?: React.ReactNode; + text4?: React.ReactNode; + span1?: number; + span2?: number; +}) => { + return ( + + + {text1} + + + {text2} + + {text3 && ( + + {text3} + + )} + {text4 && ( + + {text4} + + )} + + ); +}; diff --git a/screens/Authentication/LoginView.tsx b/screens/Authentication/LoginView.tsx index c80833d..3aa2fff 100644 --- a/screens/Authentication/LoginView.tsx +++ b/screens/Authentication/LoginView.tsx @@ -134,10 +134,10 @@ export default function LoginView() { if (token && token !== "" && isAdmin) { // Akan di aktifkan jika sudah losos review - // return ; + return ; // Sementara gunakan ini - return ; + // return ; } return ( diff --git a/screens/Collaboration/BoxPublishSection.tsx b/screens/Collaboration/BoxPublishSection.tsx index b169671..8b2e859 100644 --- a/screens/Collaboration/BoxPublishSection.tsx +++ b/screens/Collaboration/BoxPublishSection.tsx @@ -25,7 +25,7 @@ function Collaboration_BoxPublishSection({ name={data?.Author?.username || "Username"} rightComponent={rightComponentAvatar} avatar={data?.Author?.Profile?.imageId} - withBottomLine + // withBottomLine /> diff --git a/screens/Event/BoxDetailPublishSection.tsx b/screens/Event/BoxDetailPublishSection.tsx index 4e14ea3..c7599b1 100644 --- a/screens/Event/BoxDetailPublishSection.tsx +++ b/screens/Event/BoxDetailPublishSection.tsx @@ -50,7 +50,7 @@ export default function Event_BoxDetailPublishSection({ {item.title} - + {item.value} diff --git a/screens/Home/topFeatureSection.tsx b/screens/Home/topFeatureSection.tsx index 8befc82..90664c1 100644 --- a/screens/Home/topFeatureSection.tsx +++ b/screens/Home/topFeatureSection.tsx @@ -15,7 +15,7 @@ export default function Home_FeatureSection() { name: "Collaboration", icon: , onPress: () => router.push("/(application)/(user)/collaboration/(tabs)"), - status: "inactive", + status: "active", }, { name: "Voting", diff --git a/screens/Portofolio/ButtonCreatePortofolio.tsx b/screens/Portofolio/ButtonCreatePortofolio.tsx index bb1a341..9bda043 100644 --- a/screens/Portofolio/ButtonCreatePortofolio.tsx +++ b/screens/Portofolio/ButtonCreatePortofolio.tsx @@ -55,10 +55,6 @@ export default function Portofolio_ButtonCreate({ }; const handleCreatePortofolio = async () => { - console.log( - "Data sub bidang >>", - JSON.stringify(subBidangSelected, null, 2) - ); if (!validaasiData()) { Toast.show({ type: "info", -- 2.49.1