Compare commits
5 Commits
api-admin/
...
api-admin/
| Author | SHA1 | Date | |
|---|---|---|---|
| 0770237fe5 | |||
| 6f4dd79568 | |||
| 9faa0b0f64 | |||
| e05a7c8701 | |||
| f50c5099d8 |
@@ -19,7 +19,6 @@ import Toast from "react-native-toast-message";
|
|||||||
|
|
||||||
export default function CollaborationEdit() {
|
export default function CollaborationEdit() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
console.log("id :", id);
|
|
||||||
const [data, setData] = useState<any>();
|
const [data, setData] = useState<any>();
|
||||||
const [listMaster, setListMaster] = useState<any[]>([]);
|
const [listMaster, setListMaster] = useState<any[]>([]);
|
||||||
const [loadingData, setLoadingData] = useState(false);
|
const [loadingData, setLoadingData] = useState(false);
|
||||||
|
|||||||
@@ -102,11 +102,13 @@ export default function Portofolio() {
|
|||||||
<Portofolio_SocialMediaSection
|
<Portofolio_SocialMediaSection
|
||||||
data={data?.Portofolio_MediaSosial}
|
data={data?.Portofolio_MediaSosial}
|
||||||
/>
|
/>
|
||||||
<Portofolio_ButtonDelete
|
{data?.Profile?.id !== profileId ? null : (
|
||||||
id={id as string}
|
<Portofolio_ButtonDelete
|
||||||
isLoadingDelete={isLoadingDelete}
|
id={id as string}
|
||||||
setIsLoadingDelete={setIsLoadingDelete}
|
isLoadingDelete={isLoadingDelete}
|
||||||
/>
|
setIsLoadingDelete={setIsLoadingDelete}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,18 +1,89 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import { router } from "expo-router";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import {
|
||||||
|
apiAdminMasterBusinessFieldById,
|
||||||
|
apiAdminMasterBusinessFieldUpdate,
|
||||||
|
} from "@/service/api-admin/api-master-admin";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { Switch } from "react-native-paper";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminAppInformation_BusinessFieldDetail() {
|
export default function AdminAppInformation_BusinessFieldDetail() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadDetail();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadDetail = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminMasterBusinessFieldById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
setData(response.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
setData(null);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlerSubmit = async () => {
|
||||||
|
if (!data.name) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Lengkapi Data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await apiAdminMasterBusinessFieldUpdate({
|
||||||
|
id: id as string,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal update data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Data berhasil di update",
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const buttonSubmit = (
|
const buttonSubmit = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => router.back()}
|
disabled={!data?.name}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => handlerSubmit()}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
@@ -28,6 +99,15 @@ export default function AdminAppInformation_BusinessFieldDetail() {
|
|||||||
label="Nama Bidang Bisnis"
|
label="Nama Bidang Bisnis"
|
||||||
placeholder="Masukan Nama Bidang Bisnis"
|
placeholder="Masukan Nama Bidang Bisnis"
|
||||||
required
|
required
|
||||||
|
value={data?.name}
|
||||||
|
onChangeText={(value) => setData({ ...data, name: value })}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextCustom>Status Aktivasi</TextCustom>
|
||||||
|
<Switch
|
||||||
|
color={MainColor.yellow}
|
||||||
|
value={data?.active}
|
||||||
|
onValueChange={(value) => setData({ ...data, active: value })}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -6,13 +6,52 @@ import {
|
|||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import { apiAdminMasterBusinessFieldCreate } from "@/service/api-admin/api-master-admin";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminAppInformation_BusinessFieldCreate() {
|
export default function AdminAppInformation_BusinessFieldCreate() {
|
||||||
|
const [data, setData] = useState<any>({
|
||||||
|
name: "",
|
||||||
|
});
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
const handlerSubmit = async () => {
|
||||||
|
if (!data.name) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Lengkapi Data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await apiAdminMasterBusinessFieldCreate({ data: data });
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Data berhasil di tambah",
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal tambah data",
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const buttonSubmit = (
|
const buttonSubmit = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => router.back()}
|
onPress={() => handlerSubmit()}
|
||||||
|
isLoading={isLoading}
|
||||||
>
|
>
|
||||||
Tambah
|
Tambah
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
@@ -28,6 +67,8 @@ export default function AdminAppInformation_BusinessFieldCreate() {
|
|||||||
label="Nama Bidang Bisnis"
|
label="Nama Bidang Bisnis"
|
||||||
placeholder="Masukan Nama Bidang Bisnis"
|
placeholder="Masukan Nama Bidang Bisnis"
|
||||||
required
|
required
|
||||||
|
value={data.name}
|
||||||
|
onChangeText={(value) => setData({ ...data, name: value })}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { ScrollableCustom, StackCustom, ViewWrapper } from "@/components";
|
||||||
ScrollableCustom,
|
|
||||||
StackCustom,
|
|
||||||
ViewWrapper
|
|
||||||
} from "@/components";
|
|
||||||
import AdminActionIconPlus from "@/components/_ShareComponent/Admin/ActionIconPlus";
|
import AdminActionIconPlus from "@/components/_ShareComponent/Admin/ActionIconPlus";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import AdminAppInformation_BusinessFieldSection from "@/screens/Admin/App-Information/BusinessFieldSection";
|
import AdminAppInformation_BusinessFieldSection from "@/screens/Admin/App-Information/BusinessFieldSection";
|
||||||
@@ -10,6 +6,7 @@ import AdminAppInformation_Bank from "@/screens/Admin/App-Information/Informatio
|
|||||||
import AdminAppInformation_StickerSection from "@/screens/Admin/App-Information/StickerSection";
|
import AdminAppInformation_StickerSection from "@/screens/Admin/App-Information/StickerSection";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { Alert } from "react-native";
|
||||||
|
|
||||||
export default function AdminInformation() {
|
export default function AdminInformation() {
|
||||||
const [activeCategory, setActiveCategory] = useState<string | null>("bank");
|
const [activeCategory, setActiveCategory] = useState<string | null>("bank");
|
||||||
@@ -57,7 +54,8 @@ export default function AdminInformation() {
|
|||||||
} else if (activeCategory === "business") {
|
} else if (activeCategory === "business") {
|
||||||
router.push("/admin/app-information/business-field/create");
|
router.push("/admin/app-information/business-field/create");
|
||||||
} else if (activeCategory === "sticker") {
|
} else if (activeCategory === "sticker") {
|
||||||
router.push("/admin/app-information/sticker/create");
|
Alert.alert("Coming Soon", "Next Update");
|
||||||
|
// router.push("/admin/app-information/sticker/create");
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,18 +1,90 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
StackCustom,
|
CenterCustom,
|
||||||
TextInputCustom,
|
Grid,
|
||||||
ViewWrapper,
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import { router } from "expo-router";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import {
|
||||||
|
apiAdminMasterBankById,
|
||||||
|
apiAdminMasterBankUpdate,
|
||||||
|
} from "@/service/api-admin/api-master-admin";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { Switch } from "react-native-paper";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminAppInformation_BankDetail() {
|
export default function AdminAppInformation_BankDetail() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadList();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadList = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminMasterBankById({ id: id as string });
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlerUpdate = async () => {
|
||||||
|
if (!data.namaBank || !data.namaAkun || !data.norek) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Lengkapi Data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const response = await apiAdminMasterBankUpdate({
|
||||||
|
id: id as string,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal update data",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Success",
|
||||||
|
text2: "Data berhasil di update",
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const buttonSubmit = (
|
const buttonSubmit = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => router.back()}
|
disabled={!data?.namaBank || !data?.namaAkun || !data?.norek}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => handlerUpdate()}
|
||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
@@ -25,22 +97,46 @@ export default function AdminAppInformation_BankDetail() {
|
|||||||
<AdminBackButtonAntTitle title="Update Bank" />
|
<AdminBackButtonAntTitle title="Update Bank" />
|
||||||
|
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextInputCustom
|
<Grid>
|
||||||
label="Nama Bank"
|
<Grid.Col span={6}>
|
||||||
placeholder="Masukan Nama Bank"
|
<TextInputCustom
|
||||||
required
|
label="Nama Bank"
|
||||||
/>
|
placeholder="Masukan Nama Bank"
|
||||||
|
required
|
||||||
|
value={data?.namaBank}
|
||||||
|
onChangeText={(value) =>
|
||||||
|
setData({ ...data, namaBank: value })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6} style={{ alignItems: "center" }}>
|
||||||
|
<TextCustom>Status Aktivasi</TextCustom>
|
||||||
|
<CenterCustom>
|
||||||
|
<Switch
|
||||||
|
onValueChange={(value) =>
|
||||||
|
setData({ ...data, isActive: value })
|
||||||
|
}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
value={data?.isActive}
|
||||||
|
/>
|
||||||
|
</CenterCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
label="Nama Rekening"
|
label="Nama Rekening"
|
||||||
placeholder="Masukan Nama Rekening"
|
placeholder="Masukan Nama Rekening"
|
||||||
required
|
required
|
||||||
|
value={data?.namaAkun}
|
||||||
|
onChangeText={(value) => setData({ ...data, namaAkun: value })}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
label="Nomor Rekening"
|
label="Nomor Rekening"
|
||||||
placeholder="Masukan Nomor Rekening"
|
placeholder="Masukan Nomor Rekening"
|
||||||
required
|
required
|
||||||
|
value={data?.norek}
|
||||||
|
onChangeText={(value) => setData({ ...data, norek: value })}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
|
|||||||
@@ -1,19 +1,51 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import { apiAdminMasterBankCreate } from "@/service/api-admin/api-master-admin";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminAppInformation_BankCreate() {
|
export default function AdminAppInformation_BankCreate() {
|
||||||
|
const [data, setData] = useState<any>({
|
||||||
|
namaBank: "",
|
||||||
|
namaAkun: "",
|
||||||
|
norek: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
const handlerSubmit = async () => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const response = await apiAdminMasterBankCreate({ data: data });
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Data berhasil di tambah",
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal tambah data",
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const buttonSubmit = (
|
const buttonSubmit = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom isLoading={isLoading} onPress={handlerSubmit}>
|
||||||
onPress={() => router.back()}
|
|
||||||
>
|
|
||||||
Tambah
|
Tambah
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</BoxButtonOnFooter>
|
</BoxButtonOnFooter>
|
||||||
@@ -29,18 +61,25 @@ export default function AdminAppInformation_BankCreate() {
|
|||||||
label="Nama Bank"
|
label="Nama Bank"
|
||||||
placeholder="Masukan Nama Bank"
|
placeholder="Masukan Nama Bank"
|
||||||
required
|
required
|
||||||
|
value={data.namaBank}
|
||||||
|
onChangeText={(value) => setData({ ...data, namaBank: value })}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
label="Nama Rekening"
|
label="Nama Rekening"
|
||||||
placeholder="Masukan Nama Rekening"
|
placeholder="Masukan Nama Rekening"
|
||||||
required
|
required
|
||||||
|
value={data.namaAkun}
|
||||||
|
onChangeText={(value) => setData({ ...data, namaAkun: value })}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
|
keyboardType="numeric"
|
||||||
label="Nomor Rekening"
|
label="Nomor Rekening"
|
||||||
placeholder="Masukan Nomor Rekening"
|
placeholder="Masukan Nomor Rekening"
|
||||||
required
|
required
|
||||||
|
value={data.norek}
|
||||||
|
onChangeText={(value) => setData({ ...data, norek: value })}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
@@ -8,18 +9,45 @@ import {
|
|||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { apiAdminCollaborationGetById } from "@/service/api-admin/api-admin-collaboration";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminCollaborationPublish() {
|
export default function AdminCollaborationPublish() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
console.log("params:", id, status);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const bottomFooter = (
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadData();
|
||||||
|
}, [status])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminCollaborationGetById({
|
||||||
|
id: id as string,
|
||||||
|
category: status as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const bottomFooter = status === "publish" && (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
backgroundColor={MainColor.red}
|
backgroundColor={MainColor.red}
|
||||||
textColor="white"
|
textColor="white"
|
||||||
onPress={() => {}}
|
onPress={() => {
|
||||||
|
router.push(`/admin/collaboration/${id}/reject-input`);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
Reject
|
Reject
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
@@ -29,12 +57,12 @@ export default function AdminCollaborationPublish() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
headerComponent={<AdminBackButtonAntTitle title={`Detail ${status}`} />}
|
headerComponent={<AdminBackButtonAntTitle title={`Detail`} />}
|
||||||
footerComponent={bottomFooter}
|
footerComponent={bottomFooter}
|
||||||
>
|
>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
{listData.map((item, i) => (
|
{listData(data)?.map((item, i) => (
|
||||||
<Grid key={i}>
|
<Grid key={i}>
|
||||||
<Grid.Col
|
<Grid.Col
|
||||||
span={4}
|
span={4}
|
||||||
@@ -49,41 +77,49 @@ export default function AdminCollaborationPublish() {
|
|||||||
))}
|
))}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
|
{data?.report && (
|
||||||
|
<BaseBox>
|
||||||
|
<GridTwoView
|
||||||
|
spanLeft={4}
|
||||||
|
spanRight={8}
|
||||||
|
leftIcon={<TextCustom bold>Catatan report</TextCustom>}
|
||||||
|
rightIcon={<TextCustom>{data?.report}</TextCustom>}
|
||||||
|
/>
|
||||||
|
</BaseBox>
|
||||||
|
)}
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
const listData = (data: any) => [
|
||||||
{
|
{
|
||||||
label: "Username",
|
label: "Username",
|
||||||
value: "Bagas Banuna",
|
value: (data && data?.Author?.username) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Judul Proyek",
|
label: "Judul Proyek",
|
||||||
value:
|
value: (data && data?.title) || "-",
|
||||||
"Judul Proyek: Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Industri",
|
label: "Industri",
|
||||||
value: "Kesehatan",
|
value: (data && data?.ProjectCollaborationMaster_Industri?.name) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Jumlah Partisipan ",
|
label: "Jumlah Partisipan ",
|
||||||
value: "0",
|
value: (data && data?.ProjectCollaboration_Partisipasi.length) || "0",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Lokasi",
|
label: "Lokasi",
|
||||||
value: "Kuta Selatan, Bali",
|
value: (data && data?.lokasi) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Tujuan Proyek",
|
label: "Tujuan Proyek",
|
||||||
value:
|
value: (data && data?.purpose) || "-",
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Keuntungan",
|
label: "Keuntungan",
|
||||||
value:
|
value: (data && data?.benefit) || "-",
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
@@ -6,23 +7,45 @@ import {
|
|||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { apiAdminCollaborationGetById } from "@/service/api-admin/api-admin-collaboration";
|
||||||
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminCollaborationGroup() {
|
export default function AdminCollaborationGroup() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
console.log("params:", id);
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminCollaborationGetById({
|
||||||
|
id: id as string,
|
||||||
|
category: "group",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
headerComponent={
|
headerComponent={<AdminBackButtonAntTitle title={`Detail Group`} />}
|
||||||
<AdminBackButtonAntTitle title={`Detail Group ${id}`} />
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
{listData.map((item, i) => (
|
{listData(data).map((item: any, index: number) => (
|
||||||
<Grid key={i}>
|
<Grid key={index}>
|
||||||
<Grid.Col
|
<Grid.Col
|
||||||
span={4}
|
span={4}
|
||||||
style={{ justifyContent: "center", paddingRight: 10 }}
|
style={{ justifyContent: "center", paddingRight: 10 }}
|
||||||
@@ -40,21 +63,36 @@ export default function AdminCollaborationGroup() {
|
|||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom align="center">Anggota</TextCustom>
|
<TextCustom align="center">Anggota</TextCustom>
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, i) => (
|
{data?.ProjectCollaboration_AnggotaRoomChat?.map(
|
||||||
<Grid key={i}>
|
(item: any, index: number) => (
|
||||||
<Grid.Col
|
<StackCustom key={index} gap={0}>
|
||||||
span={4}
|
<Grid>
|
||||||
style={{ justifyContent: "center", paddingRight: 10 }}
|
<Grid.Col
|
||||||
>
|
span={4}
|
||||||
<TextCustom bold>Username</TextCustom>
|
style={{ justifyContent: "center", paddingRight: 10 }}
|
||||||
</Grid.Col>
|
>
|
||||||
<Grid.Col span={8} style={{ justifyContent: "center" }}>
|
<TextCustom bold>Nama</TextCustom>
|
||||||
<TextCustom>
|
</Grid.Col>
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
<Grid.Col span={8} style={{ justifyContent: "center" }}>
|
||||||
</TextCustom>
|
<TextCustom>
|
||||||
</Grid.Col>
|
{item?.User?.Profile?.name || "-"}
|
||||||
</Grid>
|
</TextCustom>
|
||||||
))}
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col
|
||||||
|
span={4}
|
||||||
|
style={{ justifyContent: "center", paddingRight: 10 }}
|
||||||
|
>
|
||||||
|
<TextCustom bold>Username</TextCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8} style={{ justifyContent: "center" }}>
|
||||||
|
<TextCustom>{item?.User?.username || "-"}</TextCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</StackCustom>
|
||||||
|
)
|
||||||
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
@@ -63,35 +101,35 @@ export default function AdminCollaborationGroup() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
const listData = (data: any) => [
|
||||||
{
|
{
|
||||||
label: "Admin Group",
|
label: "Admin Group",
|
||||||
value: "Bagas Banuna",
|
value: data?.ProjectCollaboration?.Author?.username || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Nama Group",
|
label: "Nama Group",
|
||||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
value: data?.name || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Industri",
|
label: "Industri",
|
||||||
value: "Kesehatan",
|
value:
|
||||||
|
data?.ProjectCollaboration?.ProjectCollaborationMaster_Industri?.name ||
|
||||||
|
"-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Jumlah Partisipan ",
|
label: "Jumlah Partisipan ",
|
||||||
value: "0",
|
value: data?.ProjectCollaboration_AnggotaRoomChat?.length || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Lokasi",
|
label: "Lokasi",
|
||||||
value: "Kuta Selatan, Bali",
|
value: data?.ProjectCollaboration?.lokasi || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Tujuan Proyek",
|
label: "Tujuan Proyek",
|
||||||
value:
|
value: data?.ProjectCollaboration?.purpose || "-",
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Keuntungan",
|
label: "Keuntungan",
|
||||||
value:
|
value: data?.ProjectCollaboration?.benefit || "-",
|
||||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
83
app/(application)/admin/collaboration/[id]/reject-input.tsx
Normal file
83
app/(application)/admin/collaboration/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
import {
|
||||||
|
AlertDefaultSystem,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
TextAreaCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
|
import { apiAdminCollaborationReject } from "@/service/api-admin/api-admin-collaboration";
|
||||||
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
export default function AdminCollaborationRejectInput() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [value, setValue] = useState("");
|
||||||
|
|
||||||
|
const handlerReject = async () => {
|
||||||
|
console.log("value:", value);
|
||||||
|
// router.replace(`/admin/job/reject/status`);
|
||||||
|
try {
|
||||||
|
const response = await apiAdminCollaborationReject({
|
||||||
|
id: id as string,
|
||||||
|
data: value,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Report gagal",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Report berhasil",
|
||||||
|
});
|
||||||
|
|
||||||
|
router.back();
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = (
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<AdminButtonReject
|
||||||
|
title="Reject"
|
||||||
|
onReject={() =>
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Reject",
|
||||||
|
message: "Apakah anda yakin ingin menolak data ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => {
|
||||||
|
handlerReject();
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper
|
||||||
|
footerComponent={buttonSubmit}
|
||||||
|
headerComponent={
|
||||||
|
<AdminBackButtonAntTitle title="Penolakan Collaboration" />
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<TextAreaCustom
|
||||||
|
value={value}
|
||||||
|
onChangeText={setValue}
|
||||||
|
placeholder="Masukan alasan"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,67 +1,101 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
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";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminCollaborationGroup() {
|
export default function AdminCollaborationGroup() {
|
||||||
|
const [list, setList] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminCollaboration({
|
||||||
|
category: "group",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom>
|
||||||
<AdminComp_BoxTitle title="Group" />
|
<AdminComp_BoxTitle title="Group" />
|
||||||
<BaseBox>
|
<>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Admin Group"
|
title2="Jumlah peserta"
|
||||||
title3="Nama Group"
|
title3="Nama group"
|
||||||
/>
|
/>
|
||||||
<Spacing height={10} />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(list) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Belum ada data
|
||||||
icon={
|
</TextCustom>
|
||||||
<Octicons
|
) : (
|
||||||
name="eye"
|
list?.map((item: any, index: number) => (
|
||||||
size={ICON_SIZE_BUTTON}
|
<View key={index}>
|
||||||
color="black"
|
<AdminTableValue
|
||||||
|
value1={
|
||||||
|
<ActionIcon
|
||||||
|
icon={
|
||||||
|
<Octicons
|
||||||
|
name="eye"
|
||||||
|
size={ICON_SIZE_BUTTON}
|
||||||
|
color="black"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
onPress={() => {
|
||||||
|
router.push(`/admin/collaboration/${item.id}/group`);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onPress={() => {
|
value2={
|
||||||
router.push(`/admin/collaboration/${index}/group`);
|
<TextCustom truncate={1}>
|
||||||
}}
|
{item?.ProjectCollaboration_AnggotaRoomChat?.length ||
|
||||||
|
"-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2}>{item?.name || "-"}</TextCustom>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
}
|
</View>
|
||||||
value2={
|
))
|
||||||
<TextCustom truncate={1}>Username username </TextCustom>
|
)}
|
||||||
}
|
</>
|
||||||
value3={
|
|
||||||
<TextCustom truncate={2}>
|
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae
|
|
||||||
mollitia.
|
|
||||||
</TextCustom>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</BaseBox>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2,14 +2,41 @@ import { StackCustom, ViewWrapper } from "@/components";
|
|||||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration";
|
||||||
import { Entypo, FontAwesome } from "@expo/vector-icons";
|
import { Entypo, FontAwesome } from "@expo/vector-icons";
|
||||||
|
import { useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminCollaboration() {
|
export default function AdminCollaboration() {
|
||||||
|
const [list, setList] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminCollaboration({
|
||||||
|
category: "dashboard",
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[RESPONSE]", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
{listData.map((item, i) => (
|
{listData(list as any).map((item, i) => (
|
||||||
<AdminComp_BoxDashboard key={i} item={item} />
|
<AdminComp_BoxDashboard key={i} item={item} />
|
||||||
))}
|
))}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
@@ -18,20 +45,23 @@ export default function AdminCollaboration() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
const listData = (list: any) => {
|
||||||
{
|
console.log("[LIST masuk]", JSON.stringify(list, null, 2));
|
||||||
label: "Publish",
|
return [
|
||||||
value: 4,
|
{
|
||||||
icon: <Entypo name="publish" size={25} color={MainColor.green} />,
|
label: "Publish",
|
||||||
},
|
value: (list && list?.publish) || "0",
|
||||||
{
|
icon: <Entypo name="publish" size={25} color={MainColor.green} />,
|
||||||
label: "Group",
|
},
|
||||||
value: 7,
|
{
|
||||||
icon: <FontAwesome name="group" size={25} color={MainColor.yellow} />,
|
label: "Group",
|
||||||
},
|
value: (list && list?.group) || "0",
|
||||||
{
|
icon: <FontAwesome name="group" size={25} color={MainColor.yellow} />,
|
||||||
label: "Reject",
|
},
|
||||||
value: 7,
|
{
|
||||||
icon: <FontAwesome name="warning" size={25} color={MainColor.red} />,
|
label: "Reject",
|
||||||
},
|
value: (list && list?.reject) || "0",
|
||||||
];
|
icon: <FontAwesome name="warning" size={25} color={MainColor.red} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
@@ -11,60 +10,95 @@ import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
|||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
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";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminCollaborationPublish() {
|
export default function AdminCollaborationPublish() {
|
||||||
|
const [list, setList] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminCollaboration({
|
||||||
|
category: "publish",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom>
|
||||||
<AdminComp_BoxTitle title="Publish" />
|
<AdminComp_BoxTitle title="Publish" />
|
||||||
<BaseBox>
|
|
||||||
<AdminTitleTable
|
|
||||||
title1="Aksi"
|
|
||||||
title2="Username"
|
|
||||||
title3="Judul Proyek"
|
|
||||||
/>
|
|
||||||
<Spacing height={10} />
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
<AdminTitleTable
|
||||||
<AdminTableValue
|
title1="Aksi"
|
||||||
key={index}
|
title2="Username"
|
||||||
value1={
|
title3="Judul Proyek"
|
||||||
<ActionIcon
|
/>
|
||||||
icon={
|
{/* <Spacing height={10} /> */}
|
||||||
<Octicons
|
<Divider />
|
||||||
name="eye"
|
|
||||||
size={ICON_SIZE_BUTTON}
|
{loadList ? (
|
||||||
color="black"
|
<LoaderCustom />
|
||||||
/>
|
) : _.isEmpty(list) ? (
|
||||||
}
|
<TextCustom align="center" color="gray">
|
||||||
onPress={() => {
|
Belum ada data
|
||||||
router.push(`/admin/collaboration/${index}/publish`);
|
</TextCustom>
|
||||||
}}
|
) : (
|
||||||
/>
|
list?.map((item: any, index: number) => (
|
||||||
}
|
<View key={index}>
|
||||||
value2={
|
<AdminTableValue
|
||||||
<TextCustom truncate={1}>Username username </TextCustom>
|
value1={
|
||||||
}
|
<ActionIcon
|
||||||
value3={
|
icon={
|
||||||
<TextCustom truncate={2}>
|
<Octicons
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
name="eye"
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
size={ICON_SIZE_BUTTON}
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
color="black"
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae
|
/>
|
||||||
mollitia.
|
}
|
||||||
</TextCustom>
|
onPress={() => {
|
||||||
}
|
router.push(`/admin/collaboration/${item?.id}/publish`);
|
||||||
/>
|
}}
|
||||||
))}
|
/>
|
||||||
</BaseBox>
|
}
|
||||||
|
value2={
|
||||||
|
<TextCustom align="center" truncate={1}>
|
||||||
|
{item?.Author?.username || "-"}{" "}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom align="center" truncate={2}>
|
||||||
|
{item?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,67 +1,99 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminCollaboration } from "@/service/api-admin/api-admin-collaboration";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
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";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminCollaborationReject() {
|
export default function AdminCollaborationReject() {
|
||||||
|
const [list, setList] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminCollaboration({
|
||||||
|
category: "reject",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Collaboration" />}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom>
|
||||||
<AdminComp_BoxTitle title="Reject" />
|
<AdminComp_BoxTitle title="Reject" />
|
||||||
<BaseBox>
|
<AdminTitleTable
|
||||||
<AdminTitleTable
|
title1="Aksi"
|
||||||
title1="Aksi"
|
title2="Username"
|
||||||
title2="Username"
|
title3="Judul Proyek"
|
||||||
title3="Judul Proyek"
|
/>
|
||||||
/>
|
<Divider />
|
||||||
<Spacing height={10} />
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(list) ? (
|
||||||
value1={
|
<TextCustom>Belum ada data</TextCustom>
|
||||||
<ActionIcon
|
) : (
|
||||||
icon={
|
list?.map((item: any) => (
|
||||||
<Octicons
|
<View key={item.id}>
|
||||||
name="eye"
|
<AdminTableValue
|
||||||
size={ICON_SIZE_BUTTON}
|
key={item?.id}
|
||||||
color="black"
|
value1={
|
||||||
/>
|
<ActionIcon
|
||||||
}
|
icon={
|
||||||
onPress={() => {
|
<Octicons
|
||||||
router.push(`/admin/collaboration/${index}/reject`);
|
name="eye"
|
||||||
}}
|
size={ICON_SIZE_BUTTON}
|
||||||
/>
|
color="black"
|
||||||
}
|
/>
|
||||||
value2={
|
}
|
||||||
<TextCustom truncate={1}>Username username </TextCustom>
|
onPress={() => {
|
||||||
}
|
router.push(`/admin/collaboration/${item?.id}/reject`);
|
||||||
value3={
|
}}
|
||||||
<TextCustom truncate={2}>
|
/>
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
}
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
value2={
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
<TextCustom align="center" truncate={1}>
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae
|
{item?.Author?.username || "-"}
|
||||||
mollitia.
|
</TextCustom>
|
||||||
</TextCustom>
|
}
|
||||||
}
|
value3={
|
||||||
/>
|
<TextCustom align="center" truncate={2}>
|
||||||
))}
|
{item?.title || "-"}
|
||||||
</BaseBox>
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
))
|
||||||
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -11,17 +12,52 @@ import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
|||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminJob } from "@/service/api-admin/api-admin-job";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminJobStatus() {
|
export default function AdminJobStatus() {
|
||||||
const { status } = useLocalSearchParams();
|
const { status } = useLocalSearchParams();
|
||||||
|
console.log("[STATUS]", status);
|
||||||
|
|
||||||
|
const [list, setList] = useState<any | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [status, search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminJob({
|
||||||
|
category: status as "publish" | "review" | "reject",
|
||||||
|
search,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[RESPONSE >>]", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
|
||||||
placeholder="Cari"
|
placeholder="Cari"
|
||||||
|
onChangeText={setSearch}
|
||||||
|
value={search}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
@@ -32,44 +68,53 @@ export default function AdminJobStatus() {
|
|||||||
rightComponent={rightComponent}
|
rightComponent={rightComponent}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Username"
|
title2="Username"
|
||||||
title3="Judul Pekerjaan"
|
title3="Judul Pekerjaan"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
{/* <Spacing /> */}
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(list) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Tidak ada data
|
||||||
icon={
|
</TextCustom>
|
||||||
<Octicons
|
) : (
|
||||||
name="eye"
|
list?.map((item: any, index: number) => (
|
||||||
size={ICON_SIZE_BUTTON}
|
<AdminTableValue
|
||||||
color="black"
|
key={index}
|
||||||
/>
|
value1={
|
||||||
}
|
<ActionIcon
|
||||||
onPress={() => {
|
icon={
|
||||||
router.push(`/admin/job/${index}/${status}`);
|
<Octicons
|
||||||
}}
|
name="eye"
|
||||||
/>
|
size={ICON_SIZE_BUTTON}
|
||||||
}
|
color="black"
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
/>
|
||||||
value3={
|
}
|
||||||
<TextCustom truncate={2}>
|
onPress={() => {
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
router.push(`/admin/job/${item.id}/${status}`);
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
}}
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
/>
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae mollitia.
|
}
|
||||||
</TextCustom>
|
value2={
|
||||||
}
|
<TextCustom align="center" truncate={1}>
|
||||||
/>
|
{item?.Author?.username || "-"}
|
||||||
))}
|
</TextCustom>
|
||||||
</BaseBox>
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2} align="center">
|
||||||
|
{item?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||||
import {
|
import {
|
||||||
IconPublish,
|
IconPublish,
|
||||||
@@ -7,15 +8,45 @@ import {
|
|||||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { apiAdminJob } from "@/service/api-admin/api-admin-job";
|
||||||
|
import { useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminJob() {
|
export default function AdminJob() {
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminJob({
|
||||||
|
category: "dashboard",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
<AdminTitlePage title="Job Vacancy" />
|
<AdminTitlePage title="Job Vacancy" />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
{listData.map((item, i) => (
|
{listData(data).map((item: any, i: number) => (
|
||||||
<AdminComp_BoxDashboard key={i} item={item} />
|
<AdminComp_BoxDashboard key={i} item={item} />
|
||||||
))}
|
))}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
@@ -24,20 +55,20 @@ export default function AdminJob() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
const listData = (data: any) => [
|
||||||
{
|
{
|
||||||
label: "Publish",
|
label: "Publish",
|
||||||
value: 4,
|
value: (data && data?.publish) || 0,
|
||||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Review",
|
label: "Review",
|
||||||
value: 7,
|
value: (data && data?.review) || 0,
|
||||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Reject",
|
label: "Reject",
|
||||||
value: 5,
|
value: (data && data?.reject) || 0,
|
||||||
icon: <IconReject size={25} color={MainColor.red} />,
|
icon: <IconReject size={25} color={MainColor.red} />,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,11 +1,224 @@
|
|||||||
import { MapCustom, ViewWrapper } from "@/components";
|
import { ButtonCustom, DrawerCustom, DummyLandscapeImage, Grid, Spacing, StackCustom, TextCustom, ViewWrapper } from "@/components";
|
||||||
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
|
import API_IMAGE from "@/constants/api-storage";
|
||||||
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
|
import { apiMapsGetAll } from "@/service/api-client/api-maps";
|
||||||
|
import { openInDeviceMaps } from "@/utils/openInDeviceMaps";
|
||||||
|
import { FontAwesome, Ionicons } from "@expo/vector-icons";
|
||||||
|
import { Image } from "expo-image";
|
||||||
|
import { router, useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import MapView, { Marker } from "react-native-maps";
|
||||||
|
|
||||||
|
const defaultRegion = {
|
||||||
|
latitude: -8.737109,
|
||||||
|
longitude: 115.1756897,
|
||||||
|
latitudeDelta: 0.1,
|
||||||
|
longitudeDelta: 0.1,
|
||||||
|
height: 300,
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface LocationItem {
|
||||||
|
id: string | number;
|
||||||
|
latitude: number;
|
||||||
|
longitude: number;
|
||||||
|
name: string;
|
||||||
|
imageId?: string;
|
||||||
|
}
|
||||||
export default function AdminMaps() {
|
export default function AdminMaps() {
|
||||||
|
const [list, setList] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
const [selected, setSelected] = useState({
|
||||||
|
id: "",
|
||||||
|
bidangBisnis: "",
|
||||||
|
nomorTelepon: "",
|
||||||
|
alamatBisnis: "",
|
||||||
|
namePin: "",
|
||||||
|
imageId: "",
|
||||||
|
portofolioId: "",
|
||||||
|
latitude: 0,
|
||||||
|
longitude: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiMapsGetAll();
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<ViewWrapper style={{ paddingInline: 0, paddingBlock: 0 }}>
|
||||||
<MapCustom height={"100%"} />
|
{/* <MapCustom height={"100%"} /> */}
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
{loadList ? (
|
||||||
|
<MapView
|
||||||
|
initialRegion={defaultRegion}
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<MapView
|
||||||
|
initialRegion={defaultRegion}
|
||||||
|
style={{
|
||||||
|
width: "100%",
|
||||||
|
height: "100%",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{list?.map((item: any, index: number) => {
|
||||||
|
return (
|
||||||
|
<Marker
|
||||||
|
key={item?.id}
|
||||||
|
coordinate={{
|
||||||
|
latitude: item?.latitude,
|
||||||
|
longitude: item?.longitude,
|
||||||
|
}}
|
||||||
|
title={item?.namePin}
|
||||||
|
onPress={() => {
|
||||||
|
setOpenDrawer(true);
|
||||||
|
setSelected({
|
||||||
|
id: item?.id,
|
||||||
|
bidangBisnis:
|
||||||
|
item?.Portofolio?.MasterBidangBisnis?.name,
|
||||||
|
nomorTelepon: item?.Portofolio?.tlpn,
|
||||||
|
alamatBisnis: item?.Portofolio?.alamatKantor,
|
||||||
|
namePin: item?.namePin,
|
||||||
|
imageId: item?.imageId,
|
||||||
|
portofolioId: item?.Portofolio?.id,
|
||||||
|
latitude: item?.latitude,
|
||||||
|
longitude: item?.longitude,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
// Gunakan gambar kustom jika tersedia
|
||||||
|
>
|
||||||
|
<View>
|
||||||
|
<Image
|
||||||
|
source={{
|
||||||
|
uri: API_IMAGE.GET({
|
||||||
|
fileId: item?.Portofolio?.logoId,
|
||||||
|
}),
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
width: 30,
|
||||||
|
height: 30,
|
||||||
|
borderRadius: 100,
|
||||||
|
borderWidth: 1,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</Marker>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</MapView>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawer}
|
||||||
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
height={"auto"}
|
||||||
|
>
|
||||||
|
<DummyLandscapeImage height={200} imageId={selected.imageId} />
|
||||||
|
<Spacing />
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<GridTwoView
|
||||||
|
spanLeft={2}
|
||||||
|
spanRight={10}
|
||||||
|
leftIcon={
|
||||||
|
<FontAwesome
|
||||||
|
name="building-o"
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
color="white"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
rightIcon={<TextCustom>{selected.namePin}</TextCustom>}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<GridTwoView
|
||||||
|
spanLeft={2}
|
||||||
|
spanRight={10}
|
||||||
|
leftIcon={
|
||||||
|
<Ionicons
|
||||||
|
name="list-outline"
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
color="white"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
rightIcon={<TextCustom>{selected.bidangBisnis}</TextCustom>}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<GridTwoView
|
||||||
|
spanLeft={2}
|
||||||
|
spanRight={10}
|
||||||
|
leftIcon={
|
||||||
|
<Ionicons
|
||||||
|
name="call-outline"
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
color="white"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
rightIcon={<TextCustom>+{selected.nomorTelepon}</TextCustom>}
|
||||||
|
/>
|
||||||
|
<GridTwoView
|
||||||
|
spanLeft={2}
|
||||||
|
spanRight={10}
|
||||||
|
leftIcon={
|
||||||
|
<Ionicons
|
||||||
|
name="location-outline"
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
color="white"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
rightIcon={<TextCustom>{selected.alamatBisnis}</TextCustom>}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
setOpenDrawer(false);
|
||||||
|
router.push(`/portofolio/${selected.portofolioId}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Detail
|
||||||
|
</ButtonCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6} style={{ paddingLeft: 10 }}>
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
openInDeviceMaps({
|
||||||
|
latitude: selected.latitude,
|
||||||
|
longitude: selected.longitude,
|
||||||
|
title: selected.namePin,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Buka Maps
|
||||||
|
</ButtonCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</StackCustom>
|
||||||
|
</DrawerCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,14 +13,32 @@ export default function AdminTitleTable({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center", justifyContent: "center" }}>
|
<Grid.Col
|
||||||
<TextCustom bold align="center">{title1}</TextCustom>
|
span={3}
|
||||||
|
style={{
|
||||||
|
alignItems: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
paddingLeft: 5,
|
||||||
|
paddingRight: 5,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TextCustom truncate bold align="center">
|
||||||
|
{title1}
|
||||||
|
</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center", justifyContent: "center" }}>
|
<Grid.Col
|
||||||
<TextCustom bold align="center">{title2}</TextCustom>
|
span={3}
|
||||||
|
style={{ alignItems: "center", justifyContent: "center", paddingLeft: 5, paddingRight: 5 }}
|
||||||
|
>
|
||||||
|
<TextCustom truncate bold align="center">
|
||||||
|
{title2}
|
||||||
|
</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6} style={{ alignItems: "center", justifyContent: "center" }}>
|
<Grid.Col
|
||||||
<TextCustom bold align="center">{title3}</TextCustom>
|
span={6}
|
||||||
|
style={{ alignItems: "center", justifyContent: "center", paddingLeft: 5, paddingRight: 5 }}
|
||||||
|
>
|
||||||
|
<TextCustom truncate bold align="center">{title3}</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ export default function AdminTableValue({
|
|||||||
value1,
|
value1,
|
||||||
value2,
|
value2,
|
||||||
value3,
|
value3,
|
||||||
|
bottomLine = false,
|
||||||
}: {
|
}: {
|
||||||
value1: React.ReactNode;
|
value1: React.ReactNode;
|
||||||
value2: React.ReactNode;
|
value2: React.ReactNode;
|
||||||
value3: React.ReactNode;
|
value3: React.ReactNode;
|
||||||
|
bottomLine?: boolean;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -21,8 +23,8 @@ export default function AdminTableValue({
|
|||||||
style={{
|
style={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
paddingLeft: 5,
|
paddingLeft: 10,
|
||||||
paddingRight: 5,
|
paddingRight: 10,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{value1}
|
{value1}
|
||||||
@@ -32,8 +34,8 @@ export default function AdminTableValue({
|
|||||||
style={{
|
style={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
paddingLeft: 5,
|
paddingLeft: 10,
|
||||||
paddingRight: 5,
|
paddingRight: 10,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{value2}
|
{value2}
|
||||||
@@ -42,14 +44,15 @@ export default function AdminTableValue({
|
|||||||
span={6}
|
span={6}
|
||||||
style={{
|
style={{
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
paddingLeft: 5,
|
alignItems: "center",
|
||||||
paddingRight: 5,
|
paddingLeft: 10,
|
||||||
|
paddingRight: 10,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{value3}
|
{value3}
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Divider />
|
{bottomLine && <Divider />}
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { MainColor } from "@/constants/color-palet";
|
|||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import TextInputCustom from "../TextInput/TextInputCustom";
|
import TextInputCustom from "../TextInput/TextInputCustom";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
import { StyleProp, ViewStyle, TextStyle, StyleSheet } from "react-native";
|
||||||
|
|
||||||
interface SearchInputProps {
|
interface SearchInputProps {
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
@@ -12,6 +12,8 @@ interface SearchInputProps {
|
|||||||
containerStyle?: StyleProp<ViewStyle>;
|
containerStyle?: StyleProp<ViewStyle>;
|
||||||
style?: StyleProp<TextStyle>;
|
style?: StyleProp<TextStyle>;
|
||||||
onChangeText?: (value: string) => void;
|
onChangeText?: (value: string) => void;
|
||||||
|
value?: string;
|
||||||
|
disabled?: boolean;
|
||||||
}
|
}
|
||||||
export default function SearchInput({
|
export default function SearchInput({
|
||||||
placeholder,
|
placeholder,
|
||||||
@@ -21,6 +23,8 @@ export default function SearchInput({
|
|||||||
containerStyle,
|
containerStyle,
|
||||||
style,
|
style,
|
||||||
onChangeText,
|
onChangeText,
|
||||||
|
value,
|
||||||
|
disabled,
|
||||||
...props
|
...props
|
||||||
}: SearchInputProps) {
|
}: SearchInputProps) {
|
||||||
return (
|
return (
|
||||||
@@ -29,14 +33,21 @@ export default function SearchInput({
|
|||||||
<Ionicons
|
<Ionicons
|
||||||
name="search-outline"
|
name="search-outline"
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
color={MainColor.placeholder}
|
color={disabled ? MainColor.white_gray : MainColor.placeholder}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
value={value}
|
||||||
onChangeText={onChangeText}
|
onChangeText={onChangeText}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
borderRadius={50}
|
borderRadius={50}
|
||||||
containerStyle={[containerStyle, { marginBottom: 0 }]}
|
containerStyle={[disabled ? styleses.disabled : styleses.containerStyle]}
|
||||||
|
disabled={disabled}
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const styleses = StyleSheet.create({
|
||||||
|
containerStyle: { width: "100%", marginBottom: 0 },
|
||||||
|
disabled: { width: "100%", marginBottom: 0, color: MainColor.white_gray },
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,29 +1,57 @@
|
|||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
|
BadgeCustom,
|
||||||
|
CenterCustom,
|
||||||
Grid,
|
Grid,
|
||||||
|
LoaderCustom,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { AccentColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import dummyMasterBidangBisnis from "@/lib/dummy-data/master-bidang-bisnis";
|
import { apiAdminMasterBusinessField } from "@/service/api-admin/api-master-admin";
|
||||||
import { FontAwesome5 } from "@expo/vector-icons";
|
import { FontAwesome5 } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
import { router, useFocusEffect } from "expo-router";
|
||||||
import { useState } from "react";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { Divider, Switch } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminAppInformation_BusinessFieldSection() {
|
export default function AdminAppInformation_BusinessFieldSection() {
|
||||||
const [value, setValue] = useState(false);
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
const [selectedBusinessField, setSelectedBusinessField] = useState<any>(null);
|
const [loadData, setLoadData] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadData(true);
|
||||||
|
const response = await apiAdminMasterBusinessField();
|
||||||
|
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setListData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR LIST BUSINESS FIELD]", error);
|
||||||
|
setListData([]);
|
||||||
|
} finally {
|
||||||
|
setLoadData(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<>
|
<StackCustom>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
<Grid.Col span={2} style={{ alignItems: "center" }}>
|
||||||
<TextCustom bold>Aksi</TextCustom>
|
<TextCustom bold>Aksi</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
<Grid.Col span={4} style={{ alignItems: "center" }}>
|
||||||
<TextCustom bold>Status</TextCustom>
|
<TextCustom bold>Status</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
@@ -33,51 +61,54 @@ export default function AdminAppInformation_BusinessFieldSection() {
|
|||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
|
{loadData ? (
|
||||||
<StackCustom>
|
<LoaderCustom />
|
||||||
{dummyMasterBidangBisnis.map((e, i) => (
|
) : _.isEmpty(listData) ? (
|
||||||
<View key={i}>
|
<TextCustom align="center">Tidak ada data</TextCustom>
|
||||||
<Grid>
|
) : (
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
<StackCustom>
|
||||||
<ActionIcon
|
{listData?.map((item: any, index: number) => (
|
||||||
icon={
|
<View key={index}>
|
||||||
<FontAwesome5
|
<Grid>
|
||||||
name="edit"
|
<Grid.Col span={2} style={{ alignItems: "center" }}>
|
||||||
size={ICON_SIZE_BUTTON}
|
<ActionIcon
|
||||||
color="black"
|
icon={
|
||||||
/>
|
<FontAwesome5
|
||||||
}
|
name="edit"
|
||||||
onPress={() => {
|
size={ICON_SIZE_BUTTON}
|
||||||
router.push(`/admin/app-information/business-field/${i}`);
|
color="black"
|
||||||
}}
|
/>
|
||||||
/>
|
}
|
||||||
</Grid.Col>
|
onPress={() => {
|
||||||
<Grid.Col
|
router.push(
|
||||||
span={3}
|
`/admin/app-information/business-field/${item.id}`
|
||||||
style={{ alignItems: "center", justifyContent: "center" }}
|
);
|
||||||
>
|
}}
|
||||||
<Switch
|
/>
|
||||||
value={i === selectedBusinessField}
|
</Grid.Col>
|
||||||
onValueChange={() => {
|
<Grid.Col
|
||||||
setValue(!value);
|
span={4}
|
||||||
setSelectedBusinessField(i);
|
style={{ alignItems: "center", justifyContent: "center" }}
|
||||||
}}
|
>
|
||||||
theme={{
|
<CenterCustom>
|
||||||
colors: {
|
<BadgeCustom
|
||||||
primary: MainColor.yellow,
|
color={
|
||||||
},
|
item.active ? AccentColor.blue : AccentColor.blackgray
|
||||||
}}
|
}
|
||||||
/>
|
>
|
||||||
</Grid.Col>
|
{item.active ? "Aktif" : "Tidak Aktif"}
|
||||||
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
</BadgeCustom>
|
||||||
<TextCustom>{e.name}</TextCustom>
|
</CenterCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
||||||
<Divider />
|
<TextCustom>{item.name}</TextCustom>
|
||||||
</View>
|
</Grid.Col>
|
||||||
))}
|
</Grid>
|
||||||
</StackCustom>
|
</View>
|
||||||
</>
|
))}
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,77 +1,119 @@
|
|||||||
import { ActionIcon, Grid, StackCustom, TextCustom } from "@/components";
|
import {
|
||||||
import { MainColor } from "@/constants/color-palet";
|
ActionIcon,
|
||||||
|
BadgeCustom,
|
||||||
|
CenterCustom,
|
||||||
|
Grid,
|
||||||
|
LoaderCustom,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import { AccentColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { dummyMasterBank } from "@/lib/dummy-data/_master/bank";
|
import { apiAdminMasterBank } from "@/service/api-admin/api-master-admin";
|
||||||
import { FontAwesome5 } from "@expo/vector-icons";
|
import { FontAwesome5 } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
import { router, useFocusEffect } from "expo-router";
|
||||||
import { useState } from "react";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import { Divider, Switch } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminAppInformation_Bank() {
|
export default function AdminAppInformation_Bank() {
|
||||||
const [value, setValue] = useState(false);
|
const [listData, setListData] = useState<any | null>(null);
|
||||||
|
const [loadData, setLoadData] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
loadMasterBank();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const loadMasterBank = async () => {
|
||||||
|
try {
|
||||||
|
setLoadData(true);
|
||||||
|
const response = await apiAdminMasterBank();
|
||||||
|
|
||||||
|
setListData(response.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR LIST BANK]", error);
|
||||||
|
setListData([]);
|
||||||
|
} finally {
|
||||||
|
setLoadData(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<>
|
<StackCustom>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
<Grid.Col span={3}>
|
||||||
<TextCustom bold>Aksi</TextCustom>
|
<TextCustom bold align="center">
|
||||||
|
Aksi
|
||||||
|
</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
<Grid.Col span={3}>
|
||||||
<TextCustom bold>Status</TextCustom>
|
<TextCustom bold align="center">
|
||||||
|
Status
|
||||||
|
</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<TextCustom bold>Nama Bank</TextCustom>
|
<TextCustom bold align="center">
|
||||||
|
Nama Bank
|
||||||
|
</TextCustom>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
<StackCustom>
|
{loadData ? (
|
||||||
{dummyMasterBank.map((e, i) => (
|
<LoaderCustom />
|
||||||
<View key={i}>
|
) : _.isEmpty(listData) ? (
|
||||||
<Grid>
|
<TextCustom align="center">Tidak ada data</TextCustom>
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
) : (
|
||||||
<ActionIcon
|
<StackCustom>
|
||||||
icon={
|
{listData?.map((item: any, index: number) => (
|
||||||
<FontAwesome5
|
<View key={index}>
|
||||||
name="edit"
|
<Grid>
|
||||||
size={ICON_SIZE_BUTTON}
|
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
||||||
color="black"
|
<ActionIcon
|
||||||
/>
|
icon={
|
||||||
}
|
<FontAwesome5
|
||||||
onPress={() => {
|
name="edit"
|
||||||
router.push(
|
size={ICON_SIZE_BUTTON}
|
||||||
`/admin/app-information/information-bank/${i}`
|
color="black"
|
||||||
);
|
/>
|
||||||
}}
|
}
|
||||||
/>
|
onPress={() => {
|
||||||
</Grid.Col>
|
router.push(
|
||||||
<Grid.Col
|
`/admin/app-information/information-bank/${item.id}`
|
||||||
span={3}
|
);
|
||||||
style={{ alignItems: "center", justifyContent: "center" }}
|
}}
|
||||||
>
|
/>
|
||||||
<Switch
|
</Grid.Col>
|
||||||
value={value}
|
<Grid.Col
|
||||||
onValueChange={() => {
|
span={3}
|
||||||
setValue(!value);
|
style={{ alignItems: "center", justifyContent: "center" }}
|
||||||
}}
|
>
|
||||||
theme={{
|
<CenterCustom>
|
||||||
colors: {
|
<BadgeCustom
|
||||||
primary: MainColor.yellow,
|
color={
|
||||||
},
|
item.isActive
|
||||||
}}
|
? AccentColor.blue
|
||||||
/>
|
: AccentColor.blackgray
|
||||||
</Grid.Col>
|
}
|
||||||
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
>
|
||||||
<TextCustom>{e.code}</TextCustom>
|
{item.isActive ? "Aktif" : "Tidak Aktif"}
|
||||||
</Grid.Col>
|
</BadgeCustom>
|
||||||
</Grid>
|
</CenterCustom>
|
||||||
<Divider />
|
</Grid.Col>
|
||||||
</View>
|
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
||||||
))}
|
<TextCustom align="center">{item.namaBank}</TextCustom>
|
||||||
</StackCustom>
|
</Grid.Col>
|
||||||
</>
|
</Grid>
|
||||||
|
</View>
|
||||||
|
))}
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,69 +10,77 @@ import { Divider, Switch } from "react-native-paper";
|
|||||||
|
|
||||||
export default function AdminAppInformation_StickerSection() {
|
export default function AdminAppInformation_StickerSection() {
|
||||||
const [value, setValue] = useState(false);
|
const [value, setValue] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid>
|
<TextCustom bold align="center">
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
Cooming Soon, Next Update !!
|
||||||
<TextCustom bold>Aksi</TextCustom>
|
</TextCustom>
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={3} style={{ alignItems: "center" }}>
|
|
||||||
<TextCustom bold>Status</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<TextCustom bold align="center" >Stiker</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Divider />
|
|
||||||
|
|
||||||
<StackCustom>
|
|
||||||
{listSticker.map((e, i) => (
|
|
||||||
<View key={i}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col
|
|
||||||
span={3}
|
|
||||||
style={{ alignItems: "center", justifyContent: "center" }}
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
icon={
|
|
||||||
<FontAwesome5
|
|
||||||
name="edit"
|
|
||||||
size={ICON_SIZE_BUTTON}
|
|
||||||
color="black"
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
onPress={() => {
|
|
||||||
router.push(`/admin/app-information/sticker/${i}`);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col
|
|
||||||
span={3}
|
|
||||||
style={{ alignItems: "center", justifyContent: "center" }}
|
|
||||||
>
|
|
||||||
<Switch
|
|
||||||
value={value}
|
|
||||||
onValueChange={() => {
|
|
||||||
setValue(!value);
|
|
||||||
}}
|
|
||||||
theme={{
|
|
||||||
colors: {
|
|
||||||
primary: MainColor.yellow,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6} style={{ justifyContent: "center", alignItems: "center" }}>
|
|
||||||
<Image source={e.path} style={{ width: 100, height: 100 }} />
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<Divider />
|
|
||||||
</View>
|
|
||||||
))}
|
|
||||||
</StackCustom>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
// return (
|
||||||
|
// <>
|
||||||
|
// <Grid>
|
||||||
|
// <Grid.Col span={3} style={{ alignItems: "center" }}>
|
||||||
|
// <TextCustom bold>Aksi</TextCustom>
|
||||||
|
// </Grid.Col>
|
||||||
|
// <Grid.Col span={3} style={{ alignItems: "center" }}>
|
||||||
|
// <TextCustom bold>Status</TextCustom>
|
||||||
|
// </Grid.Col>
|
||||||
|
// <Grid.Col span={6}>
|
||||||
|
// <TextCustom bold align="center" >Stiker</TextCustom>
|
||||||
|
// </Grid.Col>
|
||||||
|
// </Grid>
|
||||||
|
|
||||||
|
// <Divider />
|
||||||
|
|
||||||
|
// <StackCustom>
|
||||||
|
// {listSticker.map((e, i) => (
|
||||||
|
// <View key={i}>
|
||||||
|
// <Grid>
|
||||||
|
// <Grid.Col
|
||||||
|
// span={3}
|
||||||
|
// style={{ alignItems: "center", justifyContent: "center" }}
|
||||||
|
// >
|
||||||
|
// <ActionIcon
|
||||||
|
// icon={
|
||||||
|
// <FontAwesome5
|
||||||
|
// name="edit"
|
||||||
|
// size={ICON_SIZE_BUTTON}
|
||||||
|
// color="black"
|
||||||
|
// />
|
||||||
|
// }
|
||||||
|
// onPress={() => {
|
||||||
|
// router.push(`/admin/app-information/sticker/${i}`);
|
||||||
|
// }}
|
||||||
|
// />
|
||||||
|
// </Grid.Col>
|
||||||
|
// <Grid.Col
|
||||||
|
// span={3}
|
||||||
|
// style={{ alignItems: "center", justifyContent: "center" }}
|
||||||
|
// >
|
||||||
|
// <Switch
|
||||||
|
// value={value}
|
||||||
|
// onValueChange={() => {
|
||||||
|
// setValue(!value);
|
||||||
|
// }}
|
||||||
|
// theme={{
|
||||||
|
// colors: {
|
||||||
|
// primary: MainColor.yellow,
|
||||||
|
// },
|
||||||
|
// }}
|
||||||
|
// />
|
||||||
|
// </Grid.Col>
|
||||||
|
// <Grid.Col span={6} style={{ justifyContent: "center", alignItems: "center" }}>
|
||||||
|
// <Image source={e.path} style={{ width: 100, height: 100 }} />
|
||||||
|
// </Grid.Col>
|
||||||
|
// </Grid>
|
||||||
|
// <Divider />
|
||||||
|
// </View>
|
||||||
|
// ))}
|
||||||
|
// </StackCustom>
|
||||||
|
// </>
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
const listSticker = [
|
const listSticker = [
|
||||||
|
|||||||
@@ -93,15 +93,15 @@ export default function LoginView() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token && !isUserActive) {
|
if (token && token !== "" && !isUserActive) {
|
||||||
return <Redirect href={"/(application)/(user)/waiting-room"} />;
|
return <Redirect href={"/(application)/(user)/waiting-room"} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token && !isAdmin) {
|
if (token && token !== "" && !isAdmin) {
|
||||||
return <Redirect href={"/(application)/(user)/home"} />;
|
return <Redirect href={"/(application)/(user)/home"} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token && isAdmin) {
|
if (token && token !== "" && isAdmin) {
|
||||||
return <Redirect href={"/(application)/admin/dashboard"} />;
|
return <Redirect href={"/(application)/admin/dashboard"} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,23 +15,24 @@ function Collaboration_BoxPublishSection({
|
|||||||
data: any;
|
data: any;
|
||||||
rightComponentAvatar?: React.ReactNode;
|
rightComponentAvatar?: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BoxWithHeaderSection href={href}>
|
<BoxWithHeaderSection href={href}>
|
||||||
<StackCustom gap={0}>
|
<StackCustom gap={0}>
|
||||||
<AvatarUsernameAndOtherComponent
|
<AvatarUsernameAndOtherComponent
|
||||||
avatarHref={`/profile/${data?.Author?.id}`}
|
avatarHref={`/profile/${data?.Author?.Profile?.id}`}
|
||||||
name={data?.Author?.username || "Username"}
|
name={data?.Author?.username || "Username"}
|
||||||
rightComponent={rightComponentAvatar}
|
rightComponent={rightComponentAvatar}
|
||||||
avatar={data?.Author?.Profile?.imageId}
|
avatar={data?.Author?.Profile?.imageId}
|
||||||
withBottomLine
|
withBottomLine
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<StackCustom>
|
<StackCustom style={{paddingBlock: 10}}>
|
||||||
<TextCustom truncate size="large" bold align="center">
|
<TextCustom truncate size="large" bold align="center">
|
||||||
{data?.title || "-"}
|
{data?.title || "-"}
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
<TextCustom truncate={2}>{data?.purpose || "-"}</TextCustom>
|
{/* <TextCustom truncate={2}>{data?.purpose || "-"}</TextCustom> */}
|
||||||
{/* <TextCustom bold size="small" >
|
{/* <TextCustom bold size="small" >
|
||||||
2 Partisipan
|
2 Partisipan
|
||||||
</TextCustom> */}
|
</TextCustom> */}
|
||||||
|
|||||||
50
service/api-admin/api-admin-collaboration.ts
Normal file
50
service/api-admin/api-admin-collaboration.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
export async function apiAdminCollaboration({
|
||||||
|
category,
|
||||||
|
}: {
|
||||||
|
category: "dashboard" | "publish" | "reject" | "group";
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/collaboration?category=${category}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminCollaborationGetById({
|
||||||
|
id,
|
||||||
|
category,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
category: "publish" | "reject" | "group";
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/collaboration/${id}?category=${category}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminCollaborationReject({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(`/mobile/admin/collaboration/${id}`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
18
service/api-admin/api-admin-job.ts
Normal file
18
service/api-admin/api-admin-job.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
export async function apiAdminJob({
|
||||||
|
category,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
category: "dashboard" | "publish" | "review" | "reject";
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/job?category=${category}&search=${search}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
102
service/api-admin/api-master-admin.ts
Normal file
102
service/api-admin/api-master-admin.ts
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
// ================== START MASTER BANK ================== //
|
||||||
|
export async function apiAdminMasterBank() {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/master/bank`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBankById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/master/bank/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBankUpdate({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(`/mobile/admin/master/bank/${id}`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBankCreate({ data }: { data: any }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.post(`/mobile/admin/master/bank`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ================== END MASTER BANK ================== //
|
||||||
|
|
||||||
|
// ================== START BUSINNES FIELD ================== //
|
||||||
|
|
||||||
|
export async function apiAdminMasterBusinessField() {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/master/business-field`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBusinessFieldById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/master/business-field/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBusinessFieldUpdate({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data: any;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(`/mobile/admin/master/business-field/${id}`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminMasterBusinessFieldCreate({ data }: { data: any }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.post(`/mobile/admin/master/business-field`, {
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ================== END BUSINNES FIELD ================== //
|
||||||
@@ -127,6 +127,10 @@ export async function apiMasterInvestment({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================== END MASTER INVESTMENT ================== //
|
||||||
|
|
||||||
|
// ================== START MASTER BANK ================== //
|
||||||
|
|
||||||
export async function apiMasterBank() {
|
export async function apiMasterBank() {
|
||||||
try {
|
try {
|
||||||
const response = await apiConfig.get(`/mobile/master/bank`);
|
const response = await apiConfig.get(`/mobile/master/bank`);
|
||||||
@@ -136,6 +140,8 @@ export async function apiMasterBank() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================== END MASTER BANK ================== //
|
||||||
|
|
||||||
export async function apiMasterDonation({
|
export async function apiMasterDonation({
|
||||||
category,
|
category,
|
||||||
}: {
|
}: {
|
||||||
|
|||||||
Reference in New Issue
Block a user