Compare commits
14 Commits
admin/11-a
...
auth/18-au
| Author | SHA1 | Date | |
|---|---|---|---|
| 1da4b00c2f | |||
| a4825343ba | |||
| 0b6c360500 | |||
| 6f5d04e73f | |||
| 4f4d9b2f05 | |||
| f2ba8fd4b1 | |||
| 70a6de6cc0 | |||
| 0fa6d54dbe | |||
| 40cb0bfc47 | |||
| 52c16b25b7 | |||
| 6f3cc03fa5 | |||
| c2f18948bf | |||
| 25884b64e7 | |||
| 21f89aeec5 |
2
.gitignore
vendored
@@ -38,3 +38,5 @@ yarn-error.*
|
||||
|
||||
app-example
|
||||
.qodo
|
||||
|
||||
.env
|
||||
|
||||
71
app.config.js
Normal file
@@ -0,0 +1,71 @@
|
||||
// app.config.js
|
||||
require('dotenv').config();
|
||||
|
||||
export default {
|
||||
name: 'HIPMI BADUNG',
|
||||
slug: 'hipmi-mobile',
|
||||
version: '1.0.0',
|
||||
orientation: 'portrait',
|
||||
icon: './assets/images/icon.png',
|
||||
scheme: 'hipmimobile',
|
||||
userInterfaceStyle: 'automatic',
|
||||
newArchEnabled: true,
|
||||
|
||||
ios: {
|
||||
supportsTablet: true,
|
||||
bundleIdentifier: 'com.anonymous.hipmi-mobile',
|
||||
infoPlist: {
|
||||
ITSAppUsesNonExemptEncryption: false,
|
||||
},
|
||||
},
|
||||
|
||||
android: {
|
||||
adaptiveIcon: {
|
||||
foregroundImage: './assets/images/splash-icon.png',
|
||||
backgroundColor: '#ffffff',
|
||||
},
|
||||
edgeToEdgeEnabled: true,
|
||||
package: 'com.bip.hipmimobileapp',
|
||||
},
|
||||
|
||||
web: {
|
||||
bundler: 'metro',
|
||||
output: 'static',
|
||||
favicon: './assets/images/favicon.png',
|
||||
},
|
||||
|
||||
plugins: [
|
||||
'expo-router',
|
||||
[
|
||||
'expo-splash-screen',
|
||||
{
|
||||
image: './assets/images/splash-icon.png',
|
||||
imageWidth: 200,
|
||||
resizeMode: 'contain',
|
||||
backgroundColor: '#ffffff',
|
||||
},
|
||||
],
|
||||
[
|
||||
'expo-camera',
|
||||
{
|
||||
cameraPermission: 'Allow $(PRODUCT_NAME) to access your camera',
|
||||
microphonePermission: 'Allow $(PRODUCT_NAME) to access your microphone',
|
||||
recordAudioAndroid: true,
|
||||
},
|
||||
],
|
||||
'expo-font',
|
||||
],
|
||||
|
||||
experiments: {
|
||||
typedRoutes: true,
|
||||
},
|
||||
|
||||
extra: {
|
||||
router: {},
|
||||
eas: {
|
||||
projectId: '5cf15964-4889-4755-b8ed-b99c61d614d1',
|
||||
},
|
||||
// Tambahkan environment variables ke sini
|
||||
API_BASE_URL: process.env.API_BASE_URL,
|
||||
},
|
||||
};
|
||||
@@ -4,7 +4,7 @@
|
||||
"slug": "hipmi-mobile",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
"icon": "./assets/images/logo-hipmi.png",
|
||||
"icon": "./assets/images/icon.png",
|
||||
"scheme": "hipmimobile",
|
||||
"userInterfaceStyle": "automatic",
|
||||
"newArchEnabled": true,
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"android": {
|
||||
"adaptiveIcon": {
|
||||
"foregroundImage": "./assets/images/adaptive-icon.png",
|
||||
"foregroundImage": "./assets/images/splash-icon.png",
|
||||
"backgroundColor": "#ffffff"
|
||||
},
|
||||
"edgeToEdgeEnabled": true,
|
||||
@@ -33,6 +33,14 @@ export default function UserLayout() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="waiting-room"
|
||||
options={{
|
||||
title: "Waiting Room",
|
||||
headerBackVisible: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Profile Section ========= */}
|
||||
<Stack.Screen
|
||||
name="profile"
|
||||
|
||||
13
app/(application)/(user)/waiting-room.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { InformationBox, ViewWrapper } from "@/components";
|
||||
|
||||
export default function WaitingRoom() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<InformationBox
|
||||
text="Permohonan akses Anda sedang dalam proses verifikasi oleh admin. Harap tunggu, Anda akan menerima pemberitahuan melalui Whatsapp setelah disetujui."
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -51,9 +51,6 @@ export default function AdminLayout() {
|
||||
<Stack.Screen name="dashboard" />
|
||||
{/* ================== Investment Start ================== */}
|
||||
<Stack.Screen name="investment/index" />
|
||||
<Stack.Screen name="investment/publish" />
|
||||
<Stack.Screen name="investment/review" />
|
||||
<Stack.Screen name="investment/reject" />
|
||||
{/* ================== Investment End ================== */}
|
||||
|
||||
{/* ================== Maps Start ================== */}
|
||||
@@ -86,10 +83,33 @@ export default function AdminLayout() {
|
||||
<Stack.Screen name="forum/[id]/index" />
|
||||
<Stack.Screen name="forum/report-comment"/>
|
||||
<Stack.Screen name="forum/report-posting"/>
|
||||
|
||||
<Stack.Screen name="forum/[id]/list-report-posting" />
|
||||
<Stack.Screen name="forum/[id]/list-report-comment"/>
|
||||
{/* ================== Forum End ================== */}
|
||||
|
||||
{/* ================== Voting Start ================== */}
|
||||
<Stack.Screen name="voting/index" />
|
||||
<Stack.Screen name="voting/[status]/status" />
|
||||
<Stack.Screen name="voting/[id]/[status]/index" />
|
||||
<Stack.Screen name="voting/[id]/reject-input"/>
|
||||
{/* ================== Voting End ================== */}
|
||||
|
||||
{/* ================== Event Start ================== */}
|
||||
<Stack.Screen name="event/index" />
|
||||
<Stack.Screen name="event/[status]/status" />
|
||||
<Stack.Screen name="event/type-of-event"/>
|
||||
<Stack.Screen name="event/type-create"/>
|
||||
<Stack.Screen name="event/type-update"/>
|
||||
{/* <Stack.Screen name="event/[id]/[status]/index" />
|
||||
<Stack.Screen name="event/[id]/reject-input"/> */}
|
||||
{/* ================== Event End ================== */}
|
||||
|
||||
{/* ================== Donasi Start ================== */}
|
||||
{/* <Stack.Screen name="donation/index" /> */}
|
||||
{/* <Stack.Screen name="donation/[status]/status" /> */}
|
||||
{/* <Stack.Screen name="donation/[id]/[status]/index" />
|
||||
<Stack.Screen name="donation/[id]/reject-input"/> */}
|
||||
{/* ================== Donasi End ================== */}
|
||||
</Stack>
|
||||
|
||||
<DrawerAdmin
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
ScrollableCustom,
|
||||
StackCustom,
|
||||
ViewWrapper,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import AdminActionIconPlus from "@/components/_ShareComponent/Admin/ActionIconPlus";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import AdminAppInformation_BusinessFieldSection from "@/screens/Admin/App-Information/BusinessFieldSection";
|
||||
import AdminAppInformation_Bank from "@/screens/Admin/App-Information/InformationBankSection";
|
||||
import AdminAppInformation_StickerSection from "@/screens/Admin/App-Information/StickerSection";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function AdminInformation() {
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>("bank");
|
||||
@@ -53,11 +50,7 @@ export default function AdminInformation() {
|
||||
<AdminComp_BoxTitle
|
||||
title={activePage}
|
||||
rightComponent={
|
||||
<View style={{ flexDirection: "row" }}>
|
||||
<ActionIcon
|
||||
icon={
|
||||
<Ionicons name="add" size={ICON_SIZE_SMALL} color="black" />
|
||||
}
|
||||
<AdminActionIconPlus
|
||||
onPress={() => {
|
||||
if (activeCategory === "bank") {
|
||||
router.push("/admin/app-information/information-bank/create");
|
||||
@@ -68,7 +61,6 @@ export default function AdminInformation() {
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
}
|
||||
/>
|
||||
{renderContent()}
|
||||
|
||||
259
app/(application)/admin/donation/[id]/[status]/index.tsx
Normal file
@@ -0,0 +1,259 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
AlertDefaultSystem,
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
ButtonCustom,
|
||||
DrawerCustom,
|
||||
DummyLandscapeImage,
|
||||
MenuDrawerDynamicGrid,
|
||||
ProgressCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconDot, IconList } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON, TEXT_SIZE_LARGE } from "@/constants/constans-value";
|
||||
import AdminDonation_BoxOfDonationStory from "@/screens/Admin/Donation/BoxOfDonationStory";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function AdminDonationDetail() {
|
||||
const { id, status } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = React.useState(false);
|
||||
|
||||
const colorBadge = () => {
|
||||
if (status === "publish") {
|
||||
return MainColor.green;
|
||||
} else if (status === "review") {
|
||||
return MainColor.orange;
|
||||
} else if (status === "reject") {
|
||||
return MainColor.red;
|
||||
} else {
|
||||
return MainColor.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Penggalang Dana",
|
||||
value: `Bagas Banuna ${id}`,
|
||||
},
|
||||
{
|
||||
label: "Judul",
|
||||
value: `Donasi Lorem ipsum dolor sit amet, consectetur adipisicing elit.`,
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: (
|
||||
<BadgeCustom color={colorBadge()}>
|
||||
{_.startCase(status as string)}
|
||||
</BadgeCustom>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "Durasi",
|
||||
value: "30 Hari",
|
||||
},
|
||||
{
|
||||
label: "Target Dana",
|
||||
value: "Rp 10.000.000",
|
||||
},
|
||||
{
|
||||
label: "Kategori",
|
||||
value: "Kategori Donasi",
|
||||
},
|
||||
// {
|
||||
// label: "Total Donatur",
|
||||
// value: "-",
|
||||
// },
|
||||
// {
|
||||
// label: "Progress",
|
||||
// value: "0 %",
|
||||
// },
|
||||
// {
|
||||
// label: "Dana Terkumpul",
|
||||
// value: "Rp 0",
|
||||
// },
|
||||
];
|
||||
|
||||
const listPencarianDana = [
|
||||
{
|
||||
label: "Total Dana Dicairkan",
|
||||
value: "Rp 0",
|
||||
},
|
||||
{
|
||||
label: "Sisa Dana",
|
||||
value: "Rp 0",
|
||||
},
|
||||
{
|
||||
label: "Akumulasi Pencairan",
|
||||
value: "0 kali",
|
||||
},
|
||||
{
|
||||
label: "Bank Tujuan",
|
||||
value: "BNI",
|
||||
},
|
||||
{
|
||||
label: "Nomor Rekening",
|
||||
value: "123456789",
|
||||
},
|
||||
];
|
||||
|
||||
const rightComponent = (
|
||||
<ActionIcon
|
||||
icon={<IconDot size={ICON_SIZE_BUTTON} />}
|
||||
onPress={() => {
|
||||
setOpenDrawer(true);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle
|
||||
title={`Detail Data`}
|
||||
rightComponent={status === "publish" && rightComponent}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{status === "publish" && (
|
||||
<View>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
<TextCustom bold align="center" size={TEXT_SIZE_LARGE}>
|
||||
Pencarian Dana
|
||||
</TextCustom>
|
||||
|
||||
<StackCustom gap={5}>
|
||||
{listPencarianDana.map((item, i) => (
|
||||
<GridDetail_4_8
|
||||
key={i}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
<ButtonCustom
|
||||
iconLeft={
|
||||
<Ionicons name="cash-outline" size={ICON_SIZE_BUTTON} />
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/donation/${id}/disbursement-of-funds`);
|
||||
}}
|
||||
>
|
||||
Cairkan Dana
|
||||
</ButtonCustom>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
<BaseBox>
|
||||
<ProgressCustom size="lg" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>Jumlah Donatur</TextCustom>}
|
||||
value={<TextCustom>0 orang</TextCustom>}
|
||||
/>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>Dana Terkumpul</TextCustom>}
|
||||
value={<TextCustom>Rp 0</TextCustom>}
|
||||
/>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</View>
|
||||
)}
|
||||
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
<DummyLandscapeImage />
|
||||
{listData.map((item, i) => (
|
||||
<GridDetail_4_8
|
||||
key={i}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
{status === "review" && (
|
||||
<StackCustom>
|
||||
<AdminDonation_BoxOfDonationStory />
|
||||
|
||||
<AdminButtonReview
|
||||
onPublish={() => {
|
||||
AlertDefaultSystem({
|
||||
title: "Publish",
|
||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
router.back();
|
||||
},
|
||||
});
|
||||
}}
|
||||
onReject={() => {
|
||||
router.push(`/admin/donation/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
</StackCustom>
|
||||
)}
|
||||
|
||||
{status === "reject" && (
|
||||
<StackCustom>
|
||||
<AdminDonation_BoxOfDonationStory />
|
||||
|
||||
<AdminButtonReject
|
||||
title="Tambah Catatan"
|
||||
onReject={() => {
|
||||
router.push(`/admin/donation/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
</StackCustom>
|
||||
)}
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={"auto"}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={[
|
||||
{
|
||||
label: "Daftar Donatur",
|
||||
icon: <IconList />,
|
||||
path: `/admin/donation/${id}/list-of-donatur`,
|
||||
},
|
||||
{
|
||||
label: "Daftar Pencarian Dana",
|
||||
icon: <IconList />,
|
||||
path: `/admin/donation/${id}/list-disbursement-of-funds`,
|
||||
},
|
||||
]}
|
||||
onPressItem={(item) => {
|
||||
setOpenDrawer(false);
|
||||
router.push(item.path as any);
|
||||
}}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import {
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function AdminDonasiTransactionDetail() {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const buttonAction = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Terima</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Donatur",
|
||||
value: "Bagas Banuna",
|
||||
},
|
||||
{
|
||||
label: "Bank",
|
||||
value: "BCA",
|
||||
},
|
||||
{
|
||||
label: "Jumlah Donasi",
|
||||
value: "Rp. 1.000.000",
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: <BadgeCustom color={MainColor.green}>Berhasil</BadgeCustom>,
|
||||
},
|
||||
{
|
||||
label: "Tanggal",
|
||||
value: dayjs().format("DD-MM-YYYY HH:mm:ss"),
|
||||
},
|
||||
{
|
||||
label: "Bukti Transfer",
|
||||
value: (
|
||||
<ButtonCustom
|
||||
onPress={() =>
|
||||
router.push(`/(application)/(image)/preview-image/${id}`)
|
||||
}
|
||||
>
|
||||
Cek
|
||||
</ButtonCustom>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Detail Transaksi" />}
|
||||
footerComponent={buttonAction}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
{listData.map((item, index) => (
|
||||
<GridDetail_4_8
|
||||
key={index}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
import {
|
||||
BaseBox,
|
||||
ButtonCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function AdminDonationDetailDisbursementOfFunds() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const listData = [
|
||||
{
|
||||
label: "Nominal",
|
||||
value: "Rp 1.000.000",
|
||||
},
|
||||
{
|
||||
label: "Tanggal",
|
||||
value: dayjs().format("DD-MM-YYYY HH:mm"),
|
||||
},
|
||||
{
|
||||
label: "Judul",
|
||||
value: `Judul Pencairan Dana ${id}`,
|
||||
},
|
||||
{
|
||||
label: "Deskripsi",
|
||||
value: `Lorem ipsum dolor sit amet consectetur adipisicing elit. Itaque velit eos facere a dicta nemo repellendus harum laboriosam quos, earum reprehenderit. Nisi sapiente, quo earum quis alias ullam temporibus quidem.`,
|
||||
},
|
||||
];
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle title="Detail Pencairan Dana" />
|
||||
}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
{listData.map((item, index) => (
|
||||
<GridDetail_4_8
|
||||
key={index}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
<ButtonCustom
|
||||
onPress={() =>
|
||||
router.push(`/(application)/(image)/preview-image/${id}`)
|
||||
}
|
||||
>
|
||||
Cek Bukti Transaksi
|
||||
</ButtonCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import {
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
InformationBox,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function AdminDonationDisbursementOfFunds() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const handleSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Pencairan Dana" />}
|
||||
footerComponent={handleSubmit}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom gap="md">
|
||||
<TextCustom align="center" bold size="large">
|
||||
Dana Tersisa
|
||||
</TextCustom>
|
||||
<TextCustom align="center" bold size="large">
|
||||
Rp 1.000.000
|
||||
</TextCustom>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
<BaseBox>
|
||||
<TextCustom bold size="large" align="center">
|
||||
Form Pencairan Dana
|
||||
</TextCustom>
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
<TextInputCustom
|
||||
required
|
||||
keyboardType="numeric"
|
||||
label="Nominal"
|
||||
placeholder="0"
|
||||
iconLeft={"Rp"}
|
||||
/>
|
||||
|
||||
<TextInputCustom required label="Judul" placeholder="Masukan judul" />
|
||||
|
||||
<TextAreaCustom
|
||||
required
|
||||
label="Deskripsi"
|
||||
placeholder="Masukan deskripsi"
|
||||
showCount
|
||||
maxLength={500}
|
||||
/>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
<InformationBox text="Wajib menyertakan bukti transfer" />
|
||||
|
||||
<ButtonCenteredOnly
|
||||
onPress={() => {
|
||||
router.push(`/(application)/(image)/take-picture/${id}`);
|
||||
}}
|
||||
icon="upload"
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
CenterCustom,
|
||||
Divider,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import { IconView } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function AdminDonasiListOfDisbursementOfFunds() {
|
||||
const { id } = useLocalSearchParams();
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle title="Daftar Pencairan Dana" />
|
||||
}
|
||||
>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<TextCustom bold align="center">
|
||||
Aksi
|
||||
</TextCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center">
|
||||
Tanggal
|
||||
</TextCustom>
|
||||
}
|
||||
component3={
|
||||
<TextCustom bold align="center">
|
||||
Nominal
|
||||
</TextCustom>
|
||||
}
|
||||
/>
|
||||
<Divider />
|
||||
<StackCustom>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<View key={index}>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<CenterCustom>
|
||||
<ActionIcon
|
||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/admin/donation/${id}/detail-disbursement-of-funds`
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</CenterCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center" truncate>
|
||||
{dayjs()
|
||||
.add(index + 1, "day")
|
||||
.format("DD-MM-YYYY HH:mm")}
|
||||
</TextCustom>
|
||||
}
|
||||
component3={<TextCustom>Rp. 1.000.000</TextCustom>}
|
||||
/>
|
||||
<Divider />
|
||||
</View>
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
101
app/(application)/admin/donation/[id]/list-of-donatur.tsx
Normal file
@@ -0,0 +1,101 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BadgeCustom,
|
||||
CenterCustom,
|
||||
SelectCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconView } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminDonasiListOfDonatur() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const searchComponent = (
|
||||
<View style={{ flexDirection: "row", gap: 5 }}>
|
||||
<SelectCustom
|
||||
placeholder="Pilih status transaksi"
|
||||
data={dummyMasterStatusTransaction}
|
||||
onChange={(value) => console.log(value)}
|
||||
styleContainer={{ width: "100%", marginBottom: 0 }}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle newComponent={searchComponent} />
|
||||
}
|
||||
>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<TextCustom bold align="center">
|
||||
Aksi
|
||||
</TextCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center">
|
||||
Donatur
|
||||
</TextCustom>
|
||||
}
|
||||
component3={
|
||||
<TextCustom bold align="center">
|
||||
Status
|
||||
</TextCustom>
|
||||
}
|
||||
/>
|
||||
<Divider />
|
||||
<StackCustom>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<View key={index}>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<CenterCustom>
|
||||
<ActionIcon
|
||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/admin/donation/${id}/berhasil/transaction-detail`
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</CenterCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center" truncate>
|
||||
Bagas Banuna
|
||||
</TextCustom>
|
||||
}
|
||||
component3={
|
||||
<BadgeCustom
|
||||
style={{ alignSelf: "center" }}
|
||||
color={MainColor.green}
|
||||
>
|
||||
Berhasil
|
||||
</BadgeCustom>
|
||||
}
|
||||
/>
|
||||
<Divider />
|
||||
</View>
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/admin/donation/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BoxButtonOnFooter,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminDonationRejectInput() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id as string);
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<AdminButtonReject
|
||||
title="Reject"
|
||||
onReject={() =>
|
||||
AlertDefaultSystem({
|
||||
title: "Reject",
|
||||
message: "Apakah anda yakin ingin menolak data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
console.log("value:", value);
|
||||
router.replace(`/admin/donation/reject/status`);
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
footerComponent={buttonSubmit}
|
||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Donasi" />}
|
||||
>
|
||||
<TextAreaCustom
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
placeholder="Masukan alasan"
|
||||
required
|
||||
showCount
|
||||
maxLength={1000}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
70
app/(application)/admin/donation/[status]/status.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
TextCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { Octicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminDonationStatus() {
|
||||
const { status } = useLocalSearchParams();
|
||||
const rightComponent = (
|
||||
<SearchInput
|
||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||
placeholder="Cari"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminComp_BoxTitle
|
||||
title={`Donasi ${_.startCase(status as string)}`}
|
||||
rightComponent={rightComponent}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<AdminTitleTable
|
||||
title1="Aksi"
|
||||
title2="Username"
|
||||
title3="Judul Donasi"
|
||||
/>
|
||||
<Spacing />
|
||||
<Divider />
|
||||
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<AdminTableValue
|
||||
key={index}
|
||||
value1={
|
||||
<ActionIcon
|
||||
icon={
|
||||
<Octicons name="eye" size={ICON_SIZE_BUTTON} color="black" />
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/donation/${index}/${status}`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
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>
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
27
app/(application)/admin/donation/category-create.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { useRouter } from "expo-router";
|
||||
|
||||
export default function AdminDonationCategoryCreate() {
|
||||
const router = useRouter();
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Simpan</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Tambah Kategori" />}
|
||||
footerComponent={buttonSubmit}
|
||||
>
|
||||
<TextInputCustom placeholder="Masukkan Kategori" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
35
app/(application)/admin/donation/category-update.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { useLocalSearchParams, useRouter } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminDonationCategoryUpdate() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id);
|
||||
|
||||
const router = useRouter();
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Update</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Ubah Kategori" />}
|
||||
footerComponent={buttonSubmit}
|
||||
>
|
||||
<TextInputCustom
|
||||
placeholder="Masukkan Kategori"
|
||||
value={value as any}
|
||||
onChangeText={setValue}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
113
app/(application)/admin/donation/category.tsx
Normal file
@@ -0,0 +1,113 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BaseBox,
|
||||
CenterCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconEdit } from "@/components/_Icon";
|
||||
import AdminActionIconPlus from "@/components/_ShareComponent/Admin/ActionIconPlus";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { GridView_3_3_6 } from "@/components/_ShareComponent/GridView_3_3_6";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { View } from "react-native";
|
||||
import { Divider, Switch } from "react-native-paper";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function AdminDonationCategory() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper headerComponent={<AdminTitlePage title="Donasi" />}>
|
||||
<AdminComp_BoxTitle
|
||||
title="Kategori"
|
||||
rightComponent={
|
||||
<AdminActionIconPlus
|
||||
onPress={() => {
|
||||
router.push(`/admin/donation/category-create`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
<BaseBox>
|
||||
<GridView_3_3_6
|
||||
component1={
|
||||
<TextCustom bold align="center">
|
||||
Aksi
|
||||
</TextCustom>
|
||||
}
|
||||
component2={<TextCustom bold>Status</TextCustom>}
|
||||
component3={<TextCustom bold>Kategori</TextCustom>}
|
||||
/>
|
||||
<Divider />
|
||||
<Spacing />
|
||||
|
||||
<StackCustom>
|
||||
{listData.map((item, index) => (
|
||||
<View key={index}>
|
||||
<GridView_3_3_6
|
||||
component1={
|
||||
<CenterCustom>
|
||||
<ActionIcon
|
||||
icon={
|
||||
<IconEdit size={ICON_SIZE_BUTTON} color="black" />
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/donation/category-update?id=${index}`);
|
||||
}}
|
||||
/>
|
||||
</CenterCustom>
|
||||
}
|
||||
component2={
|
||||
<Switch
|
||||
value={true}
|
||||
onValueChange={(item) => {
|
||||
console.log(item);
|
||||
}}
|
||||
color={MainColor.yellow}
|
||||
|
||||
/>
|
||||
}
|
||||
component3={<TextCustom bold>{item.label}</TextCustom>}
|
||||
/>
|
||||
<Spacing height={10} />
|
||||
<Divider />
|
||||
</View>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Kegiatan Sosial",
|
||||
value: "kegiatan_sosial",
|
||||
},
|
||||
{
|
||||
label: "Pendidikan",
|
||||
value: "pendidikan",
|
||||
},
|
||||
{
|
||||
label: "Kesehatan",
|
||||
value: "kesehatan",
|
||||
},
|
||||
{
|
||||
label: "Kebudayaan",
|
||||
value: "kebudayaan",
|
||||
},
|
||||
{
|
||||
label: "Bencana Alami",
|
||||
value: "bencana_alami",
|
||||
},
|
||||
{
|
||||
label: "Lainnya",
|
||||
value: "lainnya",
|
||||
},
|
||||
];
|
||||
49
app/(application)/admin/donation/index.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||
import {
|
||||
IconList,
|
||||
IconPublish,
|
||||
IconReject,
|
||||
IconReview,
|
||||
} from "@/components/_Icon/IconComponent";
|
||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminDonation() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<AdminTitlePage title="Donasi" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
{listData.map((item, i) => (
|
||||
<AdminComp_BoxDashboard key={i} item={item} />
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Publish",
|
||||
value: 4,
|
||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||
},
|
||||
{
|
||||
label: "Review",
|
||||
value: 7,
|
||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||
},
|
||||
{
|
||||
label: "Reject",
|
||||
value: 5,
|
||||
icon: <IconReject size={25} color={MainColor.red} />,
|
||||
},
|
||||
{
|
||||
label: "Kategori",
|
||||
value: 4,
|
||||
icon: <IconList size={25} color={MainColor.white_gray} />,
|
||||
},
|
||||
];
|
||||
217
app/(application)/admin/event/[id]/[status]/index.tsx
Normal file
@@ -0,0 +1,217 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
AlertDefaultSystem,
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
DrawerCustom,
|
||||
MenuDrawerDynamicGrid,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconDot, IconList } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import React from "react";
|
||||
import QRCode from "react-native-qrcode-svg";
|
||||
|
||||
export default function AdminEventDetail() {
|
||||
const { id, status } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = React.useState(false);
|
||||
|
||||
const colorBadge = () => {
|
||||
if (status === "publish") {
|
||||
return MainColor.green;
|
||||
} else if (status === "review") {
|
||||
return MainColor.orange;
|
||||
} else if (status === "reject") {
|
||||
return MainColor.red;
|
||||
} else {
|
||||
return MainColor.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Pembuat Event",
|
||||
value: `Bagas Banuna ${id}`,
|
||||
},
|
||||
{
|
||||
label: "Judul Event",
|
||||
value: `Event 123`,
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: (
|
||||
<BadgeCustom color={colorBadge()}>
|
||||
{_.startCase(status as string)}
|
||||
</BadgeCustom>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "Lokasi",
|
||||
value: "Lokasi Event",
|
||||
},
|
||||
{
|
||||
label: "Tipe Acara",
|
||||
value: "Tipe Acara",
|
||||
},
|
||||
{
|
||||
label: "Mulai Event",
|
||||
value: dayjs().format("DD/MM/YYYY HH:mm:ss"),
|
||||
},
|
||||
{
|
||||
label: "Event Berakhir",
|
||||
value: dayjs().add(3, "day").format("DD/MM/YYYY HH:mm:ss"),
|
||||
},
|
||||
{
|
||||
label: "Deskripsi",
|
||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
||||
},
|
||||
// {
|
||||
// label: "Daftar Tipe Acara",
|
||||
// value: (
|
||||
// <>
|
||||
// <List.Item
|
||||
// title={<TextCustom>Pilihan 1</TextCustom>}
|
||||
// left={(props) => (
|
||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
// )}
|
||||
// />
|
||||
// <List.Item
|
||||
// title={<TextCustom>Pilihan 2</TextCustom>}
|
||||
// left={(props) => (
|
||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
// )}
|
||||
// />
|
||||
// <List.Item
|
||||
// title={<TextCustom>Pilihan 3</TextCustom>}
|
||||
// left={(props) => (
|
||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
// )}
|
||||
// />
|
||||
// <List.Item
|
||||
// title={<TextCustom>Pilihan 4</TextCustom>}
|
||||
// left={(props) => (
|
||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
// )}
|
||||
// />
|
||||
// </>
|
||||
// ),
|
||||
// },
|
||||
];
|
||||
|
||||
const rightComponent = (
|
||||
<ActionIcon
|
||||
icon={<IconDot size={ICON_SIZE_BUTTON} />}
|
||||
onPress={() => {
|
||||
setOpenDrawer(true);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle
|
||||
title={`Detail Data`}
|
||||
rightComponent={
|
||||
(status === "publish" || status === "riwayat") && rightComponent
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
{listData.map((item, i) => (
|
||||
<GridDetail_4_8
|
||||
key={i}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
|
||||
<Spacing />
|
||||
</BaseBox>
|
||||
{(status === "publish" || status === "riwayat") && (
|
||||
<BaseBox>
|
||||
<StackCustom style={{ alignItems: "center" }}>
|
||||
<TextCustom bold>QR Code Event</TextCustom>
|
||||
<QRCode
|
||||
value="https://google.com"
|
||||
size={200}
|
||||
// logo={require("@/assets/images/logo-hipmi.png")}
|
||||
// logoSize={70}
|
||||
// logoBackgroundColor="transparent"
|
||||
// logoBorderRadius={50}
|
||||
// color="black"
|
||||
/>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
)}
|
||||
|
||||
{status === "review" && (
|
||||
<AdminButtonReview
|
||||
onPublish={() => {
|
||||
AlertDefaultSystem({
|
||||
title: "Publish",
|
||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
router.back();
|
||||
},
|
||||
});
|
||||
}}
|
||||
onReject={() => {
|
||||
router.push(`/admin/event/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{status === "reject" && (
|
||||
<AdminButtonReject
|
||||
title="Tambah Catatan"
|
||||
onReject={() => {
|
||||
router.push(`/admin/event/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={"auto"}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={[
|
||||
{
|
||||
label: "Daftar Peserta",
|
||||
icon: <IconList />,
|
||||
path: `/admin/event/${id}/list-of-participants`,
|
||||
},
|
||||
]}
|
||||
onPressItem={(item) => {
|
||||
setOpenDrawer(false);
|
||||
router.push(item.path as any);
|
||||
}}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
42
app/(application)/admin/event/[id]/list-of-participants.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import { BadgeCustom, BaseBox, Grid, TextCustom, ViewWrapper } from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminEventListOfParticipants() {
|
||||
|
||||
const isPresent = ({id}: {id: number}) => {
|
||||
const check = id % 3 * 3;
|
||||
if (check === 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Daftar Peserta" />}
|
||||
>
|
||||
{Array.from({ length: 10 }).map((item, index) => (
|
||||
<BaseBox key={index}>
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<TextCustom bold>Username {index + 1}</TextCustom>
|
||||
<TextCustom>+6282123456789</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
||||
<BadgeCustom
|
||||
style={{ alignSelf: "flex-end" }}
|
||||
color={isPresent({id: index}) ? MainColor.green : MainColor.red}
|
||||
>
|
||||
{isPresent({id: index}) ? "Hadir" : "Tidak Hadir"}
|
||||
</BadgeCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</BaseBox>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/admin/event/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BoxButtonOnFooter,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminEventRejectInput() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id as string);
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<AdminButtonReject
|
||||
title="Reject"
|
||||
onReject={() =>
|
||||
AlertDefaultSystem({
|
||||
title: "Reject",
|
||||
message: "Apakah anda yakin ingin menolak data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
console.log("value:", value);
|
||||
router.replace(`/admin/event/reject/status`);
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
footerComponent={buttonSubmit}
|
||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Event" />}
|
||||
>
|
||||
<TextAreaCustom
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
placeholder="Masukan alasan"
|
||||
required
|
||||
showCount
|
||||
maxLength={1000}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
76
app/(application)/admin/event/[status]/status.tsx
Normal file
@@ -0,0 +1,76 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BaseBox,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { Octicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminEventStatus() {
|
||||
const { status } = useLocalSearchParams();
|
||||
const rightComponent = (
|
||||
<SearchInput
|
||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||
placeholder="Cari"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper headerComponent={<AdminTitlePage title="Event" />}>
|
||||
<AdminComp_BoxTitle
|
||||
title={`${_.startCase(status as string)}`}
|
||||
rightComponent={rightComponent}
|
||||
/>
|
||||
|
||||
<BaseBox>
|
||||
<AdminTitleTable
|
||||
title1="Aksi"
|
||||
title2="Username"
|
||||
title3="Judul Event"
|
||||
/>
|
||||
<Spacing />
|
||||
<Divider />
|
||||
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<AdminTableValue
|
||||
key={index}
|
||||
value1={
|
||||
<ActionIcon
|
||||
icon={
|
||||
<Octicons
|
||||
name="eye"
|
||||
size={ICON_SIZE_BUTTON}
|
||||
color="black"
|
||||
/>
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/event/${index}/${status}`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
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>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/admin/event/index.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||
import { IconArchive } from "@/components/_Icon";
|
||||
import {
|
||||
IconList,
|
||||
IconPublish,
|
||||
IconReject,
|
||||
IconReview,
|
||||
} from "@/components/_Icon/IconComponent";
|
||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminVoting() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<AdminTitlePage title="Event" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
{listData.map((item, i) => (
|
||||
<AdminComp_BoxDashboard key={i} item={item} />
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Publish",
|
||||
value: 3,
|
||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||
},
|
||||
{
|
||||
label: "Review",
|
||||
value: 8,
|
||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||
},
|
||||
{
|
||||
label: "Reject",
|
||||
value: 4,
|
||||
icon: <IconReject size={25} color={MainColor.red} />,
|
||||
},
|
||||
{
|
||||
label: "Riwayat",
|
||||
value: 6,
|
||||
icon: <IconArchive size={25} color={MainColor.placeholder} />,
|
||||
},
|
||||
{
|
||||
label: "Tipe Acara",
|
||||
value: 7,
|
||||
icon: <IconList size={25} color={MainColor.placeholder} />,
|
||||
},
|
||||
];
|
||||
27
app/(application)/admin/event/type-create.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { useRouter } from "expo-router";
|
||||
|
||||
export default function AdminEventTypeOfEventCreate() {
|
||||
const router = useRouter();
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Simpan</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Tambah Tipe Acara" />}
|
||||
footerComponent={buttonSubmit}
|
||||
>
|
||||
<TextInputCustom placeholder="Masukkan Tipe Acara" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
104
app/(application)/admin/event/type-of-event.tsx
Normal file
@@ -0,0 +1,104 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BaseBox,
|
||||
CenterCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconEdit } from "@/components/_Icon";
|
||||
import AdminActionIconPlus from "@/components/_ShareComponent/Admin/ActionIconPlus";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { router } from "expo-router";
|
||||
import { View } from "react-native";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminEventTypeOfEvent() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper headerComponent={<AdminTitlePage title="Event" />}>
|
||||
<AdminComp_BoxTitle
|
||||
title="Tipe Acara"
|
||||
rightComponent={
|
||||
<AdminActionIconPlus
|
||||
onPress={() => {
|
||||
router.push(`/admin/event/type-create`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
<BaseBox>
|
||||
<GridDetail_4_8
|
||||
label={
|
||||
<TextCustom bold align="center">
|
||||
Aksi
|
||||
</TextCustom>
|
||||
}
|
||||
value={<TextCustom bold>Tipe Acara</TextCustom>}
|
||||
/>
|
||||
<Divider />
|
||||
<Spacing />
|
||||
|
||||
<StackCustom>
|
||||
{listData.map((item, index) => (
|
||||
<View key={index}>
|
||||
<GridDetail_4_8
|
||||
label={
|
||||
<CenterCustom>
|
||||
<ActionIcon
|
||||
icon={
|
||||
<IconEdit size={ICON_SIZE_BUTTON} color="black" />
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/event/type-update?id=${index}`);
|
||||
}}
|
||||
/>
|
||||
</CenterCustom>
|
||||
}
|
||||
value={<TextCustom bold>{item.label}</TextCustom>}
|
||||
/>
|
||||
<Divider />
|
||||
</View>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Seminar",
|
||||
value: "seminar",
|
||||
},
|
||||
{
|
||||
label: "Workshop",
|
||||
value: "workshop",
|
||||
},
|
||||
{
|
||||
label: "Konferensi",
|
||||
value: "konferensi",
|
||||
},
|
||||
{
|
||||
label: "Lomba",
|
||||
value: "lomba",
|
||||
},
|
||||
{
|
||||
label: "Pameran",
|
||||
value: "pameran",
|
||||
},
|
||||
{
|
||||
label: "Pesta",
|
||||
value: "pesta",
|
||||
},
|
||||
{
|
||||
label: "Pertandingan",
|
||||
value: "pertandingan",
|
||||
},
|
||||
];
|
||||
30
app/(application)/admin/event/type-update.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { useLocalSearchParams, useRouter } from "expo-router";
|
||||
|
||||
export default function AdminEventTypeOfEventUpdate() {
|
||||
const { id } = useLocalSearchParams();
|
||||
console.log("id >", id);
|
||||
|
||||
const router = useRouter();
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Update</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Ubah Tipe Acara" />}
|
||||
footerComponent={buttonSubmit}
|
||||
>
|
||||
<TextInputCustom placeholder="Masukkan Tipe Acara" value="" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
244
app/(application)/admin/investment/[id]/[status]/index.tsx
Normal file
@@ -0,0 +1,244 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
AlertDefaultSystem,
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
ButtonCustom,
|
||||
DrawerCustom,
|
||||
DummyLandscapeImage,
|
||||
MenuDrawerDynamicGrid,
|
||||
ProgressCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import { IconProspectus } from "@/components/_Icon";
|
||||
import { IconDot, IconList } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import React from "react";
|
||||
|
||||
export default function AdminInvestmentDetail() {
|
||||
const { id, status } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = React.useState(false);
|
||||
|
||||
const colorBadge = () => {
|
||||
if (status === "publish") {
|
||||
return MainColor.green;
|
||||
} else if (status === "review") {
|
||||
return MainColor.orange;
|
||||
} else if (status === "reject") {
|
||||
return MainColor.red;
|
||||
} else {
|
||||
return MainColor.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Username",
|
||||
value: `Bagas Banuna ${id}`,
|
||||
},
|
||||
{
|
||||
label: "Judul",
|
||||
value: `Donasi Lorem ipsum dolor sit amet, consectetur adipisicing elit.`,
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: (
|
||||
<BadgeCustom color={colorBadge()}>
|
||||
{_.startCase(status as string)}
|
||||
</BadgeCustom>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "Dana Dibutuhkan",
|
||||
value: "Rp 10.000.000",
|
||||
},
|
||||
{
|
||||
label: "Harga Perlembar",
|
||||
value: "Rp 2500",
|
||||
},
|
||||
{
|
||||
label: "Total Lembar",
|
||||
value: "2490 lembar",
|
||||
},
|
||||
{
|
||||
label: "ROI",
|
||||
value: "4 %",
|
||||
},
|
||||
{
|
||||
label: "Pembagian Deviden",
|
||||
value: "3 bulan",
|
||||
},
|
||||
{
|
||||
label: "Jadwal Pembagian",
|
||||
value: "Selamanya",
|
||||
},
|
||||
{
|
||||
label: "Pencarian Investor",
|
||||
value: "30 Hari",
|
||||
},
|
||||
];
|
||||
|
||||
const rightComponent = (
|
||||
<ActionIcon
|
||||
icon={<IconDot size={ICON_SIZE_BUTTON} />}
|
||||
onPress={() => {
|
||||
setOpenDrawer(true);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminBackButtonAntTitle
|
||||
title={`Detail Data`}
|
||||
rightComponent={status === "publish" && rightComponent}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{status === "publish" && (
|
||||
<BaseBox>
|
||||
<ProgressCustom size="lg" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>Sisa Saham</TextCustom>}
|
||||
value={<TextCustom>2490 lembar</TextCustom>}
|
||||
/>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>Validasi Transaksi</TextCustom>}
|
||||
value={<TextCustom>4 Transaksi</TextCustom>}
|
||||
/>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
)}
|
||||
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
<DummyLandscapeImage />
|
||||
{listData.map((item, i) => (
|
||||
<GridDetail_4_8
|
||||
key={i}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>File Prospektus</TextCustom>}
|
||||
value={
|
||||
<ButtonCustom
|
||||
iconLeft={
|
||||
<IconProspectus
|
||||
size={ICON_SIZE_BUTTON}
|
||||
color={MainColor.darkblue}
|
||||
/>
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/(application)/(file)/${id}`);
|
||||
}}
|
||||
>
|
||||
Preview
|
||||
</ButtonCustom>
|
||||
}
|
||||
/>
|
||||
<GridDetail_4_8
|
||||
label={<TextCustom bold>File Dokumen</TextCustom>}
|
||||
value={
|
||||
<StackCustom>
|
||||
{Array.from({ length: 5 }).map((_, i) => (
|
||||
<ButtonCustom
|
||||
key={i}
|
||||
iconLeft={
|
||||
<IconProspectus
|
||||
size={ICON_SIZE_BUTTON}
|
||||
color={MainColor.darkblue}
|
||||
/>
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/(application)/(file)/${id}`);
|
||||
}}
|
||||
>
|
||||
Dokumen {i + 1}
|
||||
</ButtonCustom>
|
||||
))}
|
||||
</StackCustom>
|
||||
}
|
||||
/>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
{status === "review" && (
|
||||
<AdminButtonReview
|
||||
onPublish={() => {
|
||||
AlertDefaultSystem({
|
||||
title: "Publish",
|
||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
router.back();
|
||||
},
|
||||
});
|
||||
}}
|
||||
onReject={() => {
|
||||
router.push(`/admin/investment/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{status === "reject" && (
|
||||
<AdminButtonReject
|
||||
title="Tambah Catatan"
|
||||
onReject={() => {
|
||||
router.push(`/admin/investment/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={"auto"}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={[
|
||||
{
|
||||
label: "Daftar Investor",
|
||||
icon: <IconList />,
|
||||
path: `/admin/investment/${id}/list-of-investor`,
|
||||
},
|
||||
// {
|
||||
// label: "Daftar Pencarian Dana",
|
||||
// icon: <IconList />,
|
||||
// path: `/admin/donation/${id}/list-disbursement-of-funds`,
|
||||
// },
|
||||
]}
|
||||
onPressItem={(item) => {
|
||||
setOpenDrawer(false);
|
||||
router.push(item.path as any);
|
||||
}}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
import {
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function AdminInvestmentTransactionDetail() {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const buttonAction = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={() => router.back()}>Terima</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Investor",
|
||||
value: "Bagas Banuna",
|
||||
},
|
||||
{
|
||||
label: "Bank",
|
||||
value: "BCA",
|
||||
},
|
||||
{
|
||||
label: "Jumlah Investasi",
|
||||
value: "Rp. 1.000.000",
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: <BadgeCustom color={MainColor.green}>Berhasil</BadgeCustom>,
|
||||
},
|
||||
{
|
||||
label: "Tanggal",
|
||||
value: dayjs().format("DD-MM-YYYY HH:mm:ss"),
|
||||
},
|
||||
{
|
||||
label: "Bukti Transfer",
|
||||
value: (
|
||||
<ButtonCustom
|
||||
onPress={() =>
|
||||
router.push(`/(application)/(image)/preview-image/${id}`)
|
||||
}
|
||||
>
|
||||
Cek
|
||||
</ButtonCustom>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title="Detail Transaksi Investor" />}
|
||||
footerComponent={buttonAction}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
{listData.map((item, index) => (
|
||||
<GridDetail_4_8
|
||||
key={index}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
107
app/(application)/admin/investment/[id]/list-of-investor.tsx
Normal file
@@ -0,0 +1,107 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BadgeCustom,
|
||||
CenterCustom,
|
||||
SelectCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IconView } from "@/components/_Icon/IconComponent";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import { GridViewCustomSpan } from "@/components/_ShareComponent/GridViewCustomSpan";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { dummyMasterStatusTransaction } from "@/lib/dummy-data/_master/status-transaction";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import React from "react";
|
||||
import { View } from "react-native";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminInvestmentListOfInvestor() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const searchComponent = (
|
||||
<View style={{ flexDirection: "row", gap: 5 }}>
|
||||
<SelectCustom
|
||||
placeholder="Pilih status transaksi"
|
||||
data={dummyMasterStatusTransaction}
|
||||
onChange={(value) => console.log(value)}
|
||||
styleContainer={{ width: "100%", marginBottom: 0 }}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
|
||||
const headerComponent = (
|
||||
<StackCustom gap={"xs"}>
|
||||
<AdminBackButtonAntTitle title="Daftar Investor" />
|
||||
{searchComponent}
|
||||
</StackCustom>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={headerComponent}
|
||||
>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<TextCustom bold align="center">
|
||||
Aksi
|
||||
</TextCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center">
|
||||
Investor
|
||||
</TextCustom>
|
||||
}
|
||||
component3={
|
||||
<TextCustom bold align="center">
|
||||
Status
|
||||
</TextCustom>
|
||||
}
|
||||
/>
|
||||
<Divider />
|
||||
<StackCustom>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<View key={index}>
|
||||
<GridViewCustomSpan
|
||||
span1={3}
|
||||
span2={5}
|
||||
span3={4}
|
||||
component1={
|
||||
<CenterCustom>
|
||||
<ActionIcon
|
||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||
onPress={() => {
|
||||
router.push(
|
||||
`/admin/investment/${id}/berhasil/transaction-detail`
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</CenterCustom>
|
||||
}
|
||||
component2={
|
||||
<TextCustom bold align="center" truncate>
|
||||
Bagas Banuna
|
||||
</TextCustom>
|
||||
}
|
||||
component3={
|
||||
<BadgeCustom
|
||||
style={{ alignSelf: "center" }}
|
||||
color={MainColor.green}
|
||||
>
|
||||
Berhasil
|
||||
</BadgeCustom>
|
||||
}
|
||||
/>
|
||||
<Divider />
|
||||
</View>
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/admin/investment/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BoxButtonOnFooter,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminInvestmentRejectInput() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id as string);
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<AdminButtonReject
|
||||
title="Reject"
|
||||
onReject={() =>
|
||||
AlertDefaultSystem({
|
||||
title: "Reject",
|
||||
message: "Apakah anda yakin ingin menolak data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
console.log("value:", value);
|
||||
router.replace(`/admin/investment/reject/status`);
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
footerComponent={buttonSubmit}
|
||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Investasi" />}
|
||||
>
|
||||
<TextAreaCustom
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
placeholder="Masukan alasan"
|
||||
required
|
||||
showCount
|
||||
maxLength={1000}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
70
app/(application)/admin/investment/[status]/status.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
TextCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { Octicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminInvestmentStatus() {
|
||||
const { status } = useLocalSearchParams();
|
||||
const rightComponent = (
|
||||
<SearchInput
|
||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||
placeholder="Cari"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<AdminComp_BoxTitle
|
||||
title={`Investasi ${_.startCase(status as string)}`}
|
||||
rightComponent={rightComponent}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<AdminTitleTable
|
||||
title1="Aksi"
|
||||
title2="Username"
|
||||
title3="Judul Investasi"
|
||||
/>
|
||||
<Spacing />
|
||||
<Divider />
|
||||
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<AdminTableValue
|
||||
key={index}
|
||||
value1={
|
||||
<ActionIcon
|
||||
icon={
|
||||
<Octicons name="eye" size={ICON_SIZE_BUTTON} color="black" />
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/investment/${index}/${status}`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
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>
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +1,43 @@
|
||||
import { TextCustom, ViewWrapper } from "@/components";
|
||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||
import {
|
||||
IconPublish,
|
||||
IconReject,
|
||||
IconReview,
|
||||
} from "@/components/_Icon/IconComponent";
|
||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminInvestment() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<TextCustom>Admin Investment</TextCustom>
|
||||
<AdminTitlePage title="Investasi" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
{listData.map((item, i) => (
|
||||
<AdminComp_BoxDashboard key={i} item={item} />
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Publish",
|
||||
value: 3,
|
||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||
},
|
||||
{
|
||||
label: "Review",
|
||||
value: 5,
|
||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||
},
|
||||
{
|
||||
label: "Reject",
|
||||
value: 8,
|
||||
icon: <IconReject size={25} color={MainColor.red} />,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
import { TextCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function AdminInvestmentPublish() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<TextCustom>Admin Investment Publish</TextCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { TextCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function AdminInvestmentReject() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<TextCustom>Admin Investment Reject</TextCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { TextCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function AdminInvestmentReview() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<TextCustom>Admin Investment Review</TextCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +1,19 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
ButtonCustom,
|
||||
DummyLandscapeImage,
|
||||
Grid,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function AdminJobDetailStatus() {
|
||||
@@ -91,19 +94,35 @@ export default function AdminJobDetailStatus() {
|
||||
</BaseBox>
|
||||
|
||||
{status === "review" && (
|
||||
<Grid>
|
||||
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||
<ButtonCustom backgroundColor={MainColor.green} textColor="white">
|
||||
Publish
|
||||
</ButtonCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ paddingLeft: 10 }}>
|
||||
<ButtonCustom backgroundColor={MainColor.red} textColor="white">
|
||||
Reject
|
||||
</ButtonCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<AdminButtonReview
|
||||
onPublish={() => {
|
||||
AlertDefaultSystem({
|
||||
title: "Publish",
|
||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
router.back();
|
||||
},
|
||||
});
|
||||
}}
|
||||
onReject={() => {
|
||||
router.push(`/admin/job/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
{status === "reject" && (
|
||||
<AdminButtonReject
|
||||
title="Tambah Catatan"
|
||||
onReject={() => {
|
||||
router.push(`/admin/job/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
|
||||
55
app/(application)/admin/job/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BoxButtonOnFooter,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminJobRejectInput() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id as string);
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<AdminButtonReject
|
||||
title="Reject"
|
||||
onReject={() =>
|
||||
AlertDefaultSystem({
|
||||
title: "Reject",
|
||||
message: "Apakah anda yakin ingin menolak data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
console.log("value:", value);
|
||||
router.replace(`/admin/job/reject/status`);
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
footerComponent={buttonSubmit}
|
||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Job" />}
|
||||
>
|
||||
<TextAreaCustom
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
placeholder="Masukan alasan"
|
||||
required
|
||||
showCount
|
||||
maxLength={1000}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
173
app/(application)/admin/voting/[id]/[status]/index.tsx
Normal file
@@ -0,0 +1,173 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BadgeCustom,
|
||||
BaseBox,
|
||||
CircleContainer,
|
||||
Grid,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import dayjs from "dayjs";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { List } from "react-native-paper";
|
||||
|
||||
export default function AdminVotingDetail() {
|
||||
const { id, status } = useLocalSearchParams();
|
||||
|
||||
const colorBadge = () => {
|
||||
if (status === "publish") {
|
||||
return MainColor.green;
|
||||
} else if (status === "review") {
|
||||
return MainColor.orange;
|
||||
} else if (status === "reject") {
|
||||
return MainColor.red;
|
||||
} else {
|
||||
return MainColor.placeholder;
|
||||
}
|
||||
};
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Username",
|
||||
value: "Bagas Banuna",
|
||||
},
|
||||
{
|
||||
label: "Judul",
|
||||
value: `Judul Proyek: ${id}Lorem ipsum dolor sit amet consectetur adipisicing elit.`,
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
value: (
|
||||
<BadgeCustom color={colorBadge()}>
|
||||
{_.startCase(status as string)}
|
||||
</BadgeCustom>
|
||||
),
|
||||
},
|
||||
{
|
||||
label: "Mulai Voting",
|
||||
value: dayjs().format("DD/MM/YYYY"),
|
||||
},
|
||||
{
|
||||
label: "Voting Berakhir",
|
||||
value: dayjs().format("DD/MM/YYYY"),
|
||||
},
|
||||
|
||||
{
|
||||
label: "Deskripsi",
|
||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
||||
},
|
||||
{
|
||||
label: "Daftar Pilhan",
|
||||
value: (
|
||||
<>
|
||||
<List.Item
|
||||
title={<TextCustom>Pilihan 1</TextCustom>}
|
||||
left={(props) => (
|
||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
)}
|
||||
/>
|
||||
<List.Item
|
||||
title={<TextCustom>Pilihan 2</TextCustom>}
|
||||
left={(props) => (
|
||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
)}
|
||||
/>
|
||||
<List.Item
|
||||
title={<TextCustom>Pilihan 3</TextCustom>}
|
||||
left={(props) => (
|
||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
)}
|
||||
/>
|
||||
<List.Item
|
||||
title={<TextCustom>Pilihan 4</TextCustom>}
|
||||
left={(props) => (
|
||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
||||
)}
|
||||
/>
|
||||
</>
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={<AdminBackButtonAntTitle title={`Detail Data`} />}
|
||||
>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
{listData.map((item, i) => (
|
||||
<GridDetail_4_8
|
||||
key={i}
|
||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
||||
value={<TextCustom>{item.value}</TextCustom>}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
|
||||
{status === "publish" && (
|
||||
<BaseBox>
|
||||
<TextCustom bold align="center">
|
||||
Hasil Voting
|
||||
</TextCustom>
|
||||
<Spacing />
|
||||
<Grid>
|
||||
|
||||
{Array.from({length: 4}).map((_, index) => (
|
||||
<Grid.Col key={index} span={3} style={{ paddingRight: 3, paddingLeft: 3 }}>
|
||||
<StackCustom gap={"sm"}>
|
||||
<CircleContainer value={index % 3 * 3} style={{ alignSelf: "center" }} />
|
||||
<TextCustom size="small" align="center">
|
||||
Pilihan {index + 1}
|
||||
</TextCustom>
|
||||
</StackCustom>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</BaseBox>
|
||||
)}
|
||||
|
||||
{status === "review" && (
|
||||
<AdminButtonReview
|
||||
onPublish={() => {
|
||||
AlertDefaultSystem({
|
||||
title: "Publish",
|
||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||
textLeft: "Cancel",
|
||||
textRight: "Publish",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
router.back();
|
||||
},
|
||||
});
|
||||
}}
|
||||
onReject={() => {
|
||||
router.push(`/admin/voting/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
||||
{status === "reject" && (
|
||||
<AdminButtonReject
|
||||
title="Tambah Catatan"
|
||||
onReject={() => {
|
||||
router.push(`/admin/voting/${id}/reject-input`);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/admin/voting/[id]/reject-input.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AlertDefaultSystem,
|
||||
BoxButtonOnFooter,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function AdminVotingRejectInput() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [value, setValue] = useState(id as string);
|
||||
const buttonSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<AdminButtonReject
|
||||
title="Reject"
|
||||
onReject={() =>
|
||||
AlertDefaultSystem({
|
||||
title: "Reject",
|
||||
message: "Apakah anda yakin ingin menolak data ini?",
|
||||
textLeft: "Batal",
|
||||
textRight: "Ya",
|
||||
onPressLeft: () => {
|
||||
router.back();
|
||||
},
|
||||
onPressRight: () => {
|
||||
console.log("value:", value);
|
||||
router.replace(`/admin/voting/reject/status`);
|
||||
},
|
||||
})
|
||||
}
|
||||
/>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
footerComponent={buttonSubmit}
|
||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Voting" />}
|
||||
>
|
||||
<TextAreaCustom
|
||||
value={value}
|
||||
onChangeText={setValue}
|
||||
placeholder="Masukan alasan"
|
||||
required
|
||||
showCount
|
||||
maxLength={1000}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
76
app/(application)/admin/voting/[status]/status.tsx
Normal file
@@ -0,0 +1,76 @@
|
||||
import {
|
||||
ActionIcon,
|
||||
BaseBox,
|
||||
SearchInput,
|
||||
Spacing,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { Octicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { Divider } from "react-native-paper";
|
||||
|
||||
export default function AdminVotingStatus() {
|
||||
const { status } = useLocalSearchParams();
|
||||
const rightComponent = (
|
||||
<SearchInput
|
||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||
placeholder="Cari"
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper headerComponent={<AdminTitlePage title="Voting" />}>
|
||||
<AdminComp_BoxTitle
|
||||
title={`${_.startCase(status as string)}`}
|
||||
rightComponent={rightComponent}
|
||||
/>
|
||||
|
||||
<BaseBox>
|
||||
<AdminTitleTable
|
||||
title1="Aksi"
|
||||
title2="Username"
|
||||
title3="Judul Voting"
|
||||
/>
|
||||
<Spacing />
|
||||
<Divider />
|
||||
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<AdminTableValue
|
||||
key={index}
|
||||
value1={
|
||||
<ActionIcon
|
||||
icon={
|
||||
<Octicons
|
||||
name="eye"
|
||||
size={ICON_SIZE_BUTTON}
|
||||
color="black"
|
||||
/>
|
||||
}
|
||||
onPress={() => {
|
||||
router.push(`/admin/voting/${index}/${status}`);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
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>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
49
app/(application)/admin/voting/index.tsx
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||
import { IconArchive } from "@/components/_Icon";
|
||||
import {
|
||||
IconPublish,
|
||||
IconReject,
|
||||
IconReview,
|
||||
} from "@/components/_Icon/IconComponent";
|
||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminVoting() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<AdminTitlePage title="Voting" />
|
||||
<Spacing />
|
||||
<StackCustom gap={"xs"}>
|
||||
{listData.map((item, i) => (
|
||||
<AdminComp_BoxDashboard key={i} item={item} />
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
label: "Publish",
|
||||
value: 4,
|
||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||
},
|
||||
{
|
||||
label: "Review",
|
||||
value: 7,
|
||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||
},
|
||||
{
|
||||
label: "Reject",
|
||||
value: 5,
|
||||
icon: <IconReject size={25} color={MainColor.red} />,
|
||||
},
|
||||
{
|
||||
label: "Riwayat",
|
||||
value: 5,
|
||||
icon: <IconArchive size={25} color={MainColor.white_gray} />,
|
||||
},
|
||||
];
|
||||
@@ -1,5 +1,4 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Stack } from "expo-router";
|
||||
import AppRoot from "@/screens/RootLayout/AppRoot";
|
||||
import "react-native-gesture-handler";
|
||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||
import Toast from "react-native-toast-message";
|
||||
@@ -8,28 +7,7 @@ export default function RootLayout() {
|
||||
return (
|
||||
<>
|
||||
<SafeAreaProvider>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerStyle: { backgroundColor: MainColor.darkblue },
|
||||
headerTitleStyle: { color: MainColor.yellow, fontWeight: "bold" },
|
||||
headerTitleAlign: "center",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="index"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen name="+not-found" options={{ title: "" }} />
|
||||
<Stack.Screen
|
||||
name="verification"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="register"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
||||
</Stack>
|
||||
<AppRoot />
|
||||
</SafeAreaProvider>
|
||||
<Toast />
|
||||
</>
|
||||
|
||||
BIN
assets/images/constants/logo-hipmi.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 51 KiB |
BIN
assets/images/old-icon.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
assets/images/splash-icon-back.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 51 KiB |
@@ -6,6 +6,7 @@ import { radiusMap } from "@/constants/radius-value";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { stylesButton } from "./buttonCustomStyles";
|
||||
import { Href, router } from "expo-router";
|
||||
import { ActivityIndicator } from "react-native-paper";
|
||||
|
||||
// Import radiusMap
|
||||
|
||||
@@ -23,6 +24,7 @@ interface ButtonProps {
|
||||
disabled?: boolean;
|
||||
iconLeft?: React.ReactNode;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
||||
const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
@@ -36,6 +38,7 @@ const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
disabled = false,
|
||||
iconLeft,
|
||||
style,
|
||||
isLoading = false,
|
||||
}) => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
@@ -59,9 +62,13 @@ const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
>
|
||||
{/* Render icon jika tersedia */}
|
||||
{iconLeft && iconLeft}
|
||||
{isLoading ? (
|
||||
<ActivityIndicator size={18} color={MainColor.darkblue} />
|
||||
) : (
|
||||
<Text style={[stylesButton.buttonText, { color: textColor }]}>
|
||||
{children || title}
|
||||
</Text>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -5,9 +5,11 @@ import {
|
||||
FlatList,
|
||||
Modal,
|
||||
Pressable,
|
||||
StyleProp,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
ViewStyle,
|
||||
} from "react-native";
|
||||
|
||||
type SelectItem = {
|
||||
@@ -24,6 +26,7 @@ type SelectProps = {
|
||||
disabled?: boolean; // <-- tambahkan prop disabled
|
||||
onChange: (value: string | number) => void;
|
||||
borderRadius?: number;
|
||||
styleContainer?: StyleProp<ViewStyle>;
|
||||
};
|
||||
|
||||
const SelectCustom: React.FC<SelectProps> = ({
|
||||
@@ -35,6 +38,7 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
disabled = false, // <-- default false
|
||||
onChange,
|
||||
borderRadius = 8,
|
||||
styleContainer,
|
||||
}) => {
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
|
||||
@@ -43,7 +47,7 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
const hasError = required && value === null; // <-- check if empty and required
|
||||
|
||||
return (
|
||||
<View style={GStyles.inputContainerArea}>
|
||||
<View style={[GStyles.inputContainerArea, styleContainer]}>
|
||||
{label && (
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
@@ -52,7 +56,7 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
)}
|
||||
<Pressable
|
||||
style={[
|
||||
{ borderRadius },
|
||||
{ borderRadius, },
|
||||
hasError ? GStyles.inputErrorBorder : null,
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
|
||||
@@ -109,3 +109,23 @@ export const IconDot = ({ size, color }: { size?: number; color?: string }) => {
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export const IconList = ({
|
||||
size,
|
||||
color,
|
||||
}: {
|
||||
size?: number;
|
||||
color?: string;
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<Ionicons
|
||||
name="list"
|
||||
size={size || ICON_SIZE_MEDIUM}
|
||||
color={color || MainColor.white}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,10 +1,21 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { FontAwesome5 } from "@expo/vector-icons";
|
||||
|
||||
export default function IconEdit() {
|
||||
export default function IconEdit({
|
||||
size,
|
||||
color,
|
||||
}: {
|
||||
size: number;
|
||||
color: string;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<FontAwesome5 name="edit" size={ICON_SIZE_SMALL} color="white" />
|
||||
<FontAwesome5
|
||||
name="edit"
|
||||
size={size || ICON_SIZE_SMALL}
|
||||
color={color || MainColor.white}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
21
components/_ShareComponent/Admin/ActionIconPlus.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import ActionIcon from "@/components/ActionIcon/ActionIcon";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function AdminActionIconPlus({
|
||||
onPress,
|
||||
}: {
|
||||
onPress?: () => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<View style={{ flexDirection: "row" }}>
|
||||
<ActionIcon
|
||||
icon={<Ionicons name="add" size={ICON_SIZE_SMALL} color="black" />}
|
||||
onPress={onPress}
|
||||
/>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -5,25 +5,34 @@ import AdminBackButton from "./BackButton";
|
||||
export default function AdminBackButtonAntTitle({
|
||||
title,
|
||||
rightComponent,
|
||||
newComponent,
|
||||
}: {
|
||||
title: string;
|
||||
title?: string;
|
||||
rightComponent?: React.ReactNode;
|
||||
newComponent?: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Grid>
|
||||
<Grid.Col span={2}>
|
||||
<Grid.Col span={2} style={{ justifyContent: "center" }}>
|
||||
<AdminBackButton />
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={8}
|
||||
span={newComponent ? 10 : 8}
|
||||
style={{ alignItems: "center", justifyContent: "center" }}
|
||||
>
|
||||
{newComponent ? (
|
||||
newComponent
|
||||
) : (
|
||||
<TextCustom bold size={"large"} align="center">
|
||||
{title}
|
||||
</TextCustom>
|
||||
)}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2} style={{ alignItems: "flex-end" }}>
|
||||
<Grid.Col
|
||||
span={newComponent ? 0 : 2}
|
||||
style={{ alignItems: "flex-end" }}
|
||||
>
|
||||
{rightComponent}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
24
components/_ShareComponent/Admin/ButtonReject.tsx
Normal file
@@ -0,0 +1,24 @@
|
||||
import { IconReject } from "@/components/_Icon/IconComponent";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminButtonReject({
|
||||
title,
|
||||
onReject,
|
||||
}: {
|
||||
title: string;
|
||||
onReject: () => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<ButtonCustom
|
||||
iconLeft={<IconReject />}
|
||||
backgroundColor={MainColor.red}
|
||||
textColor="white"
|
||||
onPress={onReject}
|
||||
>
|
||||
{title}
|
||||
</ButtonCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
39
components/_ShareComponent/Admin/ButtonReview.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { IconPublish, IconReject } from "@/components/_Icon/IconComponent";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import Grid from "@/components/Grid/GridCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function AdminButtonReview({
|
||||
onPublish,
|
||||
onReject,
|
||||
}: {
|
||||
onPublish: () => void;
|
||||
onReject: () => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<Grid>
|
||||
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||
<ButtonCustom
|
||||
iconLeft={<IconPublish />}
|
||||
backgroundColor={MainColor.green}
|
||||
textColor="white"
|
||||
onPress={onPublish}
|
||||
>
|
||||
Publish
|
||||
</ButtonCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ paddingLeft: 10 }}>
|
||||
<ButtonCustom
|
||||
iconLeft={<IconReject />}
|
||||
backgroundColor={MainColor.red}
|
||||
textColor="white"
|
||||
onPress={onReject}
|
||||
>
|
||||
Reject
|
||||
</ButtonCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
40
components/_ShareComponent/GridViewCustomSpan.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Grid } from "@/components";
|
||||
|
||||
export const GridViewCustomSpan = ({
|
||||
span1,
|
||||
span2,
|
||||
span3,
|
||||
component1,
|
||||
component2,
|
||||
component3,
|
||||
}: {
|
||||
span1: number;
|
||||
span2: number;
|
||||
span3: number;
|
||||
component1: React.ReactNode;
|
||||
component2: React.ReactNode;
|
||||
component3: React.ReactNode;
|
||||
}) => {
|
||||
return (
|
||||
<Grid>
|
||||
<Grid.Col
|
||||
span={span1 || 4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component1}
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={span2 || 4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component2}
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={span3 || 4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component3}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
25
components/_ShareComponent/GridView_3_3_6.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { Grid } from "@/components";
|
||||
|
||||
export const GridView_3_3_6 = ({
|
||||
component1,
|
||||
component2,
|
||||
component3,
|
||||
}: {
|
||||
component1: React.ReactNode;
|
||||
component2: React.ReactNode;
|
||||
component3: React.ReactNode;
|
||||
}) => {
|
||||
return (
|
||||
<Grid>
|
||||
<Grid.Col span={3} style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}>
|
||||
{component1}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={3} style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}>
|
||||
{component2}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}>
|
||||
{component3}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
34
components/_ShareComponent/GridView_4_4_4.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import { Grid } from "@/components";
|
||||
|
||||
export const GridView_4_4_4 = ({
|
||||
component1,
|
||||
component2,
|
||||
component3,
|
||||
}: {
|
||||
component1: React.ReactNode;
|
||||
component2: React.ReactNode;
|
||||
component3: React.ReactNode;
|
||||
}) => {
|
||||
return (
|
||||
<Grid>
|
||||
<Grid.Col
|
||||
span={4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component1}
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component2}
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={4}
|
||||
style={{ justifyContent: "center", paddingRight: 5, paddingLeft: 5 }}
|
||||
>
|
||||
{component3}
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
);
|
||||
};
|
||||
23
lib/api.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
const API_BASE = (path: string) => {
|
||||
// const url = "https://stg-hipmi.wibudev.com/";
|
||||
const url = "http://172.20.173.254:3000/";
|
||||
return `${url}/${path}`;
|
||||
};
|
||||
|
||||
export async function apiVersion() {
|
||||
const response = await fetch(API_BASE("api/version"));
|
||||
const data = await response.json();
|
||||
return data;
|
||||
}
|
||||
|
||||
export async function apiLoginBack({ nomor }: { nomor: string }) {
|
||||
const response = await fetch(API_BASE("api/auth/login"), {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ nomor: nomor }),
|
||||
});
|
||||
const data = await response.json();
|
||||
return data;
|
||||
}
|
||||
4978
package-lock.json
generated
@@ -20,12 +20,14 @@
|
||||
"@react-navigation/native-stack": "^7.3.21",
|
||||
"@types/lodash": "^4.17.20",
|
||||
"@types/react-native-vector-icons": "^6.4.18",
|
||||
"axios": "^1.11.0",
|
||||
"dayjs": "^1.11.13",
|
||||
"expo": "53.0.17",
|
||||
"expo-blur": "~14.1.5",
|
||||
"expo-camera": "~16.1.10",
|
||||
"expo-clipboard": "~7.1.5",
|
||||
"expo-constants": "~17.1.7",
|
||||
"expo-dev-client": "~5.2.4",
|
||||
"expo-document-picker": "~13.1.6",
|
||||
"expo-file-system": "~18.1.11",
|
||||
"expo-font": "~13.3.2",
|
||||
@@ -43,15 +45,18 @@
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-native": "0.79.5",
|
||||
"react-native-dotenv": "^3.4.11",
|
||||
"react-native-gesture-handler": "~2.24.0",
|
||||
"react-native-international-phone-number": "^0.9.3",
|
||||
"react-native-maps": "1.20.1",
|
||||
"react-native-otp-entry": "^1.8.5",
|
||||
"react-native-pager-view": "6.7.1",
|
||||
"react-native-paper": "^5.14.5",
|
||||
"react-native-qrcode-svg": "^6.3.15",
|
||||
"react-native-reanimated": "~3.17.4",
|
||||
"react-native-safe-area-context": "5.4.0",
|
||||
"react-native-screens": "~4.11.1",
|
||||
"react-native-svg": "15.11.2",
|
||||
"react-native-toast-message": "^2.3.3",
|
||||
"react-native-vector-icons": "^10.2.0",
|
||||
"react-native-web": "~0.20.0",
|
||||
@@ -62,6 +67,7 @@
|
||||
"@types/react": "~19.0.10",
|
||||
"eslint": "^9.25.0",
|
||||
"eslint-config-expo": "~9.2.0",
|
||||
"expo-module-scripts": "^4.1.10",
|
||||
"typescript": "~5.8.3"
|
||||
},
|
||||
"private": true
|
||||
|
||||
34
screens/Admin/Donation/BoxOfDonationStory.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import {
|
||||
BaseBox,
|
||||
TextCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
DummyLandscapeImage,
|
||||
} from "@/components";
|
||||
|
||||
export default function AdminDonation_BoxOfDonationStory() {
|
||||
return (
|
||||
<>
|
||||
<BaseBox>
|
||||
<TextCustom bold>Cerita Penggalang Dana</TextCustom>
|
||||
<Spacing />
|
||||
|
||||
<StackCustom>
|
||||
<TextCustom>
|
||||
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Rem magni
|
||||
perspiciatis eius ipsam provident, impedit, fugiat aliquid nobis
|
||||
pariatur asperiores fuga quidem temporibus labore, molestias
|
||||
perferendis optio ipsum. Praesentium, tempore?
|
||||
</TextCustom>
|
||||
<DummyLandscapeImage />
|
||||
<TextCustom>
|
||||
Lorem ipsum dolor sit, amet consectetur adipisicing elit. Rem magni
|
||||
perspiciatis eius ipsam provident, impedit, fugiat aliquid nobis
|
||||
pariatur asperiores fuga quidem temporibus labore, molestias
|
||||
perferendis optio ipsum. Praesentium, tempore?
|
||||
</TextCustom>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -13,20 +13,20 @@ const adminListMenu: NavbarItem[] = [
|
||||
icon: "wallet",
|
||||
links: [
|
||||
{ label: "Dashboard", link: "/admin/investment" },
|
||||
{ label: "Publish", link: "/admin/investment/publish" },
|
||||
{ label: "Review", link: "/admin/investment/review" },
|
||||
{ label: "Reject", link: "/admin/investment/reject" },
|
||||
{ label: "Publish", link: "/admin/investment/publish/status" },
|
||||
{ label: "Review", link: "/admin/investment/review/status" },
|
||||
{ label: "Reject", link: "/admin/investment/reject/status" },
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Donasi",
|
||||
icon: "hand-right",
|
||||
links: [
|
||||
{ label: "Dashboard", link: "/admin/donasi" },
|
||||
{ label: "Publish", link: "/admin/donasi/publish" },
|
||||
{ label: "Review", link: "/admin/donasi/review" },
|
||||
{ label: "Reject", link: "/admin/donasi/reject" },
|
||||
{ label: "Kategori", link: "/admin/donasi/kategori" },
|
||||
{ label: "Dashboard", link: "/admin/donation" },
|
||||
{ label: "Publish", link: "/admin/donation/publish/status" },
|
||||
{ label: "Review", link: "/admin/donation/review/status" },
|
||||
{ label: "Reject", link: "/admin/donation/reject/status" },
|
||||
{ label: "Kategori", link: "/admin/donation/category" },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -34,11 +34,11 @@ const adminListMenu: NavbarItem[] = [
|
||||
icon: "calendar-clear",
|
||||
links: [
|
||||
{ label: "Dashboard", link: "/admin/event" },
|
||||
{ label: "Publish", link: "/admin/event/publish" },
|
||||
{ label: "Review", link: "/admin/event/review" },
|
||||
{ label: "Reject", link: "/admin/event/reject" },
|
||||
{ label: "Tipe Acara", link: "/admin/event/tipe-acara" },
|
||||
{ label: "Riwayat", link: "/admin/event/riwayat" },
|
||||
{ label: "Publish", link: "/admin/event/publish/status" },
|
||||
{ label: "Review", link: "/admin/event/review/status" },
|
||||
{ label: "Reject", link: "/admin/event/reject/status" },
|
||||
{ label: "Tipe Acara", link: "/admin/event/type-of-event" },
|
||||
{ label: "Riwayat", link: "/admin/event/riwayat/status" },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -46,10 +46,10 @@ const adminListMenu: NavbarItem[] = [
|
||||
icon: "accessibility-outline",
|
||||
links: [
|
||||
{ label: "Dashboard", link: "/admin/voting" },
|
||||
{ label: "Publish", link: "/admin/voting/publish" },
|
||||
{ label: "Review", link: "/admin/voting/review" },
|
||||
{ label: "Reject", link: "/admin/voting/reject" },
|
||||
{ label: "Riwayat", link: "/admin/voting/riwayat" },
|
||||
{ label: "Publish", link: "/admin/voting/publish/status" },
|
||||
{ label: "Review", link: "/admin/voting/review/status" },
|
||||
{ label: "Reject", link: "/admin/voting/reject/status" },
|
||||
{ label: "Riwayat", link: "/admin/voting/riwayat/status" },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,15 +2,28 @@ import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { apiLogin, apiVersion } from "@/service/api";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
export default function LoginView() {
|
||||
const [version, setVersion] = useState<string>("");
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
onLoadVersion();
|
||||
}, []);
|
||||
|
||||
async function onLoadVersion() {
|
||||
const res = await apiVersion();
|
||||
setVersion(res.data);
|
||||
}
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
@@ -20,27 +33,59 @@ export default function LoginView() {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleLogin() {
|
||||
async function validateData() {
|
||||
if (inputValue.length === 0) {
|
||||
return Toast.show({
|
||||
type: "error",
|
||||
text1: "Masukan nomor anda",
|
||||
});
|
||||
}
|
||||
|
||||
if (selectedCountry === null) {
|
||||
return Toast.show({
|
||||
type: "error",
|
||||
text1: "Pilih negara",
|
||||
});
|
||||
}
|
||||
|
||||
if (inputValue.length < 9) {
|
||||
return Toast.show({
|
||||
type: "error",
|
||||
text1: "Nomor tidak valid",
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async function handleLogin() {
|
||||
const isValid = await validateData();
|
||||
if (!isValid) return;
|
||||
|
||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
||||
const fixNumber = callingCode + inputValue;
|
||||
// console.log("fixNumber", fixNumber);
|
||||
const fixNumber = inputValue.replace(/\s+/g, "");
|
||||
const realNumber = callingCode + fixNumber;
|
||||
|
||||
const randomAlfabet = Math.random().toString(36).substring(2, 8);
|
||||
const randomNumber = Math.floor(Math.random() * 1000000);
|
||||
const id = randomAlfabet + randomNumber + fixNumber;
|
||||
console.log("login user id :", id);
|
||||
setLoading(true);
|
||||
const response = await apiLogin({ nomor: realNumber });
|
||||
|
||||
router.navigate("/verification");
|
||||
// router.navigate(`/(application)/(user)/profile/${id}`);
|
||||
// router.navigate("/(application)/(user)/home");
|
||||
// router.navigate(`/(application)/profile/${id}/edit`);
|
||||
// router.navigate(`/(application)/(user)/portofolio/${id}`)
|
||||
// router.navigate(`/(application)/(image)/preview-image/${id}`);
|
||||
// router.replace("/(application)/(user)/event/(tabs)");
|
||||
if (response.success) {
|
||||
Toast.show({
|
||||
type: "success",
|
||||
text1: "Sukses",
|
||||
text2: "Kode OTP berhasil dikirim",
|
||||
});
|
||||
router.navigate(`/verification?kodeId=${response.kodeId}`);
|
||||
setLoading(false);
|
||||
// router.replace("/(application)/coba");
|
||||
// router.navigate("/investment/(tabs)")1
|
||||
// router.navigate("/crowdfunding")
|
||||
// router.navigate("/admin/dashboard")
|
||||
} else {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Error",
|
||||
text2: response.message,
|
||||
});
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -57,15 +102,15 @@ export default function LoginView() {
|
||||
<Text
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: 30,
|
||||
right: 20,
|
||||
bottom: 35,
|
||||
right: 50,
|
||||
fontSize: 10,
|
||||
fontWeight: "thin",
|
||||
fontStyle: "italic",
|
||||
color: MainColor.white_gray,
|
||||
}}
|
||||
>
|
||||
powered by muku.id
|
||||
{version} | powered by muku.id
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
@@ -80,13 +125,14 @@ export default function LoginView() {
|
||||
|
||||
<Spacing />
|
||||
|
||||
<ButtonCustom onPress={handleLogin}>Login</ButtonCustom>
|
||||
|
||||
<ButtonCustom onPress={handleLogin} isLoading={loading}>
|
||||
Login
|
||||
</ButtonCustom>
|
||||
<Spacing />
|
||||
|
||||
<ButtonCustom onPress={() => router.navigate("/admin/forum")}>
|
||||
{/* <ButtonCustom onPress={() => router.navigate("/admin/investment")}>
|
||||
Admin ( Delete Soon )
|
||||
</ButtonCustom>
|
||||
</ButtonCustom> */}
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
);
|
||||
|
||||
@@ -5,16 +5,71 @@ import TextInputCustom from "@/components/TextInput/TextInputCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { Text, View } from "react-native";
|
||||
import { useState } from "react";
|
||||
import { apiRegister } from "@/service/api";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
export default function RegisterView() {
|
||||
const [username, setUsername] = useState("Bagas Banuna");
|
||||
const handleRegister = () => {
|
||||
console.log("Success register", username);
|
||||
router.push("/(application)/(user)/home");
|
||||
const { nomor } = useLocalSearchParams();
|
||||
const [username, setUsername] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const validasiData = () => {
|
||||
if (!nomor) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Gagal",
|
||||
text2: "Nomor tidak ditemukan",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (!username) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Gagal",
|
||||
text2: "Username tidak boleh kosong",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
async function handleRegister() {
|
||||
const isValid = validasiData();
|
||||
if (!isValid) return;
|
||||
const data = {
|
||||
nomor: nomor as string,
|
||||
username: username,
|
||||
};
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await apiRegister({ data });
|
||||
console.log("Success register", JSON.stringify(response, null, 2));
|
||||
|
||||
if (response.success) {
|
||||
Toast.show({
|
||||
type: "success",
|
||||
text1: "Sukses",
|
||||
text2: "Anda berhasil terdaftar",
|
||||
});
|
||||
router.replace("/(application)/(user)/waiting-room");
|
||||
}
|
||||
|
||||
Toast.show({
|
||||
type: "info",
|
||||
text1: "Info",
|
||||
text2: response.message,
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.log("Error register", error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper withBackground>
|
||||
@@ -33,7 +88,7 @@ export default function RegisterView() {
|
||||
<Text style={GStyles.textLabel}>
|
||||
Anda akan terdaftar dengan nomor
|
||||
</Text>
|
||||
<Text style={GStyles.textLabel}>+6282xxxxxxxxx</Text>
|
||||
<Text style={GStyles.textLabel}>+{nomor}</Text>
|
||||
<Spacing />
|
||||
</View>
|
||||
<TextInputCustom
|
||||
@@ -42,17 +97,9 @@ export default function RegisterView() {
|
||||
onChangeText={(text) => setUsername(text)}
|
||||
/>
|
||||
|
||||
<ButtonCustom onPress={handleRegister}>Daftar</ButtonCustom>
|
||||
{/* <Spacing />
|
||||
<ButtonCustom
|
||||
title="Coba"
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
onPress={() => {
|
||||
console.log("Home clicked");
|
||||
router.push("/(application)/coba");
|
||||
}}
|
||||
/> */}
|
||||
<ButtonCustom isLoading={loading} onPress={handleRegister}>
|
||||
Daftar
|
||||
</ButtonCustom>
|
||||
</View>
|
||||
</View>
|
||||
</ViewWrapper>
|
||||
|
||||
@@ -2,16 +2,74 @@ import Spacing from "@/components/_ShareComponent/Spacing";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { apiCheckCodeOtp, apiValidationCode } from "@/service/api";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { router } from "expo-router";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
import { OtpInput } from "react-native-otp-entry";
|
||||
import Toast from "react-native-toast-message";
|
||||
|
||||
export default function VerificationView() {
|
||||
const handleVerification = () => {
|
||||
console.log("Verification clicked");
|
||||
router.push("/register");
|
||||
const { kodeId } = useLocalSearchParams();
|
||||
const [codeOtp, setCodeOtp] = useState<string>("");
|
||||
const [inputOtp, setInputOtp] = useState<string>("");
|
||||
const [nomor, setNomor] = useState<string>("");
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
useEffect(() => {
|
||||
onLoadCheckCodeOtp(kodeId as string);
|
||||
}, [kodeId]);
|
||||
|
||||
async function onLoadCheckCodeOtp(kodeId: string) {
|
||||
const response = await apiCheckCodeOtp({ kodeId: kodeId });
|
||||
console.log("response ", JSON.stringify(response, null, 2));
|
||||
setCodeOtp(response.otp);
|
||||
setNomor(response.nomor);
|
||||
}
|
||||
|
||||
const handleVerification = async () => {
|
||||
const codeOtpNumber = parseInt(codeOtp);
|
||||
const inputOtpNumber = parseInt(inputOtp);
|
||||
|
||||
console.log("codeOtpNumber ", codeOtpNumber, typeof codeOtpNumber);
|
||||
console.log("inputOtpNumber ", inputOtpNumber, typeof inputOtpNumber);
|
||||
|
||||
if (inputOtpNumber !== codeOtpNumber) {
|
||||
Toast.show({
|
||||
type: "error",
|
||||
text1: "Gagal",
|
||||
text2: "Kode OTP tidak sesuai",
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
setLoading(true);
|
||||
const response = await apiValidationCode({ nomor: nomor });
|
||||
console.log("response ", JSON.stringify(response, null, 2));
|
||||
|
||||
if (response.success) {
|
||||
if (response.active) {
|
||||
if (response.roleId === "1") {
|
||||
router.replace("/(application)/(user)/home");
|
||||
} else {
|
||||
router.replace("/(application)/admin/dashboard");
|
||||
}
|
||||
} else {
|
||||
router.replace("/(application)/(user)/waiting-room");
|
||||
}
|
||||
} else {
|
||||
router.replace(`/register?nomor=${nomor}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("Error verification", error);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper withBackground>
|
||||
@@ -21,11 +79,10 @@ export default function VerificationView() {
|
||||
<Text style={GStyles.authTitle}>Verifikasi KOde OTP</Text>
|
||||
<Spacing height={30} />
|
||||
<Text style={GStyles.textLabel}>Masukan 4 digit kode otp</Text>
|
||||
<Text style={GStyles.textLabel}>
|
||||
Yang di kirim ke +6282xxxxxxxxx
|
||||
</Text>
|
||||
<Text style={GStyles.textLabel}>Yang di kirim ke +{nomor}</Text>
|
||||
<Spacing height={30} />
|
||||
<OtpInput
|
||||
disabled={codeOtp === ""}
|
||||
numberOfDigits={4}
|
||||
theme={{
|
||||
pinCodeContainerStyle: {
|
||||
@@ -41,6 +98,7 @@ export default function VerificationView() {
|
||||
paddingRight: 10,
|
||||
},
|
||||
}}
|
||||
onTextChange={(otp: string) => setInputOtp(otp)}
|
||||
/>
|
||||
<Spacing height={30} />
|
||||
<Text style={GStyles.textLabel}>
|
||||
@@ -52,6 +110,8 @@ export default function VerificationView() {
|
||||
</View>
|
||||
|
||||
<ButtonCustom
|
||||
isLoading={loading}
|
||||
disabled={codeOtp === ""}
|
||||
backgroundColor={MainColor.yellow}
|
||||
textColor={MainColor.black}
|
||||
onPress={() => handleVerification()}
|
||||
|
||||
31
screens/RootLayout/AppRoot.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function AppRoot() {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerStyle: { backgroundColor: MainColor.darkblue },
|
||||
headerTitleStyle: { color: MainColor.yellow, fontWeight: "bold" },
|
||||
headerTitleAlign: "center",
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="index"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen name="+not-found" options={{ title: "" }} />
|
||||
<Stack.Screen
|
||||
name="verification"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="register"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
/>
|
||||
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
48
service/api.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import axios, { AxiosInstance } from "axios";
|
||||
import Constants from "expo-constants";
|
||||
|
||||
const API_BASE_URL = Constants.expoConfig?.extra?.API_BASE_URL;
|
||||
|
||||
const api: AxiosInstance = axios.create({
|
||||
baseURL: API_BASE_URL,
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
export async function apiVersion() {
|
||||
console.log("API_BASE_URL", API_BASE_URL);
|
||||
const response = await api.get("/version");
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiLogin({ nomor }: { nomor: string }) {
|
||||
const response = await api.post("/auth/login", {
|
||||
nomor: nomor,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiCheckCodeOtp({ kodeId }: { kodeId: string }) {
|
||||
const response = await api.get(`/auth/check/${kodeId}`);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiValidationCode({ nomor }: { nomor: string }) {
|
||||
const response = await api.post(`/auth/validasi`, {
|
||||
nomor: nomor,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
export async function apiRegister({
|
||||
data,
|
||||
}: {
|
||||
data: { nomor: string; username: string };
|
||||
}) {
|
||||
const response = await api.post(`/auth/register`, {
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
@@ -11,7 +11,8 @@
|
||||
"include": [
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
"app/(application)/admin/app-information/business-field/[id]",
|
||||
".expo/types/**/*.ts",
|
||||
"expo-env.d.ts"
|
||||
, "app/(application)/admin/app-information/business-field/[id]" ]
|
||||
]
|
||||
}
|
||||
|
||||