Add: - hipmi-note.md Fix: - app/(application)/(user)/donation/[id]/(transaction-flow)/[invoiceId]/failed.tsx - app/(application)/(user)/donation/[id]/(transaction-flow)/[invoiceId]/success.tsx - app/(application)/(user)/event/[id]/confirmation.tsx - app/(application)/(user)/investment/(tabs)/index.tsx - app/(application)/(user)/investment/(tabs)/my-holding.tsx - app/(application)/(user)/investment/[id]/(my-holding)/[id].tsx - app/(application)/(user)/investment/[id]/(transaction-flow)/failed.tsx - app/(application)/(user)/investment/[id]/(transaction-flow)/index.tsx - app/(application)/(user)/investment/[id]/(transaction-flow)/success.tsx - app/(application)/(user)/investment/[id]/investor.tsx - app/(application)/admin/investment/[id]/[status]/index.tsx - app/(application)/admin/investment/[id]/[status]/transaction-detail.tsx - app/(application)/admin/investment/[id]/list-of-investor.tsx - lib/dummy-data/investment/dummy-data-not-publish.ts - screens/Authentication/VerificationView.tsx - screens/Home/bottomFeatureSection.tsx - service/api-client/api-investment.ts ### No Issue
57 lines
1.5 KiB
TypeScript
57 lines
1.5 KiB
TypeScript
import {
|
|
FloatingButton,
|
|
LoaderCustom,
|
|
ViewWrapper
|
|
} from "@/components";
|
|
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
|
import Investment_BoxBerandaSection from "@/screens/Invesment/BoxBerandaSection";
|
|
import { apiInvestmentGetAll } from "@/service/api-client/api-investment";
|
|
import { router, useFocusEffect } from "expo-router";
|
|
import _ from "lodash";
|
|
import { useCallback, useState } from "react";
|
|
|
|
export default function InvestmentBursa() {
|
|
const [list, setList] = useState<any[] | null>(null);
|
|
const [loadingList, setLoadingList] = useState(false);
|
|
|
|
useFocusEffect(
|
|
useCallback(() => {
|
|
onLoadList();
|
|
}, [])
|
|
);
|
|
|
|
const onLoadList = async () => {
|
|
try {
|
|
setLoadingList(true);
|
|
const response = await apiInvestmentGetAll({
|
|
category: "bursa"
|
|
});
|
|
// console.log("[DATA LIST]", JSON.stringify(response.data, null, 2));
|
|
setList(response.data);
|
|
} catch (error) {
|
|
console.log("[ERROR]", error);
|
|
} finally {
|
|
setLoadingList(false);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<ViewWrapper
|
|
hideFooter
|
|
floatingButton={
|
|
<FloatingButton onPress={() => router.push("/investment/create")} />
|
|
}
|
|
>
|
|
{loadingList ? (
|
|
<LoaderCustom />
|
|
) : _.isEmpty(list) ? (
|
|
<NoDataText />
|
|
) : (
|
|
list?.map((item: any, index: number) => (
|
|
<Investment_BoxBerandaSection id={item.id} data={item} key={index} />
|
|
))
|
|
)}
|
|
</ViewWrapper>
|
|
);
|
|
}
|