Compare commits
6 Commits
notificati
...
notificati
| Author | SHA1 | Date | |
|---|---|---|---|
| da82a02a45 | |||
| 14c0f0e499 | |||
| 0262423c50 | |||
| c2682246d6 | |||
| 465e01015e | |||
| 3b15871ad4 |
@@ -616,6 +616,20 @@ export default function UserLayout() {
|
|||||||
headerLeft: () => <BackButton />,
|
headerLeft: () => <BackButton />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="forum/[id]/preview-report-posting"
|
||||||
|
options={{
|
||||||
|
title: "Laporan Postingan",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="forum/[id]/preview-report-comment"
|
||||||
|
options={{
|
||||||
|
title: "Laporan Komentar",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* ========== Maps Section ========= */}
|
{/* ========== Maps Section ========= */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export default function EventDetailHistory() {
|
|||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
closeDrawer={() => setOpenDrawer(false)}
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
height={250}
|
height={"auto"}
|
||||||
>
|
>
|
||||||
<MenuDrawerDynamicGrid
|
<MenuDrawerDynamicGrid
|
||||||
data={menuDrawerPublishEvent({ id: id as string })}
|
data={menuDrawerPublishEvent({ id: id as string })}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
|
BackButton,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||||
@@ -18,23 +19,26 @@ import {
|
|||||||
apiEventGetOne,
|
apiEventGetOne,
|
||||||
apiEventJoin,
|
apiEventJoin,
|
||||||
} from "@/service/api-client/api-event";
|
} from "@/service/api-client/api-event";
|
||||||
|
import dayjs from "dayjs";
|
||||||
import {
|
import {
|
||||||
|
Redirect,
|
||||||
router,
|
router,
|
||||||
Stack,
|
Stack,
|
||||||
useFocusEffect,
|
useFocusEffect,
|
||||||
useLocalSearchParams,
|
useLocalSearchParams,
|
||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function EventDetailPublish() {
|
export default function EventDetailPublish() {
|
||||||
const { id } = useLocalSearchParams();
|
const now = new Date().toISOString();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const [isLoadingData, setIsLoadingData] = useState(false);
|
const [isLoadingData, setIsLoadingData] = useState(false);
|
||||||
const [isLoadingJoin, setIsLoadingJoin] = useState(false);
|
const [isLoadingJoin, setIsLoadingJoin] = useState(false);
|
||||||
|
|
||||||
const [data, setData] = useState();
|
const [data, setData] = useState<any>();
|
||||||
const [isParticipant, setIsParticipant] = useState<boolean | null>(null);
|
const [isParticipant, setIsParticipant] = useState<boolean | null>(null);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
@@ -55,8 +59,6 @@ export default function EventDetailPublish() {
|
|||||||
userId: user?.id as string,
|
userId: user?.id as string,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RES CHECK PARTICIPANTS]", responseCheckParticipants);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
responseCheckParticipants.success &&
|
responseCheckParticipants.success &&
|
||||||
responseCheckParticipants.data
|
responseCheckParticipants.data
|
||||||
@@ -108,7 +110,24 @@ export default function EventDetailPublish() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const footerButton = () => {
|
const isEventFinished =
|
||||||
|
id && data?.tanggalSelesai && dayjs(data.tanggalSelesai).isBefore(now);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isEventFinished) {
|
||||||
|
router.replace(`/(application)/(user)/event/${id}/history`);
|
||||||
|
}
|
||||||
|
}, [isEventFinished, id]);
|
||||||
|
|
||||||
|
if (isEventFinished) {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<CustomSkeleton />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const FooterButton = () => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -138,17 +157,17 @@ export default function EventDetailPublish() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Event Publish`,
|
title: `Event Publish`,
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
headerLeft: () => <BackButton onPress={() => router.back()} />,
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
{isLoadingData ? (
|
{isLoadingData ? (
|
||||||
<LoaderCustom />
|
<CustomSkeleton height={400} />
|
||||||
) : (
|
) : (
|
||||||
<Event_BoxDetailPublishSection
|
<Event_BoxDetailPublishSection
|
||||||
data={data}
|
data={data}
|
||||||
footerButton={footerButton()}
|
footerButton={FooterButton()}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -78,23 +78,6 @@ export default function EventCreate() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (selectedDate) {
|
|
||||||
// console.log("Tanggal yang dipilih:", selectedDate);
|
|
||||||
// console.log(`ISO Format ${Platform.OS}:`, selectedDate.toString());
|
|
||||||
|
|
||||||
// // Kirim ke API atau proses lanjutan
|
|
||||||
// } else {
|
|
||||||
// console.log("Tanggal belum dipilih");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (selectedEndDate) {
|
|
||||||
// console.log("Tanggal yang dipilih:", selectedEndDate);
|
|
||||||
// console.log(`ISO Format ${Platform.OS}:`, selectedEndDate.toString());
|
|
||||||
// // Kirim ke API atau proses lanjutan
|
|
||||||
// } else {
|
|
||||||
// console.log("Tanggal berakhir belum dipilih");
|
|
||||||
// }
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
|
|
||||||
@@ -110,7 +93,7 @@ export default function EventCreate() {
|
|||||||
const response = await apiEventCreate(newData);
|
const response = await apiEventCreate(newData);
|
||||||
console.log("Response", JSON.stringify(response, null, 2));
|
console.log("Response", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
router.replace("/event/status");
|
router.replace("/event/status?status=review");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -19,34 +19,20 @@ import {
|
|||||||
apiForumGetOne,
|
apiForumGetOne,
|
||||||
apiForumUpdateStatus,
|
apiForumUpdateStatus,
|
||||||
} from "@/service/api-client/api-forum";
|
} from "@/service/api-client/api-forum";
|
||||||
|
import { TypeForum_CommentProps } from "@/types/type-forum";
|
||||||
import { isBadContent } from "@/utils/badWordsIndonesia";
|
import { isBadContent } from "@/utils/badWordsIndonesia";
|
||||||
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { Alert } from "react-native";
|
|
||||||
|
|
||||||
interface CommentProps {
|
|
||||||
id: string;
|
|
||||||
isActive: boolean;
|
|
||||||
komentar: string;
|
|
||||||
createdAt: Date;
|
|
||||||
authorId: string;
|
|
||||||
Author: {
|
|
||||||
id: string;
|
|
||||||
username: string;
|
|
||||||
Profile: {
|
|
||||||
id: string;
|
|
||||||
imageId: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function ForumDetail() {
|
export default function ForumDetail() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const [data, setData] = useState<any | null>(null);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [listComment, setListComment] = useState<CommentProps[] | null>(null);
|
const [listComment, setListComment] = useState<TypeForum_CommentProps[] | null>(null);
|
||||||
const [isLoadingComment, setLoadingComment] = useState(false);
|
const [isLoadingComment, setLoadingComment] = useState(false);
|
||||||
|
|
||||||
// Status
|
// Status
|
||||||
@@ -122,6 +108,7 @@ export default function ForumDetail() {
|
|||||||
comment: text,
|
comment: text,
|
||||||
authorId: user?.id,
|
authorId: user?.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoadingComment(true);
|
setLoadingComment(true);
|
||||||
const response = await apiForumCreateComment({
|
const response = await apiForumCreateComment({
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiForumCreateReportCommentar } from "@/service/api-client/api-master";
|
import { apiForumCreateReportCommentar } from "@/service/api-client/api-forum";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiForumCreateReportPosting } from "@/service/api-client/api-master";
|
import { apiForumCreateReportPosting } from "@/service/api-client/api-forum";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
NewWrapper,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
|
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
|
import { apiForumGetReportComment } from "@/service/api-client/api-forum";
|
||||||
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
|
export default function ForumPreviewReportComment() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [listData, setListData] = useState<any | null>(null);
|
||||||
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
|
// Status
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData(id as string);
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async (id: string) => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const response = await apiForumGetReportComment({ id });
|
||||||
|
setData(response.data);
|
||||||
|
setListData(response?.data?.Forum_ReportKomentar);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<NewWrapper>
|
||||||
|
<StackCustom>
|
||||||
|
<TextCustom color="red" bold>
|
||||||
|
Komentar anda telah melanggar aturan forum ! Admin mengambil
|
||||||
|
tindakan untuk menghapus komentar anda!
|
||||||
|
</TextCustom>
|
||||||
|
{loading ? (
|
||||||
|
<CustomSkeleton height={100} />
|
||||||
|
) : (
|
||||||
|
<BaseBox>
|
||||||
|
<TextCustom>"{data?.komentar ? data?.komentar : "-"}"</TextCustom>
|
||||||
|
</BaseBox>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
|
|
||||||
|
<Spacing height={10} />
|
||||||
|
<TextCustom bold>Beberapa laporan yang telah diterima</TextCustom>
|
||||||
|
<Spacing height={10} />
|
||||||
|
|
||||||
|
{loading ? (
|
||||||
|
<ListSkeletonComponent />
|
||||||
|
) : _.isEmpty(listData) ? (
|
||||||
|
<NoDataText />
|
||||||
|
) : (
|
||||||
|
listData?.map((e: any, index: number) => (
|
||||||
|
<BaseBox key={index}>
|
||||||
|
{e?.deskripsi ? (
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold>Laporan Lainnya</TextCustom>
|
||||||
|
<TextCustom>{e?.deskripsi}</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
) : (
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold>
|
||||||
|
{e?.ForumMaster_KategoriReport?.title}
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom>
|
||||||
|
{e?.ForumMaster_KategoriReport?.deskripsi}
|
||||||
|
</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</BaseBox>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</NewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
NewWrapper,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
|
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
|
import { apiForumGetReportPosting } from "@/service/api-client/api-forum";
|
||||||
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
|
export default function ForumPreviewReportPosting() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [listData, setListData] = useState<any | null>(null);
|
||||||
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
|
// Status
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData(id as string);
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async (id: string) => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const response = await apiForumGetReportPosting({ id });
|
||||||
|
setData(response.data);
|
||||||
|
setListData(response?.data?.Forum_ReportPosting);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<NewWrapper>
|
||||||
|
<StackCustom>
|
||||||
|
<TextCustom color="red" bold>
|
||||||
|
Postingan anda telah melanggar aturan forum ! Admin mengambil
|
||||||
|
tindakan untuk menghapus komentar anda!
|
||||||
|
</TextCustom>
|
||||||
|
{loading ? (
|
||||||
|
<CustomSkeleton height={100} />
|
||||||
|
) : (
|
||||||
|
<BaseBox>
|
||||||
|
<TextCustom>"{data?.diskusi ? data?.diskusi : "-"}"</TextCustom>
|
||||||
|
</BaseBox>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
|
|
||||||
|
<Spacing height={10} />
|
||||||
|
<TextCustom bold>Beberapa laporan yang telah diterima</TextCustom>
|
||||||
|
<Spacing height={10} />
|
||||||
|
|
||||||
|
{loading ? (
|
||||||
|
<ListSkeletonComponent />
|
||||||
|
) : _.isEmpty(listData) ? (
|
||||||
|
<NoDataText />
|
||||||
|
) : (
|
||||||
|
listData?.map((e: any) => (
|
||||||
|
<BaseBox key={e?.id}>
|
||||||
|
{e?.deskripsi ? (
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold>Laporan Lainnya</TextCustom>
|
||||||
|
<TextCustom>{e?.deskripsi}</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
) : (
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold>
|
||||||
|
{e?.ForumMaster_KategoriReport?.title}
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom>
|
||||||
|
{e?.ForumMaster_KategoriReport?.deskripsi}
|
||||||
|
</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</BaseBox>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</NewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -8,7 +8,8 @@ import {
|
|||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
||||||
import { apiForumCreateReportCommentar, apiMasterForumReportList } from "@/service/api-client/api-master";
|
import { apiForumCreateReportCommentar } from "@/service/api-client/api-forum";
|
||||||
|
import { apiMasterForumReportList } from "@/service/api-client/api-master";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import {
|
|||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
||||||
|
import { apiForumCreateReportPosting } from "@/service/api-client/api-forum";
|
||||||
import {
|
import {
|
||||||
apiForumCreateReportPosting,
|
|
||||||
apiMasterForumReportList,
|
apiMasterForumReportList,
|
||||||
} from "@/service/api-client/api-master";
|
} from "@/service/api-client/api-master";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
|
|||||||
@@ -2,15 +2,14 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiForumCreate } from "@/service/api-client/api-forum";
|
import { apiForumCreate } from "@/service/api-client/api-forum";
|
||||||
import { isBadContent } from "@/utils/badWordsIndonesia";
|
import { censorText, isBadContent } from "@/utils/badWordsIndonesia";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Alert } from "react-native";
|
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function ForumCreate() {
|
export default function ForumCreate() {
|
||||||
@@ -19,16 +18,22 @@ export default function ForumCreate() {
|
|||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
const handlerSubmit = async () => {
|
const handlerSubmit = async () => {
|
||||||
|
if (text.trim() === "") {
|
||||||
if (isBadContent(text)) {
|
AlertWarning({
|
||||||
AlertWarning({})
|
title: "Lengkapi Data",
|
||||||
|
description: "Postingan tidak boleh kosong",
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bisa di sensor atau return dan tidak bisa di post
|
||||||
|
const cencorContent = censorText(text)
|
||||||
|
|
||||||
const newData = {
|
const newData = {
|
||||||
diskusi: text,
|
diskusi: cencorContent,
|
||||||
authorId: user?.id,
|
authorId: user?.id,
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const response = await apiForumCreate({ data: newData });
|
const response = await apiForumCreate({ data: newData });
|
||||||
@@ -50,6 +55,7 @@ export default function ForumCreate() {
|
|||||||
const buttonFooter = (
|
const buttonFooter = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
disabled={!text.trim() || isLoading}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handlerSubmit();
|
handlerSubmit();
|
||||||
|
|||||||
@@ -1,9 +1,33 @@
|
|||||||
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
||||||
|
import { useLayoutEffect } from "react";
|
||||||
|
|
||||||
export default function InvestmentTabsLayout() {
|
export default function InvestmentTabsLayout() {
|
||||||
|
// const navigation = useNavigation();
|
||||||
|
|
||||||
|
// const { from, category } = useLocalSearchParams<{
|
||||||
|
// from?: string;
|
||||||
|
// category?: string;
|
||||||
|
// }>();
|
||||||
|
|
||||||
|
// console.log("from", from);
|
||||||
|
// console.log("category", category);
|
||||||
|
|
||||||
|
// // Atur header secara dinamis
|
||||||
|
// useLayoutEffect(() => {
|
||||||
|
// navigation.setOptions({
|
||||||
|
// headerLeft: () => (
|
||||||
|
// <BackButtonFromNotification
|
||||||
|
// from={from as string}
|
||||||
|
// category={category as string}
|
||||||
|
// />
|
||||||
|
// ),
|
||||||
|
// });
|
||||||
|
// }, [from, router, navigation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<Tabs screenOptions={TabsStyles}>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
|
|||||||
@@ -9,14 +9,16 @@ import { useAuth } from "@/hooks/use-auth";
|
|||||||
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
||||||
import Investment_StatusBox from "@/screens/Invesment/StatusBox";
|
import Investment_StatusBox from "@/screens/Invesment/StatusBox";
|
||||||
import { apiInvestmentGetByStatus } from "@/service/api-client/api-investment";
|
import { apiInvestmentGetByStatus } from "@/service/api-client/api-investment";
|
||||||
import { useFocusEffect } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function InvestmentPortofolio() {
|
export default function InvestmentPortofolio() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
const { status } = useLocalSearchParams<{ status?: string }>();
|
||||||
|
|
||||||
const [activeCategory, setActiveCategory] = useState<string | null>(
|
const [activeCategory, setActiveCategory] = useState<string | null>(
|
||||||
"publish"
|
status || "publish"
|
||||||
);
|
);
|
||||||
|
|
||||||
const [listData, setListData] = useState<any[]>([]);
|
const [listData, setListData] = useState<any[]>([]);
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import Toast from "react-native-toast-message";
|
|||||||
|
|
||||||
export default function InvestmentInvoice() {
|
export default function InvestmentInvoice() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
console.log("[ID]", id);
|
|
||||||
const [data, setData] = useState<any>({});
|
const [data, setData] = useState<any>({});
|
||||||
const [image, setImage] = useState<IFileData>({
|
const [image, setImage] = useState<IFileData>({
|
||||||
name: "",
|
name: "",
|
||||||
@@ -49,7 +48,6 @@ export default function InvestmentInvoice() {
|
|||||||
category: "invoice",
|
category: "invoice",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RES INVOICE]", JSON.stringify(response.data, null, 2));
|
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("[ERROR]", error);
|
console.log("[ERROR]", error);
|
||||||
@@ -64,8 +62,6 @@ export default function InvestmentInvoice() {
|
|||||||
imageUri: image?.uri,
|
imageUri: image?.uri,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RESPONSE UPLOAD IMAGE]", responseUploadImage);
|
|
||||||
|
|
||||||
if (!responseUploadImage?.data?.id) {
|
if (!responseUploadImage?.data?.id) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -83,10 +79,6 @@ export default function InvestmentInvoice() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
console.log(
|
|
||||||
"[RESPONSE UPDATE]",
|
|
||||||
JSON.stringify(response.data, null, 2)
|
|
||||||
);
|
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
text1: "Berhasil mengunggah bukti transfer",
|
text1: "Berhasil mengunggah bukti transfer",
|
||||||
@@ -210,7 +202,6 @@ export default function InvestmentInvoice() {
|
|||||||
pickFile({
|
pickFile({
|
||||||
allowedType: "image",
|
allowedType: "image",
|
||||||
setImageUri(file: any) {
|
setImageUri(file: any) {
|
||||||
console.log("[IMAGE]", file);
|
|
||||||
setImage(file);
|
setImage(file);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -224,7 +215,7 @@ export default function InvestmentInvoice() {
|
|||||||
|
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
disabled={!image}
|
disabled={!image || isLoading}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handlerSubmitUpdate();
|
handlerSubmitUpdate();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ export default function InvestmentCreate() {
|
|||||||
text1: "Berhasil",
|
text1: "Berhasil",
|
||||||
text2: response.message,
|
text2: response.message,
|
||||||
});
|
});
|
||||||
router.replace("/investment/portofolio");
|
router.replace("/investment/portofolio?status=review");
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -224,7 +224,6 @@ export default function InvestmentCreate() {
|
|||||||
onPress={() => {
|
onPress={() => {
|
||||||
pickFile({
|
pickFile({
|
||||||
setPdfUri: ({ uri, name, size }) => {
|
setPdfUri: ({ uri, name, size }) => {
|
||||||
|
|
||||||
setPdf({ uri, name, size });
|
setPdf({ uri, name, size });
|
||||||
},
|
},
|
||||||
allowedType: "pdf",
|
allowedType: "pdf",
|
||||||
@@ -357,7 +356,11 @@ export default function InvestmentCreate() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<ButtonCustom isLoading={isLoading} onPress={() => handleSubmit()}>
|
<ButtonCustom
|
||||||
|
disabled={isLoading}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => handleSubmit()}
|
||||||
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ const BoxNotification = ({
|
|||||||
categoryApp: data.kategoriApp,
|
categoryApp: data.kategoriApp,
|
||||||
});
|
});
|
||||||
|
|
||||||
router.replace(newPath as any);
|
router.navigate(newPath as any);
|
||||||
selectedCategory(activeCategory as string);
|
selectedCategory(activeCategory as string);
|
||||||
|
|
||||||
if (!data.isRead) {
|
if (!data.isRead) {
|
||||||
|
|||||||
@@ -1,13 +1,37 @@
|
|||||||
import {
|
import {
|
||||||
IconContribution,
|
IconContribution,
|
||||||
IconHistory,
|
IconHistory,
|
||||||
IconHome,
|
IconHome,
|
||||||
IconStatus,
|
IconStatus,
|
||||||
} from "@/components/_Icon";
|
} from "@/components/_Icon";
|
||||||
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs, useLocalSearchParams, useNavigation, router } from "expo-router";
|
||||||
|
import { useLayoutEffect } from "react";
|
||||||
|
|
||||||
export default function VotingTabsLayout() {
|
export default function VotingTabsLayout() {
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
|
const { from, category } = useLocalSearchParams<{
|
||||||
|
from?: string;
|
||||||
|
category?: string;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
console.log("from", from);
|
||||||
|
console.log("category", category);
|
||||||
|
|
||||||
|
// Atur header secara dinamis
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
navigation.setOptions({
|
||||||
|
headerLeft: () => (
|
||||||
|
<BackButtonFromNotification
|
||||||
|
from={from as string}
|
||||||
|
category={category as string}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
});
|
||||||
|
}, [from, router, navigation]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<Tabs screenOptions={TabsStyles}>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
|
|||||||
@@ -12,15 +12,17 @@ import { useAuth } from "@/hooks/use-auth";
|
|||||||
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
||||||
import { apiVotingGetByStatus } from "@/service/api-client/api-voting";
|
import { apiVotingGetByStatus } from "@/service/api-client/api-voting";
|
||||||
import { dateTimeView } from "@/utils/dateTimeView";
|
import { dateTimeView } from "@/utils/dateTimeView";
|
||||||
import { useFocusEffect } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function VotingStatus() {
|
export default function VotingStatus() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
|
const { status } = useLocalSearchParams<{ status?: string }>();
|
||||||
|
|
||||||
const id = user?.id || "";
|
const id = user?.id || "";
|
||||||
const [activeCategory, setActiveCategory] = useState<string | null>(
|
const [activeCategory, setActiveCategory] = useState<string | null>(
|
||||||
"publish"
|
status || "publish"
|
||||||
);
|
);
|
||||||
|
|
||||||
const [listData, setListData] = useState([]);
|
const [listData, setListData] = useState([]);
|
||||||
@@ -86,8 +88,14 @@ export default function VotingStatus() {
|
|||||||
style={{ width: "70%", alignSelf: "center" }}
|
style={{ width: "70%", alignSelf: "center" }}
|
||||||
variant="light"
|
variant="light"
|
||||||
>
|
>
|
||||||
{item?.awalVote && dateTimeView({date: item?.awalVote, withoutTime: true})} -{" "}
|
{item?.awalVote &&
|
||||||
{item?.akhirVote && dateTimeView({date: item?.akhirVote, withoutTime: true})}
|
dateTimeView({
|
||||||
|
date: item?.awalVote,
|
||||||
|
withoutTime: true,
|
||||||
|
})}{" "}
|
||||||
|
-{" "}
|
||||||
|
{item?.akhirVote &&
|
||||||
|
dateTimeView({ date: item?.akhirVote, withoutTime: true })}
|
||||||
</BadgeCustom>
|
</BadgeCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconArchive, IconContribution } from "@/components/_Icon";
|
import { IconArchive, IconContribution } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Voting_BoxDetailHasilVotingSection from "@/screens/Voting/BoxDetailHasilVotingSection";
|
import Voting_BoxDetailHasilVotingSection from "@/screens/Voting/BoxDetailHasilVotingSection";
|
||||||
import { Voting_BoxDetailPublishSection } from "@/screens/Voting/BoxDetailPublishSection";
|
import { Voting_BoxDetailPublishSection } from "@/screens/Voting/BoxDetailPublishSection";
|
||||||
@@ -22,13 +23,14 @@ import {
|
|||||||
apiVotingUpdateData,
|
apiVotingUpdateData,
|
||||||
} from "@/service/api-client/api-voting";
|
} from "@/service/api-client/api-voting";
|
||||||
import { today } from "@/utils/dateTimeView";
|
import { today } from "@/utils/dateTimeView";
|
||||||
|
import dayjs from "dayjs";
|
||||||
import {
|
import {
|
||||||
router,
|
router,
|
||||||
Stack,
|
Stack,
|
||||||
useFocusEffect,
|
useFocusEffect,
|
||||||
useLocalSearchParams,
|
useLocalSearchParams,
|
||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import React, { useCallback, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function VotingDetail() {
|
export default function VotingDetail() {
|
||||||
@@ -119,6 +121,23 @@ export default function VotingDetail() {
|
|||||||
setOpenDrawerPublish(false);
|
setOpenDrawerPublish(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const now = new Date().toISOString();
|
||||||
|
const isEventFinished = id && data?.akhirVote && dayjs(data.akhirVote).isBefore(now);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isEventFinished) {
|
||||||
|
router.replace(`/(application)/(user)/voting/${id}/history`);
|
||||||
|
}
|
||||||
|
}, [isEventFinished, id]);
|
||||||
|
|
||||||
|
if (isEventFinished) {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<CustomSkeleton />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export default function VotingCreate() {
|
|||||||
type: "success",
|
type: "success",
|
||||||
text1: "Data berhasil disimpan",
|
text1: "Data berhasil disimpan",
|
||||||
});
|
});
|
||||||
router.replace("/(application)/(user)/voting/(tabs)/status");
|
router.replace("/(application)/(user)/voting/(tabs)/status?status=review");
|
||||||
} else {
|
} else {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
|
|||||||
@@ -15,12 +15,11 @@ import { IconDot, IconView } from "@/components/_Icon/IconComponent";
|
|||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
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_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
||||||
import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent";
|
import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
apiAdminForumCommentById,
|
apiAdminForumCommentById,
|
||||||
apiAdminForumDeactivateComment,
|
apiAdminForumDeactivateComment,
|
||||||
@@ -35,6 +34,7 @@ import Toast from "react-native-toast-message";
|
|||||||
|
|
||||||
export default function AdminForumReportComment() {
|
export default function AdminForumReportComment() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
|
const { user } = useAuth();
|
||||||
const [data, setData] = useState<any | null>(null);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [listReport, setListReport] = useState<any[] | null>(null);
|
const [listReport, setListReport] = useState<any[] | null>(null);
|
||||||
const [loadList, setLoadList] = useState(false);
|
const [loadList, setLoadList] = useState(false);
|
||||||
@@ -111,9 +111,13 @@ export default function AdminForumReportComment() {
|
|||||||
|
|
||||||
<AdminComp_BoxTitle title="Daftar Report Komentar" />
|
<AdminComp_BoxTitle title="Daftar Report Komentar" />
|
||||||
|
|
||||||
<StackCustom gap={"sm"}>
|
<StackCustom gap={"sm"}>
|
||||||
<GridSpan_NewComponent
|
<GridSpan_NewComponent
|
||||||
text1={<TextCustom bold align="center">Aksi</TextCustom>}
|
text1={
|
||||||
|
<TextCustom bold align="center">
|
||||||
|
Aksi
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
text2={<TextCustom bold>Pelapor</TextCustom>}
|
text2={<TextCustom bold>Pelapor</TextCustom>}
|
||||||
text3={<TextCustom bold>Kategori Report</TextCustom>}
|
text3={<TextCustom bold>Kategori Report</TextCustom>}
|
||||||
/>
|
/>
|
||||||
@@ -129,22 +133,24 @@ export default function AdminForumReportComment() {
|
|||||||
<View key={index}>
|
<View key={index}>
|
||||||
<GridSpan_NewComponent
|
<GridSpan_NewComponent
|
||||||
text1={
|
text1={
|
||||||
<CenterCustom>
|
<CenterCustom>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
icon={
|
||||||
onPress={() => {
|
<IconView size={ICON_SIZE_BUTTON} color="black" />
|
||||||
setOpenDrawerAction(true);
|
}
|
||||||
setSelectedReport({
|
onPress={() => {
|
||||||
id: item.id,
|
setOpenDrawerAction(true);
|
||||||
username: item.User?.username,
|
setSelectedReport({
|
||||||
kategori: item.ForumMaster_KategoriReport?.title,
|
id: item.id,
|
||||||
keterangan:
|
username: item.User?.username,
|
||||||
item.ForumMaster_KategoriReport?.deskripsi,
|
kategori: item.ForumMaster_KategoriReport?.title,
|
||||||
deskripsi: item.deskripsi,
|
keterangan:
|
||||||
});
|
item.ForumMaster_KategoriReport?.deskripsi,
|
||||||
}}
|
deskripsi: item.deskripsi,
|
||||||
/>
|
});
|
||||||
</CenterCustom>
|
}}
|
||||||
|
/>
|
||||||
|
</CenterCustom>
|
||||||
}
|
}
|
||||||
text2={
|
text2={
|
||||||
<TextCustom truncate={1}>
|
<TextCustom truncate={1}>
|
||||||
@@ -188,15 +194,18 @@ export default function AdminForumReportComment() {
|
|||||||
onPressRight: async () => {
|
onPressRight: async () => {
|
||||||
const deleteComment = await apiAdminForumDeactivateComment({
|
const deleteComment = await apiAdminForumDeactivateComment({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
|
data: {
|
||||||
|
senderId: user?.id as string,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!deleteComment.success) {
|
// if (!deleteComment.success) {
|
||||||
Toast.show({
|
// Toast.show({
|
||||||
type: "error",
|
// type: "error",
|
||||||
text1: "Komentar gagal dihapus",
|
// text1: "Komentar gagal dihapus",
|
||||||
});
|
// });
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
setOpenDrawer(false);
|
setOpenDrawer(false);
|
||||||
Toast.show({
|
Toast.show({
|
||||||
|
|||||||
@@ -16,12 +16,11 @@ import { IconDot, IconView } from "@/components/_Icon/IconComponent";
|
|||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
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_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
||||||
import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent";
|
import { GridSpan_NewComponent } from "@/components/_ShareComponent/GridSpan_NewComponent";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
apiAdminForumDeactivatePosting,
|
apiAdminForumDeactivatePosting,
|
||||||
apiAdminForumListReportPostingById,
|
apiAdminForumListReportPostingById,
|
||||||
@@ -35,6 +34,7 @@ import { Divider } from "react-native-paper";
|
|||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminForumReportPosting() {
|
export default function AdminForumReportPosting() {
|
||||||
|
const { user } = useAuth();
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
||||||
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
||||||
@@ -215,6 +215,9 @@ export default function AdminForumReportPosting() {
|
|||||||
onPressRight: async () => {
|
onPressRight: async () => {
|
||||||
const response = await apiAdminForumDeactivatePosting({
|
const response = await apiAdminForumDeactivatePosting({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
|
data: {
|
||||||
|
senderId: user?.id as string,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export default function AdminForumReportPosting() {
|
|||||||
<GridSpan_NewComponent
|
<GridSpan_NewComponent
|
||||||
text1={
|
text1={
|
||||||
<TextCustom bold truncate>
|
<TextCustom bold truncate>
|
||||||
Username
|
Pelapor
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
}
|
}
|
||||||
text2={
|
text2={
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButt
|
|||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||||
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import ReportBox from "@/components/Box/ReportBox";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
@@ -28,6 +29,7 @@ import {
|
|||||||
apiAdminInvestmentDetailById,
|
apiAdminInvestmentDetailById,
|
||||||
} from "@/service/api-admin/api-admin-investment";
|
} from "@/service/api-admin/api-admin-investment";
|
||||||
import { colorBadgeStatus } from "@/utils/colorBadge";
|
import { colorBadgeStatus } from "@/utils/colorBadge";
|
||||||
|
import { countDownAndCondition } from "@/utils/countDownAndCondition";
|
||||||
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
@@ -40,91 +42,41 @@ export default function AdminInvestmentDetail() {
|
|||||||
|
|
||||||
const [data, setData] = React.useState<any | null>(null);
|
const [data, setData] = React.useState<any | null>(null);
|
||||||
const [isLoading, setLoading] = React.useState(false);
|
const [isLoading, setLoading] = React.useState(false);
|
||||||
|
const [remind, setRemind] = React.useState({
|
||||||
|
sisa: 0,
|
||||||
|
reminder: false,
|
||||||
|
});
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
React.useCallback(() => {
|
React.useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id])
|
}, [id]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiAdminInvestmentDetailById({ id: id as string });
|
const response = await apiAdminInvestmentDetailById({ id: id as string });
|
||||||
// console.log("[GETONE INVEST]", JSON.stringify(response, null, 2));
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
|
|
||||||
|
const duration = response?.data?.MasterPencarianInvestor?.name;
|
||||||
|
const publishTime = response?.data?.countDown;
|
||||||
|
|
||||||
|
const countDown = countDownAndCondition({
|
||||||
|
duration: duration,
|
||||||
|
publishTime: publishTime
|
||||||
|
});
|
||||||
|
|
||||||
|
setRemind({
|
||||||
|
sisa: countDown.durationDay,
|
||||||
|
reminder: countDown.reminder,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log("Error", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: (data && data?.author?.username) || "-",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Judul",
|
|
||||||
value: (data && data?.title) || "-",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Status",
|
|
||||||
value:
|
|
||||||
data && data?.MasterStatusInvestasi?.name ? (
|
|
||||||
<BadgeCustom
|
|
||||||
color={colorBadgeStatus({
|
|
||||||
status: data?.MasterStatusInvestasi?.name as string,
|
|
||||||
})}
|
|
||||||
>
|
|
||||||
{_.startCase(data?.MasterStatusInvestasi?.name as string)}
|
|
||||||
</BadgeCustom>
|
|
||||||
) : (
|
|
||||||
"-"
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Dana Dibutuhkan",
|
|
||||||
value: `Rp. ${
|
|
||||||
(data && data?.targetDana && formatCurrencyDisplay(data?.targetDana)) ||
|
|
||||||
"-"
|
|
||||||
}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Harga Perlembar",
|
|
||||||
value: `Rp. ${
|
|
||||||
(data &&
|
|
||||||
data?.hargaLembar &&
|
|
||||||
formatCurrencyDisplay(data?.hargaLembar)) ||
|
|
||||||
"-"
|
|
||||||
}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Total Lembar",
|
|
||||||
value:
|
|
||||||
(data &&
|
|
||||||
data?.totalLembar &&
|
|
||||||
formatCurrencyDisplay(data?.totalLembar)) ||
|
|
||||||
"-",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "ROI",
|
|
||||||
value: `${(data && data?.roi && data?.roi) || 0} %`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Pembagian Deviden",
|
|
||||||
value: (data && data?.MasterPembagianDeviden?.name) + " bulan" || "-",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Jadwal Pembagian",
|
|
||||||
value: (data && data?.MasterPeriodeDeviden?.name) || "-",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Pencarian Investor",
|
|
||||||
value: (data && data?.MasterPencarianInvestor?.name) + " hari" || "-",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const handlerSubmitPublish = async () => {
|
const handlerSubmitPublish = async () => {
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -134,7 +86,6 @@ export default function AdminInvestmentDetail() {
|
|||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log("[GET ON INVEST]", JSON.stringify(response, null, 2));
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -164,6 +115,16 @@ export default function AdminInvestmentDetail() {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper>
|
||||||
|
<CustomSkeleton height={200} />
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -177,8 +138,8 @@ export default function AdminInvestmentDetail() {
|
|||||||
{status === "publish" && (
|
{status === "publish" && (
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<ProgressCustom
|
<ProgressCustom
|
||||||
label={data && `${data.progress}%` || "0%"}
|
label={(data && `${data.progress}%`) || "0%"}
|
||||||
value={data && data.progress || 0}
|
value={(data && data.progress) || 0}
|
||||||
size="lg"
|
size="lg"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
@@ -187,7 +148,8 @@ export default function AdminInvestmentDetail() {
|
|||||||
label={<TextCustom bold>Sisa Saham</TextCustom>}
|
label={<TextCustom bold>Sisa Saham</TextCustom>}
|
||||||
value={
|
value={
|
||||||
<TextCustom>
|
<TextCustom>
|
||||||
{data && formatCurrencyDisplay(data && data?.sisaLembar)} lembar
|
{data && formatCurrencyDisplay(data && data?.sisaLembar)}{" "}
|
||||||
|
lembar
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -206,13 +168,15 @@ export default function AdminInvestmentDetail() {
|
|||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<DummyLandscapeImage imageId={data?.imageId} />
|
<DummyLandscapeImage imageId={data?.imageId} />
|
||||||
{listData.map((item, i) => (
|
{listData({ data: data, reminder: remind.reminder })?.map(
|
||||||
<GridSpan_4_8
|
(item, i) => (
|
||||||
key={i}
|
<GridSpan_4_8
|
||||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
key={i}
|
||||||
value={<TextCustom>{item.value}</TextCustom>}
|
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||||
/>
|
value={<TextCustom>{item.value}</TextCustom>}
|
||||||
))}
|
/>
|
||||||
|
),
|
||||||
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
@@ -230,7 +194,7 @@ export default function AdminInvestmentDetail() {
|
|||||||
}
|
}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
router.push(
|
router.push(
|
||||||
`/(application)/(file)/${data?.prospektusFileId}`
|
`/(application)/(file)/${data?.prospektusFileId}`,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -259,7 +223,7 @@ export default function AdminInvestmentDetail() {
|
|||||||
}
|
}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
router.push(
|
router.push(
|
||||||
`/(application)/(file)/${item?.fileId}`
|
`/(application)/(file)/${item?.fileId}`,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -299,8 +263,8 @@ export default function AdminInvestmentDetail() {
|
|||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(
|
router.push(
|
||||||
`/admin/investment/${id}/reject-input?status=${_.lowerCase(
|
`/admin/investment/${id}/reject-input?status=${_.lowerCase(
|
||||||
data?.MasterStatusInvestasi?.name
|
data?.MasterStatusInvestasi?.name,
|
||||||
)}`
|
)}`,
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -343,3 +307,67 @@ export default function AdminInvestmentDetail() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const listData = ({ data, reminder }: { data: any; reminder: boolean }) => [
|
||||||
|
{
|
||||||
|
label: "Username",
|
||||||
|
value: (data && data?.author?.username) || "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Judul",
|
||||||
|
value: (data && data?.title) || "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Status",
|
||||||
|
value:
|
||||||
|
data && data?.MasterStatusInvestasi?.name ? (
|
||||||
|
<BadgeCustom
|
||||||
|
color={colorBadgeStatus({
|
||||||
|
status: reminder ? "periode berakhir" : "publish",
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{reminder
|
||||||
|
? "Periode Berakhir"
|
||||||
|
: _.startCase(data?.MasterStatusInvestasi?.name as string)}
|
||||||
|
</BadgeCustom>
|
||||||
|
) : (
|
||||||
|
"-"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Dana Dibutuhkan",
|
||||||
|
value: `Rp. ${
|
||||||
|
(data && data?.targetDana && formatCurrencyDisplay(data?.targetDana)) ||
|
||||||
|
"-"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Harga Perlembar",
|
||||||
|
value: `Rp. ${
|
||||||
|
(data && data?.hargaLembar && formatCurrencyDisplay(data?.hargaLembar)) ||
|
||||||
|
"-"
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Total Lembar",
|
||||||
|
value:
|
||||||
|
(data && data?.totalLembar && formatCurrencyDisplay(data?.totalLembar)) ||
|
||||||
|
"-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "ROI",
|
||||||
|
value: `${(data && data?.roi && data?.roi) || 0} %`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Pembagian Deviden",
|
||||||
|
value: (data && data?.MasterPembagianDeviden?.name) + " bulan" || "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Jadwal Pembagian",
|
||||||
|
value: (data && data?.MasterPeriodeDeviden?.name) || "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Pencarian Investor",
|
||||||
|
value: (data && data?.MasterPencarianInvestor?.name) + " hari" || "-",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButt
|
|||||||
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
||||||
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
apiAdminInvestmentGetOneInvoiceById,
|
apiAdminInvestmentGetOneInvoiceById,
|
||||||
apiAdminInvestmentUpdateInvoice,
|
apiAdminInvestmentUpdateInvoice,
|
||||||
@@ -25,6 +26,7 @@ import { useCallback, useState } from "react";
|
|||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminInvestmentTransactionDetail() {
|
export default function AdminInvestmentTransactionDetail() {
|
||||||
|
const { user } = useAuth();
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [data, setData] = useState<any | null>(null);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [isLoading, setLoading] = useState<boolean>(false);
|
const [isLoading, setLoading] = useState<boolean>(false);
|
||||||
@@ -32,7 +34,7 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id])
|
}, [id]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
@@ -40,7 +42,6 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
const response = await apiAdminInvestmentGetOneInvoiceById({
|
const response = await apiAdminInvestmentGetOneInvoiceById({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
});
|
});
|
||||||
// console.log("[RESPONSE]", JSON.stringify(response, null, 2));
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
}
|
}
|
||||||
@@ -92,7 +93,7 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
router.push(
|
router.push(
|
||||||
`/(application)/(image)/preview-image/${data?.imageId}`
|
`/(application)/(image)/preview-image/${data?.imageId}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -109,6 +110,13 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
}: {
|
}: {
|
||||||
category: "accept" | "deny";
|
category: "accept" | "deny";
|
||||||
}) => {
|
}) => {
|
||||||
|
if (!user?.id) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal update status transaksi",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const response = await apiAdminInvestmentUpdateInvoice({
|
const response = await apiAdminInvestmentUpdateInvoice({
|
||||||
@@ -117,11 +125,10 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
data: {
|
data: {
|
||||||
investasiId: data?.investasiId,
|
investasiId: data?.investasiId,
|
||||||
lembarTerbeli: data?.lembarTerbeli,
|
lembarTerbeli: data?.lembarTerbeli,
|
||||||
|
senderId: user?.id as any,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log("[RESPONSE SUBMIT]", JSON.stringify(response, null, 2));
|
|
||||||
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
@@ -153,6 +160,7 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
styleRight={{ paddingLeft: 10 }}
|
styleRight={{ paddingLeft: 10 }}
|
||||||
leftIcon={
|
leftIcon={
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
disabled={isLoading}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
backgroundColor={MainColor.red}
|
backgroundColor={MainColor.red}
|
||||||
textColor="white"
|
textColor="white"
|
||||||
@@ -175,6 +183,7 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
}
|
}
|
||||||
rightIcon={
|
rightIcon={
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
disabled={isLoading}
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
AlertDefaultSystem({
|
AlertDefaultSystem({
|
||||||
@@ -198,8 +207,8 @@ export default function AdminInvestmentTransactionDetail() {
|
|||||||
} else if (data?.StatusInvoice?.name === "Gagal") {
|
} else if (data?.StatusInvoice?.name === "Gagal") {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonCustom textColor="red" onPress={() => router.back()}>
|
<ButtonCustom disabled onPress={() => router.back()}>
|
||||||
Gagal
|
Transaksi telah gagal
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,34 +7,39 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import { apiAdminInvestasiUpdateByStatus, apiAdminInvestmentDetailById } from "@/service/api-admin/api-admin-investment";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
|
import {
|
||||||
|
apiAdminInvestasiUpdateByStatus,
|
||||||
|
apiAdminInvestmentDetailById,
|
||||||
|
} from "@/service/api-admin/api-admin-investment";
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminInvestmentRejectInput() {
|
export default function AdminInvestmentRejectInput() {
|
||||||
|
const { user } = useAuth();
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
console.log("[STATUS]", status);
|
console.log("[STATUS]", status);
|
||||||
const [value, setValue] = useState<any | null>(null);
|
const [value, setValue] = useState<any | null>(null);
|
||||||
const [isLoading , setLoading] = useState(false)
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id])
|
}, [id])
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiAdminInvestmentDetailById({ id: id as string });
|
const response = await apiAdminInvestmentDetailById({ id: id as string });
|
||||||
console.log("[DATA]", JSON.stringify(response, null, 2));
|
console.log("[DATA]", JSON.stringify(response, null, 2));
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setValue(response.data?.catatan);
|
setValue(response.data?.catatan);
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error);
|
|
||||||
}
|
}
|
||||||
};
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handlerSubmit = async () => {
|
const handlerSubmit = async () => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
@@ -45,12 +50,23 @@ export default function AdminInvestmentRejectInput() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!user?.id) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "User tidak ditemukan",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true);
|
||||||
const response = await apiAdminInvestasiUpdateByStatus({
|
const response = await apiAdminInvestasiUpdateByStatus({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
status: "reject",
|
status: "reject",
|
||||||
data: value,
|
data: {
|
||||||
|
catatan: value,
|
||||||
|
senderId: user?.id as string,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RESPONSE]", JSON.stringify(response, null, 2));
|
console.log("[RESPONSE]", JSON.stringify(response, null, 2));
|
||||||
@@ -76,7 +92,7 @@ export default function AdminInvestmentRejectInput() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(["ERROR"], error);
|
console.error(["ERROR"], error);
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false)
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import { Divider } from "react-native-paper";
|
|||||||
|
|
||||||
export default function AdminInvestmentStatus() {
|
export default function AdminInvestmentStatus() {
|
||||||
const { status } = useLocalSearchParams();
|
const { status } = useLocalSearchParams();
|
||||||
console.log("[STATUS]", status);
|
|
||||||
|
|
||||||
const [listData, setListData] = React.useState<any[] | null>(null);
|
const [listData, setListData] = React.useState<any[] | null>(null);
|
||||||
const [loadData, setLoadingData] = React.useState(false);
|
const [loadData, setLoadingData] = React.useState(false);
|
||||||
const [search, setSearch] = React.useState("");
|
const [search, setSearch] = React.useState("");
|
||||||
@@ -41,7 +39,7 @@ export default function AdminInvestmentStatus() {
|
|||||||
category: status as "publish" | "review" | "reject",
|
category: status as "publish" | "review" | "reject",
|
||||||
search,
|
search,
|
||||||
});
|
});
|
||||||
console.log("[LIST DATA]", JSON.stringify(response, null, 2));
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setListData(response.data);
|
setListData(response.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
|||||||
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
import { GridSpan_4_8 } from "@/components/_ShareComponent/GridSpan_4_8";
|
||||||
import ReportBox from "@/components/Box/ReportBox";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
||||||
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
||||||
import { colorBadgeStatus } from "@/utils/colorBadge";
|
import { colorBadgeStatus } from "@/utils/colorBadge";
|
||||||
@@ -29,6 +30,7 @@ import { List } from "react-native-paper";
|
|||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminVotingDetail() {
|
export default function AdminVotingDetail() {
|
||||||
|
const { user } = useAuth();
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
const [data, setData] = useState<any | null>(null);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -139,6 +141,10 @@ export default function AdminVotingDetail() {
|
|||||||
const response = await funUpdateStatusVoting({
|
const response = await funUpdateStatusVoting({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
changeStatus,
|
changeStatus,
|
||||||
|
data: {
|
||||||
|
senderId: user?.id as string,
|
||||||
|
catatan: "",
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
||||||
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
@@ -14,6 +15,7 @@ import { useCallback, useState } from "react";
|
|||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminVotingRejectInput() {
|
export default function AdminVotingRejectInput() {
|
||||||
|
const { user } = useAuth()
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
const [data, setData] = useState("");
|
const [data, setData] = useState("");
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
@@ -48,7 +50,10 @@ export default function AdminVotingRejectInput() {
|
|||||||
const response = await funUpdateStatusVoting({
|
const response = await funUpdateStatusVoting({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
changeStatus,
|
changeStatus,
|
||||||
data: data,
|
data: {
|
||||||
|
catatan: data,
|
||||||
|
senderId: user?.id as string,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { apiAdminEventUpdateStatus } from "@/service/api-admin/api-admin-event";
|
import { apiAdminEventUpdateStatus } from "@/service/api-admin/api-admin-event";
|
||||||
import { RejectedData } from "@/types/type-collect-other";
|
import { typeRejectedData } from "@/types/type-collect-other";
|
||||||
|
|
||||||
export const funUpdateStatusEvent = async ({
|
export const funUpdateStatusEvent = async ({
|
||||||
id,
|
id,
|
||||||
@@ -8,7 +8,7 @@ export const funUpdateStatusEvent = async ({
|
|||||||
}: {
|
}: {
|
||||||
id: string;
|
id: string;
|
||||||
changeStatus: "publish" | "review" | "reject";
|
changeStatus: "publish" | "review" | "reject";
|
||||||
data?: RejectedData;
|
data?: typeRejectedData;
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
console.log("[DATA]", data);
|
console.log("[DATA]", data);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { apiAdminVotingUpdateStatus } from "@/service/api-admin/api-admin-voting";
|
import { apiAdminVotingUpdateStatus } from "@/service/api-admin/api-admin-voting";
|
||||||
|
import { typeRejectedData } from "@/types/type-collect-other";
|
||||||
|
|
||||||
const funUpdateStatusVoting = async ({
|
const funUpdateStatusVoting = async ({
|
||||||
id,
|
id,
|
||||||
@@ -7,7 +8,7 @@ const funUpdateStatusVoting = async ({
|
|||||||
}: {
|
}: {
|
||||||
id: string;
|
id: string;
|
||||||
changeStatus: "publish" | "review" | "reject";
|
changeStatus: "publish" | "review" | "reject";
|
||||||
data?: string;
|
data?: typeRejectedData;
|
||||||
}) => {
|
}) => {
|
||||||
try {
|
try {
|
||||||
const response = await apiAdminVotingUpdateStatus({
|
const response = await apiAdminVotingUpdateStatus({
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ export const tabsHome: any = ({
|
|||||||
icon: "chatbubble-ellipses-outline",
|
icon: "chatbubble-ellipses-outline",
|
||||||
activeIcon: "chatbubble-ellipses",
|
activeIcon: "chatbubble-ellipses",
|
||||||
label: "Forum",
|
label: "Forum",
|
||||||
path: acceptedForumTermsAt ? "/forum" : "/forum/terms",
|
// path: acceptedForumTermsAt ? "/forum" : "/forum/terms",
|
||||||
|
path: "/forum",
|
||||||
isActive: true,
|
isActive: true,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
import { countDownAndCondition } from "@/utils/countDownAndCondition";
|
import { countDownAndCondition } from "@/utils/countDownAndCondition";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
@@ -22,8 +21,6 @@ export default function Investment_BoxBerandaSection({
|
|||||||
id: string;
|
id: string;
|
||||||
data: any;
|
data: any;
|
||||||
}) {
|
}) {
|
||||||
// console.log("[DATA By one]", JSON.stringify(data, null, 2));
|
|
||||||
|
|
||||||
const [value, setValue] = useState({
|
const [value, setValue] = useState({
|
||||||
sisa: 0,
|
sisa: 0,
|
||||||
reminder: false,
|
reminder: false,
|
||||||
@@ -33,8 +30,6 @@ export default function Investment_BoxBerandaSection({
|
|||||||
updateCountDown();
|
updateCountDown();
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
console.log("[DATA BERANDA]", JSON.stringify(data, null, 2));
|
|
||||||
|
|
||||||
const updateCountDown = () => {
|
const updateCountDown = () => {
|
||||||
const countDown = countDownAndCondition({
|
const countDown = countDownAndCondition({
|
||||||
duration: data?.pencarianInvestor,
|
duration: data?.pencarianInvestor,
|
||||||
|
|||||||
@@ -57,9 +57,19 @@ export async function apiAdminForumListReportCommentById({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function apiAdminForumDeactivateComment({ id }: { id: string }) {
|
export async function apiAdminForumDeactivateComment({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: { senderId: string };
|
||||||
|
}) {
|
||||||
|
|
||||||
|
console.log("data", data)
|
||||||
try {
|
try {
|
||||||
const response = await apiConfig.put(`/mobile/admin/forum/${id}/comment`);
|
const response = await apiConfig.put(`/mobile/admin/forum/${id}/comment`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
@@ -81,9 +91,17 @@ export async function apiAdminForumListReportPostingById({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function apiAdminForumDeactivatePosting({ id }: { id: string }) {
|
export async function apiAdminForumDeactivatePosting({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: { senderId: string };
|
||||||
|
}) {
|
||||||
try {
|
try {
|
||||||
const response = await apiConfig.put(`/mobile/admin/forum/${id}`);
|
const response = await apiConfig.put(`/mobile/admin/forum/${id}`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { typeRejectedData } from "@/types/type-collect-other";
|
||||||
import { apiConfig } from "../api-config";
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
export async function apiAdminInvestment({
|
export async function apiAdminInvestment({
|
||||||
@@ -38,7 +39,7 @@ export async function apiAdminInvestasiUpdateByStatus({
|
|||||||
}: {
|
}: {
|
||||||
id: string;
|
id: string;
|
||||||
status: "publish" | "review" | "reject";
|
status: "publish" | "review" | "reject";
|
||||||
data: any;
|
data: typeRejectedData;
|
||||||
}) {
|
}) {
|
||||||
try {
|
try {
|
||||||
const response = await apiConfig.put(
|
const response = await apiConfig.put(
|
||||||
@@ -97,6 +98,7 @@ export async function apiAdminInvestmentUpdateInvoice({
|
|||||||
data: {
|
data: {
|
||||||
investasiId: string;
|
investasiId: string;
|
||||||
lembarTerbeli: number;
|
lembarTerbeli: number;
|
||||||
|
senderId: string
|
||||||
};
|
};
|
||||||
}) {
|
}) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { typeRejectedData } from "@/types/type-collect-other";
|
||||||
import { apiConfig } from "../api-config";
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
export async function apiAdminVoting({
|
export async function apiAdminVoting({
|
||||||
@@ -32,7 +33,7 @@ export async function apiAdminVotingUpdateStatus({
|
|||||||
status,
|
status,
|
||||||
}: {
|
}: {
|
||||||
id: string;
|
id: string;
|
||||||
data?: string;
|
data?: typeRejectedData;
|
||||||
status: "publish" | "review" | "reject";
|
status: "publish" | "review" | "reject";
|
||||||
}) {
|
}) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -119,3 +119,62 @@ export async function apiForumDeleteComment({ id }: { id: string }) {
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function apiForumGetReportPosting({id}: {id:string}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/forum/${id}/preview-report-posting`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiForumGetReportComment({id}: {id:string}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/forum/${id}/preview-report-comment`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export async function apiForumCreateReportPosting({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.post(
|
||||||
|
`/mobile/forum/${id}/report-posting`,
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiForumCreateReportCommentar({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.post(
|
||||||
|
`/mobile/forum/${id}/report-commentar`,
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -77,46 +77,6 @@ export async function apiMasterForumReportList() {
|
|||||||
|
|
||||||
// ================== END MASTER FORUM ================== //
|
// ================== END MASTER FORUM ================== //
|
||||||
|
|
||||||
export async function apiForumCreateReportPosting({
|
|
||||||
id,
|
|
||||||
data,
|
|
||||||
}: {
|
|
||||||
id: string;
|
|
||||||
data: any;
|
|
||||||
}) {
|
|
||||||
try {
|
|
||||||
const response = await apiConfig.post(
|
|
||||||
`/mobile/forum/${id}/report-posting`,
|
|
||||||
{
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return response.data;
|
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function apiForumCreateReportCommentar({
|
|
||||||
id,
|
|
||||||
data,
|
|
||||||
}: {
|
|
||||||
id: string;
|
|
||||||
data: any;
|
|
||||||
}) {
|
|
||||||
try {
|
|
||||||
const response = await apiConfig.post(
|
|
||||||
`/mobile/forum/${id}/report-commentar`,
|
|
||||||
{
|
|
||||||
data: data,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
return response.data;
|
|
||||||
} catch (error) {
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ================== START MASTER INVESTMENT ================== //
|
// ================== START MASTER INVESTMENT ================== //
|
||||||
|
|
||||||
export async function apiMasterInvestment({
|
export async function apiMasterInvestment({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export type RejectedData = {
|
export type typeRejectedData = {
|
||||||
catatan?: string;
|
catatan?: string;
|
||||||
senderId: string;
|
senderId: string;
|
||||||
};
|
};
|
||||||
|
|||||||
15
types/type-forum.ts
Normal file
15
types/type-forum.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
export interface TypeForum_CommentProps {
|
||||||
|
id: string;
|
||||||
|
isActive: boolean;
|
||||||
|
komentar: string;
|
||||||
|
createdAt: Date;
|
||||||
|
authorId: string;
|
||||||
|
Author: {
|
||||||
|
id: string;
|
||||||
|
username: string;
|
||||||
|
Profile: {
|
||||||
|
id: string;
|
||||||
|
imageId: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -5,11 +5,11 @@ const badWordsIndonesia = [
|
|||||||
'anjing', 'babi', 'bangsat', 'bodoh', 'goblok', 'idiot', 'jancok', 'jembut', 'kampret',
|
'anjing', 'babi', 'bangsat', 'bodoh', 'goblok', 'idiot', 'jancok', 'jembut', 'kampret',
|
||||||
'kontol', 'memek', 'ngentot', 'peler', 'puki', 'sialan', 'tai', 'tolol', 'wibu',
|
'kontol', 'memek', 'ngentot', 'peler', 'puki', 'sialan', 'tai', 'tolol', 'wibu',
|
||||||
'anjingg', 'babbii', 'bangsaat', 'gobllokk', 'jancokk', 'kontoll', 'memekk', 'ngentott',
|
'anjingg', 'babbii', 'bangsaat', 'gobllokk', 'jancokk', 'kontoll', 'memekk', 'ngentott',
|
||||||
'pelerr', 'puuki', 'sialann', 'taii', 'tololl', 'wibuu',
|
'pelerr', 'puuki', 'sialann', 'taii', 'tololl', 'wibuu', 'cicing',
|
||||||
|
|
||||||
// 🔥 Kata Sindiran & Penghinaan
|
// 🔥 Kata Sindiran & Penghinaan
|
||||||
'bego', 'dungu', 'edan', 'gila', 'goblog', 'kampang', 'kampret', 'keparat', 'lonte',
|
'bego', 'dungu', 'edan', 'gila', 'goblog', 'kampang', 'kampret', 'keparat', 'lonte',
|
||||||
'main mata', 'monyet', 'najis', 'ngeyel', 'ngibul', 'ngomong seenaknya', 'ngurangin',
|
'monyet', 'najis', 'ngeyel', 'ngibul', 'ngomong seenaknya', 'ngurangin',
|
||||||
'ngutang', 'ngurusin urusan orang', 'pemalas', 'pengecut', 'penipu', 'sinting',
|
'ngutang', 'ngurusin urusan orang', 'pemalas', 'pengecut', 'penipu', 'sinting',
|
||||||
'begoo', 'dunguu', 'goblogg', 'kampangg', 'keparatt', 'lontee', 'monyyet', 'najiss',
|
'begoo', 'dunguu', 'goblogg', 'kampangg', 'keparatt', 'lontee', 'monyyet', 'najiss',
|
||||||
'ngeyell', 'ngibull', 'ngomongg seenaknya', 'nguranginn', 'ngutangg', 'pemalass',
|
'ngeyell', 'ngibull', 'ngomongg seenaknya', 'nguranginn', 'ngutangg', 'pemalass',
|
||||||
@@ -23,18 +23,17 @@ const badWordsIndonesia = [
|
|||||||
|
|
||||||
// 💸 Kata Spam / Promosi Ilegal
|
// 💸 Kata Spam / Promosi Ilegal
|
||||||
'judi', 'togel', 'slot', 'casino', 'poker', 'qq', 'bandar', 'agen', 'link', 'wa',
|
'judi', 'togel', 'slot', 'casino', 'poker', 'qq', 'bandar', 'agen', 'link', 'wa',
|
||||||
'whatsapp', 'telepon', 'nomor', 'hp', 'sms', 'grup', 'join', 'daftar', 'bonus',
|
'deposit', 'withdraw',
|
||||||
'deposit', 'withdraw', 'uang', 'duit', 'rp', 'ratusan', 'juta', 'milyar',
|
|
||||||
'judii', 'togell', 'slotss', 'casinoo', 'pokerr', 'qqq', 'bandarr', 'agenn', 'linkk',
|
'judii', 'togell', 'slotss', 'casinoo', 'pokerr', 'qqq', 'bandarr', 'agenn', 'linkk',
|
||||||
'waa', 'whatsappp', 'teleponn', 'nomorr', 'hpp', 'smss', 'grupp', 'jooin', 'daftarr',
|
'waa',
|
||||||
'bonuss', 'depositt', 'withdraww', 'uangs', 'duitt', 'rpp', 'ratusann', 'jutaa', 'milyarr',
|
'depositt', 'withdraww', 'rpp',
|
||||||
|
|
||||||
// 🧩 Variasi Penulisan (Bypass Filter)
|
// 🧩 Variasi Penulisan (Bypass Filter)
|
||||||
'a*njing', 'b*b*i', 'b*ngsat', 'g*blok', 'k*nt*l', 'm*m*k', 'n*g*nt*t', 'p*l*r',
|
'a*njing', 'b*b*i', 'b*ngsat', 'g*blok', 'k*nt*l', 'm*m*k', 'n*g*nt*t', 'p*l*r',
|
||||||
't*i', 't*l*l', 'j*n*c*k', 'j*m*b*t', 'k*m*p*r*t', 's*i*l*a*n', 'w*b*u',
|
't*i', 't*l*l', 'j*n*c*k', 'j*m*b*t', 'k*m*p*r*t', 's*i*l*a*n', 'w*b*u',
|
||||||
'a.n.j.i.n.g', 'b.a.b.i', 'b.a.n.g.s.a.t', 'g.o.b.l.o.k', 'k.o.n.t.o.l', 'm.e.m.e.k',
|
'a.n.j.i.n.g', 'b.a.b.i', 'b.a.n.g.s.a.t', 'g.o.b.l.o.k', 'k.o.n.t.o.l', 'm.e.m.e.k',
|
||||||
'n.g.e.n.t.o.t', 'p.e.l.e.r', 't.a.i', 't.o.l.o.l', 'j.a.n.c.o.k', 'j.e.m.b.u.t',
|
'n.g.e.n.t.o.t', 'p.e.l.e.r', 't.a.i', 't.o.l.o.l', 'j.a.n.c.o.k', 'j.e.m.b.u.t',
|
||||||
'k.a.m.p.r.e.t', 's.i.a.l.a.n', 'w.i.b.u',
|
'k.a.m.p.r.e.t', 's.i.a.l.a.n', 'w.i.b.u', 'c.i.c.i.n.g',
|
||||||
|
|
||||||
// 📱 Variasi dengan Angka & Simbol
|
// 📱 Variasi dengan Angka & Simbol
|
||||||
'4nj1ng', 'b4b1', 'b4ngs4t', 'g0bl0k', 'k0nt0l', 'm3m3k', 'ng3nt0t', 'p3l3r',
|
'4nj1ng', 'b4b1', 'b4ngs4t', 'g0bl0k', 'k0nt0l', 'm3m3k', 'ng3nt0t', 'p3l3r',
|
||||||
@@ -43,8 +42,6 @@ const badWordsIndonesia = [
|
|||||||
'p3l3rr', 't4ii', 't0l0ll', 'j4nc0kk', 'j3mbutt', 'k4mpr3tt', 's14l4nn', 'w1buu',
|
'p3l3rr', 't4ii', 't0l0ll', 'j4nc0kk', 'j3mbutt', 'k4mpr3tt', 's14l4nn', 'w1buu',
|
||||||
|
|
||||||
// 🗣️ Kata yang Sering Digunakan dalam Konteks Negatif
|
// 🗣️ Kata yang Sering Digunakan dalam Konteks Negatif
|
||||||
'dasar', 'kamu', 'kau', 'lu', 'lo', 'gue', 'gua', 'kita', 'kami', 'mereka',
|
|
||||||
'dasarr', 'kamuu', 'kauu', 'luu', 'loo', 'guee', 'guua', 'kitaa', 'kamii', 'merekaa',
|
|
||||||
'dasar bodoh', 'dasar goblok', 'dasar bangsat', 'dasar idiot', 'dasar sialan',
|
'dasar bodoh', 'dasar goblok', 'dasar bangsat', 'dasar idiot', 'dasar sialan',
|
||||||
'dasar bego', 'dasar dungu', 'dasar edan', 'dasar gila', 'dasar sinting',
|
'dasar bego', 'dasar dungu', 'dasar edan', 'dasar gila', 'dasar sinting',
|
||||||
'dasar pemalas', 'dasar pengecut', 'dasar penipu', 'dasar najis', 'dasar kampret',
|
'dasar pemalas', 'dasar pengecut', 'dasar penipu', 'dasar najis', 'dasar kampret',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import * as DocumentPicker from "expo-document-picker";
|
import * as DocumentPicker from "expo-document-picker";
|
||||||
import { Alert } from "react-native";
|
import { Alert, Platform } from "react-native";
|
||||||
|
|
||||||
const ALLOWED_IMAGE_EXTENSIONS = ["jpg", "jpeg", "png"];
|
const ALLOWED_IMAGE_EXTENSIONS = ["jpg", "jpeg", "png"];
|
||||||
const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
|
const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB
|
||||||
@@ -33,22 +33,52 @@ export default async function pickFile({
|
|||||||
await pickImage(setImageUri, aspectRatio);
|
await pickImage(setImageUri, aspectRatio);
|
||||||
} else {
|
} else {
|
||||||
// Jika tidak, tawarkan pilihan rasio (default [4,3])
|
// Jika tidak, tawarkan pilihan rasio (default [4,3])
|
||||||
showAspectRatioChoice(setImageUri);
|
// 🚀 Hanya tampilkan pilihan rasio di ANDROID
|
||||||
|
if (Platform.OS === "android") {
|
||||||
|
showAspectRatioChoice(setImageUri);
|
||||||
|
} else {
|
||||||
|
// iOS: langsung buka galeri dengan default [4, 3]
|
||||||
|
await pickImage(setImageUri, [4, 3]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (allowedType === "pdf") {
|
} else if (allowedType === "pdf") {
|
||||||
await pickPdf(setPdfUri);
|
await pickPdf(setPdfUri);
|
||||||
} else {
|
} else {
|
||||||
// Mode fleksibel: tampilkan pilihan
|
// Mode fleksibel: tampilkan pilihan
|
||||||
Alert.alert(
|
// Alert.alert(
|
||||||
"Pilih Jenis File",
|
// "Pilih Jenis File",
|
||||||
"Pilih sumber file yang ingin diunggah:",
|
// "Pilih sumber file yang ingin diunggah:",
|
||||||
[
|
// [
|
||||||
{ text: "Batal", style: "cancel" },
|
// { text: "Batal", style: "cancel" },
|
||||||
{ text: "Dokumen (PDF)", onPress: () => pickPdf(setPdfUri) },
|
// { text: "Dokumen (PDF)", onPress: () => pickPdf(setPdfUri) },
|
||||||
{ text: "Gambar", onPress: () => pickImage(setImageUri, aspectRatio) },
|
// { text: "Gambar", onPress: () => pickImage(setImageUri, aspectRatio) },
|
||||||
],
|
// ],
|
||||||
{ cancelable: true }
|
// { cancelable: true }
|
||||||
);
|
// );
|
||||||
|
if (Platform.OS === "android") {
|
||||||
|
Alert.alert(
|
||||||
|
"Pilih Jenis File",
|
||||||
|
"Pilih sumber file yang ingin diunggah:",
|
||||||
|
[
|
||||||
|
{ text: "Batal", style: "cancel" },
|
||||||
|
{ text: "Dokumen (PDF)", onPress: () => pickPdf(setPdfUri) },
|
||||||
|
{ text: "Gambar", onPress: () => showAspectRatioChoice(setImageUri) },
|
||||||
|
],
|
||||||
|
{ cancelable: true }
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// iOS: Langsung pakai default [4,3] untuk gambar
|
||||||
|
Alert.alert(
|
||||||
|
"Pilih Jenis File",
|
||||||
|
"Pilih sumber file yang ingin diunggah:",
|
||||||
|
[
|
||||||
|
{ text: "Batal", style: "cancel" },
|
||||||
|
{ text: "Dokumen (PDF)", onPress: () => pickPdf(setPdfUri) },
|
||||||
|
{ text: "Gambar", onPress: () => pickImage(setImageUri, [4, 3]) },
|
||||||
|
],
|
||||||
|
{ cancelable: true }
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user