Donation
Add: - screens/Donation/ - donation/[id]/ Fix: - donation/(tabs)/status.tsx - donation/create-story.tsx - donation/create.tsx ## No Issue
This commit is contained in:
@@ -362,6 +362,36 @@ export default function UserLayout() {
|
|||||||
headerLeft: () => <BackButton />,
|
headerLeft: () => <BackButton />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="donation/[id]/index"
|
||||||
|
options={{
|
||||||
|
title: "Detail Donasi",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="donation/[id]/edit"
|
||||||
|
options={{
|
||||||
|
title: "Edit Donasi",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="donation/[id]/edit-story"
|
||||||
|
options={{
|
||||||
|
title: "Edit Donasi",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="donation/[id]/edit-rekening"
|
||||||
|
options={{
|
||||||
|
title: "Edit Rekening",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
{/* ========== End Donation Section ========= */}
|
{/* ========== End Donation Section ========= */}
|
||||||
|
|
||||||
{/* ========== Job Section ========= */}
|
{/* ========== Job Section ========= */}
|
||||||
|
|||||||
@@ -1,15 +1,7 @@
|
|||||||
import {
|
import { ScrollableCustom, ViewWrapper } from "@/components";
|
||||||
Grid,
|
|
||||||
BaseBox,
|
|
||||||
DummyLandscapeImage,
|
|
||||||
ScrollableCustom,
|
|
||||||
StackCustom,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
||||||
|
import Donasi_BoxStatus from "@/screens/Donation/BoxStatus";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { View } from "react-native";
|
|
||||||
|
|
||||||
export default function DonationStatus() {
|
export default function DonationStatus() {
|
||||||
const [activeCategory, setActiveCategory] = useState<string | null>(
|
const [activeCategory, setActiveCategory] = useState<string | null>(
|
||||||
@@ -35,39 +27,11 @@ export default function DonationStatus() {
|
|||||||
return (
|
return (
|
||||||
<ViewWrapper hideFooter headerComponent={scrollComponent}>
|
<ViewWrapper hideFooter headerComponent={scrollComponent}>
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{Array.from({ length: 10 }).map((_, index) => (
|
||||||
<BaseBox
|
<Donasi_BoxStatus
|
||||||
key={index}
|
key={index}
|
||||||
paddingTop={7}
|
id={index.toString()}
|
||||||
paddingBottom={7}
|
status={activeCategory as string}
|
||||||
href={`/investment/${index}`}
|
/>
|
||||||
>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<DummyLandscapeImage height={100} />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>
|
|
||||||
<View />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<StackCustom>
|
|
||||||
<TextCustom truncate>
|
|
||||||
Judul Donasi: {activeCategory} Lorem ipsum dolor sit amet
|
|
||||||
consectetur adipisicing elit.
|
|
||||||
</TextCustom>
|
|
||||||
|
|
||||||
<View>
|
|
||||||
<TextCustom>Target Dana</TextCustom>
|
|
||||||
<TextCustom bold color="yellow">
|
|
||||||
Rp. 7.500.000
|
|
||||||
</TextCustom>
|
|
||||||
</View>
|
|
||||||
{/* <TextCustom>
|
|
||||||
Terkumpul : Rp 300.000
|
|
||||||
</TextCustom> */}
|
|
||||||
</StackCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
))}
|
))}
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
);
|
);
|
||||||
|
|||||||
86
app/(application)/(user)/donation/[id]/[status]/detail.tsx
Normal file
86
app/(application)/(user)/donation/[id]/[status]/detail.tsx
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import {
|
||||||
|
BackButton,
|
||||||
|
DotButton,
|
||||||
|
DrawerCustom,
|
||||||
|
MenuDrawerDynamicGrid,
|
||||||
|
Spacing,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { IconEdit } from "@/components/_Icon";
|
||||||
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
|
import Donation_ButtonStatusSection from "@/screens/Donation/ButtonStatusSection";
|
||||||
|
import Donation_ComponentBoxDetailData from "@/screens/Donation/ComponentBoxDetailData";
|
||||||
|
import Donation_ComponentStoryFunrising from "@/screens/Donation/ComponentStoryFunrising";
|
||||||
|
import { FontAwesome6 } from "@expo/vector-icons";
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function DonasiDetailStatus() {
|
||||||
|
const { id, status } = useLocalSearchParams();
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
|
||||||
|
const handlePress = (item: IMenuDrawerItem) => {
|
||||||
|
console.log("PATH ", item.path);
|
||||||
|
router.navigate(item.path as any);
|
||||||
|
setOpenDrawer(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: `Detail ${_.startCase(status as string)}`,
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
headerRight: () =>
|
||||||
|
status === "draft" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ViewWrapper>
|
||||||
|
<Donation_ComponentBoxDetailData />
|
||||||
|
<Donation_ComponentStoryFunrising />
|
||||||
|
<Spacing />
|
||||||
|
<Donation_ButtonStatusSection status={status as string} />
|
||||||
|
<Spacing />
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawer}
|
||||||
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
height={"auto"}
|
||||||
|
>
|
||||||
|
<MenuDrawerDynamicGrid
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
icon: <IconEdit />,
|
||||||
|
label: "Edit Donasi",
|
||||||
|
path: `/donation/${id}/edit`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: <IconEdit />,
|
||||||
|
label: "Edit Cerita Penggalang",
|
||||||
|
path: `/donation/${id}/edit-story`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: (
|
||||||
|
<FontAwesome6
|
||||||
|
name="credit-card"
|
||||||
|
color={MainColor.white}
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
label: "Edit Rekening",
|
||||||
|
path: `/donation/${id}/edit-rekening`,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
columns={4}
|
||||||
|
onPressItem={handlePress as any}
|
||||||
|
/>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
32
app/(application)/(user)/donation/[id]/edit-rekening.tsx
Normal file
32
app/(application)/(user)/donation/[id]/edit-rekening.tsx
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { ViewWrapper, StackCustom, InformationBox, TextInputCustom, Spacing, ButtonCustom } from "@/components";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
|
||||||
|
export default function DonationEditRekening() {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Pastikan Anda mengisi nama bank dan nomor rekening dengan benar. Informasi ini akan membantu admin memverifikasi dan memproses penggalangan dana Anda dengan cepat dan tepat setelah penggalangan dana dipublikasikan." />
|
||||||
|
<TextInputCustom
|
||||||
|
label="Nama Bank"
|
||||||
|
placeholder="Masukkan nama bank"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Nomor Rekening"
|
||||||
|
placeholder="Masukkan nomor rekening"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Spacing />
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</StackCustom>
|
||||||
|
<Spacing />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
56
app/(application)/(user)/donation/[id]/edit-story.tsx
Normal file
56
app/(application)/(user)/donation/[id]/edit-story.tsx
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import {
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
|
||||||
|
export default function DonationEditStory() {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Cerita Anda adalah kunci untuk menginspirasi kebaikan. Jelaskan dengan jujur dan jelas tujuan penggalangan dana ini agar calon donatur memahami dampak positif yang dapat mereka wujudkan melalui kontribusi mereka." />
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Pembukaan Cerita"
|
||||||
|
placeholder="Masukkan pembukaan cerita"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/(application)/(image)/take-picture/123");
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
<Spacing />
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Tujuan Donasi"
|
||||||
|
placeholder="Masukkan tujuan donasi"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Spacing height={40} />
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</StackCustom>
|
||||||
|
<Spacing />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
79
app/(application)/(user)/donation/[id]/edit.tsx
Normal file
79
app/(application)/(user)/donation/[id]/edit.tsx
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
import {
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
SelectCustom,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { dummyDonasiDurasi } from "@/lib/dummy-data/donasi/durasi";
|
||||||
|
import { dummyDonasiKategori } from "@/lib/dummy-data/donasi/kategori";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
|
||||||
|
export default function DonationEdit() {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Lengkapi semua data di bawah untuk selanjutnya mengisi cerita penggalangan dana." />
|
||||||
|
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Donasi"
|
||||||
|
placeholder="Masukkan Judul Donasi"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Target Donasi"
|
||||||
|
placeholder="Masukkan Target Donasi"
|
||||||
|
required
|
||||||
|
keyboardType="numeric"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/(application)/(image)/take-picture/123");
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<SelectCustom
|
||||||
|
data={dummyDonasiKategori.map((item) => ({
|
||||||
|
label: item.label,
|
||||||
|
value: item.value,
|
||||||
|
}))}
|
||||||
|
onChange={(value) => console.log(value)}
|
||||||
|
label="Pilih Kategori Donasi"
|
||||||
|
placeholder="Pilih Kategori Donasi"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
|
||||||
|
<SelectCustom
|
||||||
|
data={dummyDonasiDurasi.map((item) => ({
|
||||||
|
label: item.label,
|
||||||
|
value: item.value,
|
||||||
|
}))}
|
||||||
|
onChange={(value) => console.log(value)}
|
||||||
|
label="Pilih Durasi Donasi"
|
||||||
|
placeholder="Pilih Durasi Donasi"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Spacing />
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</StackCustom>
|
||||||
|
<Spacing />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
9
app/(application)/(user)/donation/[id]/index.tsx
Normal file
9
app/(application)/(user)/donation/[id]/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { TextCustom } from "@/components";
|
||||||
|
|
||||||
|
export default function DonasiBeranda() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TextCustom>Detail Donasi</TextCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -32,7 +32,12 @@ export default function DonationCreateStory() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<LandscapeFrameUploaded />
|
<LandscapeFrameUploaded />
|
||||||
<ButtonCenteredOnly onPress={() => {}} icon="upload">
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/(application)/(image)/take-picture/123");
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { dummyDonasiDurasi } from "@/lib/dummy-data/donasi/durasi";
|
import { dummyDonasiDurasi } from "@/lib/dummy-data/donasi/durasi";
|
||||||
import { dummyDonasiKategori } from "@/lib/dummy-data/donasi/kategori";
|
import { dummyDonasiKategori } from "@/lib/dummy-data/donasi/kategori";
|
||||||
@@ -31,6 +31,17 @@ export default function DonationCreate() {
|
|||||||
keyboardType="numeric"
|
keyboardType="numeric"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/(application)/(image)/take-picture/123");
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
<SelectCustom
|
<SelectCustom
|
||||||
data={dummyDonasiKategori.map((item) => ({
|
data={dummyDonasiKategori.map((item) => ({
|
||||||
label: item.label,
|
label: item.label,
|
||||||
@@ -52,17 +63,15 @@ export default function DonationCreate() {
|
|||||||
placeholder="Pilih Durasi Donasi"
|
placeholder="Pilih Durasi Donasi"
|
||||||
required
|
required
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LandscapeFrameUploaded />
|
|
||||||
<ButtonCenteredOnly onPress={() => {
|
|
||||||
router.push("/(application)/(image)/take-picture/123")
|
|
||||||
}} icon="upload">
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<ButtonCustom onPress={() => {
|
<ButtonCustom
|
||||||
router.push("/donation/create-story")
|
onPress={() => {
|
||||||
}}>Selanjutnya</ButtonCustom>
|
router.push("/donation/create-story");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Selanjutnya
|
||||||
|
</ButtonCustom>
|
||||||
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -5,11 +5,13 @@ import { StyleSheet } from "react-native";
|
|||||||
import ClickableCustom from "../Clickable/ClickableCustom";
|
import ClickableCustom from "../Clickable/ClickableCustom";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
|
||||||
export default function DummyLandscapeImage({height}: {height?: number}) {
|
export default function DummyLandscapeImage({height, unClickPath}: {height?: number, unClickPath?: boolean}) {
|
||||||
return (
|
return (
|
||||||
<ClickableCustom
|
<ClickableCustom
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
router.push("/(application)/(image)/preview-image/1");
|
if (!unClickPath) {
|
||||||
|
router.push("/(application)/(image)/preview-image/1");
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Image source={DUMMY_IMAGE.background} style={[styles.backgroundImage, {height: height || 200}]} />
|
<Image source={DUMMY_IMAGE.background} style={[styles.backgroundImage, {height: height || 200}]} />
|
||||||
|
|||||||
50
screens/Donation/BoxStatus.tsx
Normal file
50
screens/Donation/BoxStatus.tsx
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
Grid,
|
||||||
|
DummyLandscapeImage,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import { View } from "react-native";
|
||||||
|
|
||||||
|
export default function Donasi_BoxStatus({
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
status: string;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BaseBox
|
||||||
|
paddingTop={7}
|
||||||
|
paddingBottom={7}
|
||||||
|
href={`/donation/${id}/${status}/detail`}
|
||||||
|
>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={5}>
|
||||||
|
<DummyLandscapeImage unClickPath height={100} />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={1}>
|
||||||
|
<View />
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<StackCustom>
|
||||||
|
<TextCustom truncate>
|
||||||
|
Judul Donasi: {status} Lorem ipsum dolor sit amet consectetur
|
||||||
|
adipisicing elit.
|
||||||
|
</TextCustom>
|
||||||
|
|
||||||
|
<View>
|
||||||
|
<TextCustom>Target Dana</TextCustom>
|
||||||
|
<TextCustom bold color="yellow">
|
||||||
|
Rp. 7.500.000
|
||||||
|
</TextCustom>
|
||||||
|
</View>
|
||||||
|
</StackCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</BaseBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
121
screens/Donation/ButtonStatusSection.tsx
Normal file
121
screens/Donation/ButtonStatusSection.tsx
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
import { AlertDefaultSystem, ButtonCustom, Grid } from "@/components";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
|
||||||
|
export default function Donation_ButtonStatusSection({
|
||||||
|
status,
|
||||||
|
}: {
|
||||||
|
status: string;
|
||||||
|
}) {
|
||||||
|
const handleBatalkanReview = () => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Batalkan Review",
|
||||||
|
message: "Apakah Anda yakin ingin batalkan review ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => {
|
||||||
|
console.log("Hapus");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleAjukanReview = () => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Ajukan Review",
|
||||||
|
message: "Apakah Anda yakin ingin ajukan review ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => {
|
||||||
|
console.log("Hapus");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEditKembali = () => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Edit Kembali",
|
||||||
|
message: "Apakah Anda yakin ingin edit kembali ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => {
|
||||||
|
console.log("Hapus");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOpenDeleteAlert = () => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Hapus",
|
||||||
|
message: "Apakah Anda yakin ingin menghapus data ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Hapus",
|
||||||
|
onPressRight: () => {
|
||||||
|
console.log("Hapus");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const DeleteButton = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ButtonCustom
|
||||||
|
backgroundColor="red"
|
||||||
|
textColor="white"
|
||||||
|
onPress={handleOpenDeleteAlert}
|
||||||
|
>
|
||||||
|
Hapus
|
||||||
|
</ButtonCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
switch (status) {
|
||||||
|
case "publish":
|
||||||
|
return <></>;
|
||||||
|
|
||||||
|
case "review":
|
||||||
|
return (
|
||||||
|
<ButtonCustom onPress={handleBatalkanReview}>
|
||||||
|
Batalkan Review
|
||||||
|
</ButtonCustom>
|
||||||
|
);
|
||||||
|
|
||||||
|
case "draft":
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||||
|
<ButtonCustom onPress={handleAjukanReview}>
|
||||||
|
Ajukan Review
|
||||||
|
</ButtonCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6} style={{ paddingLeft: 10 }}>
|
||||||
|
{DeleteButton()}
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
case "reject":
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||||
|
<ButtonCustom onPress={handleEditKembali}>
|
||||||
|
Edit Kembali
|
||||||
|
</ButtonCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6} style={{ paddingLeft: 10 }}>
|
||||||
|
{DeleteButton()}
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return <ButtonCustom disabled>Status Undifined</ButtonCustom>;
|
||||||
|
}
|
||||||
|
}
|
||||||
46
screens/Donation/ComponentBoxDetailData.tsx
Normal file
46
screens/Donation/ComponentBoxDetailData.tsx
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
StackCustom,
|
||||||
|
DummyLandscapeImage,
|
||||||
|
TextCustom,
|
||||||
|
Grid,
|
||||||
|
} from "@/components";
|
||||||
|
import { View } from "react-native";
|
||||||
|
|
||||||
|
export default function Donation_ComponentBoxDetailData() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom>
|
||||||
|
<DummyLandscapeImage />
|
||||||
|
<View>
|
||||||
|
<TextCustom bold size="large">
|
||||||
|
Judul Donasi: Lorem, ipsum dolor sit amet consectetur adipisicing
|
||||||
|
elit.
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom size="small">Durasi: 30 hari</TextCustom>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<View>
|
||||||
|
<TextCustom size="small">Target Dana</TextCustom>
|
||||||
|
<TextCustom truncate={2} size="large" bold color="yellow">
|
||||||
|
Rp. 7.500.000
|
||||||
|
</TextCustom>
|
||||||
|
</View>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<View>
|
||||||
|
<TextCustom size="small">Kategori</TextCustom>
|
||||||
|
<TextCustom size="large" bold color="yellow">
|
||||||
|
Kegiatan Sosial
|
||||||
|
</TextCustom>
|
||||||
|
</View>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
38
screens/Donation/ComponentStoryFunrising.tsx
Normal file
38
screens/Donation/ComponentStoryFunrising.tsx
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
import { BaseBox, StackCustom, Grid, TextCustom } from "@/components";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
|
||||||
|
export default function Donation_ComponentStoryFunrising() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={10}>
|
||||||
|
<TextCustom bold size="large">
|
||||||
|
Cerita Penggalang Dana
|
||||||
|
</TextCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<Ionicons
|
||||||
|
name="chevron-forward-circle-outline"
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
style={{
|
||||||
|
alignSelf: "flex-end",
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
<TextCustom truncate={3}>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit. Totam,
|
||||||
|
iusto porro quae optio accusantium amet minima deleniti temporibus
|
||||||
|
cum voluptatem vel veniam doloribus blanditiis sapiente deserunt
|
||||||
|
distinctio eaque aliquid laboriosam?
|
||||||
|
</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user