Invesment
Add: - app/(application)/(user)/investment/[id]/(news)/ Fix: - app/(application)/(user)/investment/[id]/[status]/detail.tsx - screens/Invesment/BoxDetailDataSection.tsx Component Add: - Tambah icon : IconDocument, IconNews, IconPlus, IconProspectus, IconTrash ## No Issue
This commit is contained in:
@@ -250,6 +250,13 @@ export default function UserLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Stack.Screen
|
||||||
|
name="investment/[id]/(news)/add-news"
|
||||||
|
options={{
|
||||||
|
title: "Tambah Berita",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* ========== End Investment Section ========= */}
|
{/* ========== End Investment Section ========= */}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
import {
|
||||||
|
AlertDefaultSystem,
|
||||||
|
BackButton,
|
||||||
|
BaseBox,
|
||||||
|
DotButton,
|
||||||
|
DrawerCustom,
|
||||||
|
DummyLandscapeImage,
|
||||||
|
MenuDrawerDynamicGrid,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function InvestmentNews() {
|
||||||
|
const { id, news } = useLocalSearchParams();
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: "Detail Berita",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ViewWrapper>
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom>
|
||||||
|
<DummyLandscapeImage />
|
||||||
|
<TextCustom bold align="center" size="large">
|
||||||
|
Judul Berita {news} Terbaru
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom>
|
||||||
|
Lorem ipsum dolor sit amet consectetur adipisicing elit. Laborum
|
||||||
|
fuga mollitia laboriosam voluptatibus quos molestias, illo fugiat
|
||||||
|
esse repellat, ad officia earum numquam? Aliquid corrupti quam
|
||||||
|
tempora cum harum est!
|
||||||
|
</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawer}
|
||||||
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
height={"auto"}
|
||||||
|
>
|
||||||
|
<MenuDrawerDynamicGrid
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
label: "Hapus Berita",
|
||||||
|
path: `/investment/${id}/add-news`,
|
||||||
|
icon: <IconTrash />,
|
||||||
|
color: "red",
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
onPressItem={(item) => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Hapus Berita",
|
||||||
|
message: "Apakah Anda yakin ingin menghapus berita ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Hapus",
|
||||||
|
onPressRight: () => {
|
||||||
|
router.back();
|
||||||
|
setOpenDrawer(false);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
53
app/(application)/(user)/investment/[id]/(news)/add-news.tsx
Normal file
53
app/(application)/(user)/investment/[id]/(news)/add-news.tsx
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
import {
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
|
||||||
|
export default function InvestmentAddNews() {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Pengunggahan foto ke aplikasi bersifat opsional dan tidak diwajibkan, Anda dapat menyimpan berita tanpa mengunggah foto." />
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/(application)/(image)/take-picture/123");
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
<Spacing />
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Berita"
|
||||||
|
placeholder="Masukan judul berita"
|
||||||
|
required
|
||||||
|
/>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Berita"
|
||||||
|
placeholder="Masukan deskripsi berita"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.back();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</StackCustom>
|
||||||
|
<Spacing />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import {
|
||||||
|
BackButton,
|
||||||
|
BaseBox,
|
||||||
|
DotButton,
|
||||||
|
DrawerCustom,
|
||||||
|
MenuDrawerDynamicGrid,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { IconPlus } from "@/components/_Icon";
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function InvestmentRecapOfNews() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: "Rekap Berita",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ViewWrapper>
|
||||||
|
{Array.from({ length: 15 }).map((_, index) => (
|
||||||
|
<BaseBox
|
||||||
|
key={index}
|
||||||
|
paddingBlock={5}
|
||||||
|
href={`/investment/${id}/(news)/${index + 1}`}
|
||||||
|
>
|
||||||
|
<TextCustom bold>Berita Terbaru {index + 1}</TextCustom>
|
||||||
|
</BaseBox>
|
||||||
|
))}
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawer}
|
||||||
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
height={"auto"}
|
||||||
|
>
|
||||||
|
<MenuDrawerDynamicGrid
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
label: "Tambah Berita",
|
||||||
|
path: `/investment/${id}/add-news`,
|
||||||
|
icon: <IconPlus />,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
onPressItem={(item) => {
|
||||||
|
router.push(item.path as any);
|
||||||
|
setOpenDrawer(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -13,19 +13,22 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import {
|
||||||
|
IconDocument,
|
||||||
|
IconEdit,
|
||||||
|
IconNews,
|
||||||
|
IconProspectus,
|
||||||
|
} from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_MEDIUM, ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
import { listDataNotPublish } from "@/lib/dummy-data/investment/dummy-data-not-publish";
|
import {
|
||||||
|
listDataNotPublishInvesment,
|
||||||
|
listDataPublishInvesment,
|
||||||
|
} from "@/lib/dummy-data/investment/dummy-data-not-publish";
|
||||||
import BoxDetailDataSection from "@/screens/Invesment/BoxDetailDataSection";
|
import BoxDetailDataSection from "@/screens/Invesment/BoxDetailDataSection";
|
||||||
import Investment_ButtonStatusSection from "@/screens/Invesment/ButtonStatusSection";
|
import Investment_ButtonStatusSection from "@/screens/Invesment/ButtonStatusSection";
|
||||||
import {
|
import { AntDesign, MaterialIcons } from "@expo/vector-icons";
|
||||||
AntDesign,
|
|
||||||
FontAwesome6,
|
|
||||||
Ionicons,
|
|
||||||
MaterialIcons,
|
|
||||||
} from "@expo/vector-icons";
|
|
||||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -58,11 +61,7 @@ export default function InvestmentDetailStatus() {
|
|||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom align="center">Prospektus</TextCustom>
|
<TextCustom align="center">Prospektus</TextCustom>
|
||||||
<CenterCustom>
|
<CenterCustom>
|
||||||
<FontAwesome6
|
<IconProspectus size={50} color={MainColor.white} />
|
||||||
name="file-contract"
|
|
||||||
size={50}
|
|
||||||
color={MainColor.white}
|
|
||||||
/>
|
|
||||||
</CenterCustom>
|
</CenterCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
@@ -77,11 +76,7 @@ export default function InvestmentDetailStatus() {
|
|||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom align="center">Dokumen</TextCustom>
|
<TextCustom align="center">Dokumen</TextCustom>
|
||||||
<CenterCustom>
|
<CenterCustom>
|
||||||
<FontAwesome6
|
<IconDocument size={50} color={MainColor.white} />
|
||||||
name="file-lines"
|
|
||||||
size={50}
|
|
||||||
color={MainColor.white}
|
|
||||||
/>
|
|
||||||
</CenterCustom>
|
</CenterCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
@@ -114,7 +109,11 @@ export default function InvestmentDetailStatus() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
)}
|
)}
|
||||||
<BoxDetailDataSection
|
<BoxDetailDataSection
|
||||||
data={listDataNotPublish}
|
data={
|
||||||
|
status === "publish"
|
||||||
|
? listDataPublishInvesment
|
||||||
|
: listDataNotPublishInvesment
|
||||||
|
}
|
||||||
bottomSection={bottomSection}
|
bottomSection={bottomSection}
|
||||||
/>
|
/>
|
||||||
<Investment_ButtonStatusSection status={status as string} />
|
<Investment_ButtonStatusSection status={status as string} />
|
||||||
@@ -172,29 +171,16 @@ export default function InvestmentDetailStatus() {
|
|||||||
<MenuDrawerDynamicGrid
|
<MenuDrawerDynamicGrid
|
||||||
data={[
|
data={[
|
||||||
{
|
{
|
||||||
icon: (
|
icon: <IconDocument />,
|
||||||
<FontAwesome6
|
|
||||||
name="file-lines"
|
|
||||||
size={ICON_SIZE_SMALL}
|
|
||||||
color={MainColor.white}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
label: "Update Dokumen",
|
label: "Update Dokumen",
|
||||||
path: `/investment/${id}/recap-of-document`,
|
path: `/investment/${id}/recap-of-document`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: <IconNews />,
|
||||||
<Ionicons
|
|
||||||
name="newspaper-outline"
|
|
||||||
size={ICON_SIZE_MEDIUM}
|
|
||||||
color={MainColor.white}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
label: "Update Berita",
|
label: "Update Berita",
|
||||||
path: `/investment/${id}/edit`,
|
path: `/investment/${id}/(news)/recap-of-news`,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
columns={4}
|
|
||||||
onPressItem={handlePressPublish as any}
|
onPressItem={handlePressPublish as any}
|
||||||
/>
|
/>
|
||||||
</DrawerCustom>
|
</DrawerCustom>
|
||||||
|
|||||||
25
components/_Icon/IconDocument.tsx
Normal file
25
components/_Icon/IconDocument.tsx
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
import { FontAwesome6, MaterialIcons } from "@expo/vector-icons";
|
||||||
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
|
||||||
|
export { IconDocument, IconDocumentEdit };
|
||||||
|
|
||||||
|
function IconDocument({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<FontAwesome6
|
||||||
|
name="file-lines"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function IconDocumentEdit({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<MaterialIcons
|
||||||
|
name="edit-document"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
15
components/_Icon/IconNews.tsx
Normal file
15
components/_Icon/IconNews.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { MaterialIcons } from "@expo/vector-icons";
|
||||||
|
|
||||||
|
export { IconNews };
|
||||||
|
|
||||||
|
function IconNews({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<MaterialIcons
|
||||||
|
name="newspaper"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
15
components/_Icon/IconPlus.tsx
Normal file
15
components/_Icon/IconPlus.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { Octicons } from "@expo/vector-icons";
|
||||||
|
|
||||||
|
export { IconPlus };
|
||||||
|
|
||||||
|
function IconPlus({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<Octicons
|
||||||
|
name="plus-circle"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
21
components/_Icon/IconProspectus.tsx
Normal file
21
components/_Icon/IconProspectus.tsx
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { FontAwesome6, MaterialIcons } from "@expo/vector-icons";
|
||||||
|
|
||||||
|
export { IconProspectus , IconProspectusEdit};
|
||||||
|
|
||||||
|
function IconProspectus({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<FontAwesome6 name="file-contract" size={size || ICON_SIZE_MEDIUM} color={color || MainColor.white} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function IconProspectusEdit({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<MaterialIcons
|
||||||
|
name="edit-note"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
15
components/_Icon/IconTrash.tsx
Normal file
15
components/_Icon/IconTrash.tsx
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
|
||||||
|
export { IconTrash };
|
||||||
|
|
||||||
|
function IconTrash({ color, size }: { color?: string; size?: number }) {
|
||||||
|
return (
|
||||||
|
<Ionicons
|
||||||
|
name="trash"
|
||||||
|
size={size || ICON_SIZE_MEDIUM}
|
||||||
|
color={color || MainColor.white}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -4,6 +4,10 @@ import IconHistory from "./IconHistory";
|
|||||||
import IconHome from "./IconHome";
|
import IconHome from "./IconHome";
|
||||||
import IconStatus from "./IconStatus";
|
import IconStatus from "./IconStatus";
|
||||||
import IconArchive from "./IconArchive";
|
import IconArchive from "./IconArchive";
|
||||||
|
import { IconProspectus, IconProspectusEdit } from "./IconProspectus";
|
||||||
|
import { IconDocument, IconDocumentEdit } from "./IconDocument";
|
||||||
|
import { IconNews } from "./IconNews";
|
||||||
|
import { IconPlus } from "./IconPlus";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
IconContribution,
|
IconContribution,
|
||||||
@@ -12,4 +16,14 @@ export {
|
|||||||
IconHome,
|
IconHome,
|
||||||
IconStatus,
|
IconStatus,
|
||||||
IconArchive,
|
IconArchive,
|
||||||
|
// Prospectus
|
||||||
|
IconProspectus,
|
||||||
|
IconProspectusEdit,
|
||||||
|
// Document
|
||||||
|
IconDocument,
|
||||||
|
IconDocumentEdit,
|
||||||
|
// News
|
||||||
|
IconNews,
|
||||||
|
// Plus
|
||||||
|
IconPlus,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
const listDataNotPublish = [
|
export {listDataNotPublishInvesment, listDataPublishInvesment};
|
||||||
|
|
||||||
|
const listDataNotPublishInvesment = [
|
||||||
{
|
{
|
||||||
label: "Target Dana",
|
label: "Target Dana",
|
||||||
value: "Rp. 7.500.000",
|
value: "Rp. 7.500.000",
|
||||||
@@ -29,4 +31,41 @@ const listDataNotPublish = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export {listDataNotPublish};
|
const listDataPublishInvesment = [
|
||||||
|
{
|
||||||
|
label: "Investor",
|
||||||
|
value: "10",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Target Dana",
|
||||||
|
value: "Rp. 7.500.000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Harga Per Lembar",
|
||||||
|
value: "Rp. 2.400",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Return Of Investment (ROI)",
|
||||||
|
value: "3 %",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Total Lembar",
|
||||||
|
value: "1.200",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Sisa Lembar",
|
||||||
|
value: "600",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Jadwal Pembagian",
|
||||||
|
value: "Rp. 2.880.000",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Pembagian Deviden",
|
||||||
|
value: "Selamanya",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Pencarian Investor",
|
||||||
|
value: "30 Hari",
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -24,7 +24,7 @@ export default function BoxDetailDataSection({
|
|||||||
<DummyLandscapeImage />
|
<DummyLandscapeImage />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<TextCustom align="center" size="xlarge" bold>
|
<TextCustom align="center" size="xlarge" bold>
|
||||||
{title || "Title of Investment"}
|
{title || "Judul Investasi"}
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user