fix layout investasi
deksripsi: - fix layout transaksi
This commit is contained in:
@@ -1,27 +1,51 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
|
||||||
import { Investasi_ViewInvoice } from "../../_view";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
|
import { Investasi_ViewInvoice } from "../../_view";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
|
||||||
import { gs_investas_menu } from "../../g_state";
|
import UI_NewLayoutTamplate, {
|
||||||
import { useRouter } from "next/navigation";
|
UI_NewChildren,
|
||||||
|
UI_NewHeader,
|
||||||
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi_OLD } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { ActionIcon, Loader } from "@mantine/core";
|
import { ActionIcon, Loader } from "@mantine/core";
|
||||||
import { IconX } from "@tabler/icons-react";
|
import { IconX } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { gs_investas_menu } from "../../g_state";
|
||||||
|
|
||||||
export function Investasi_UiInvoice({ dataInvoice }: { dataInvoice : any}) {
|
export function Investasi_UiInvoice({ dataInvoice }: { dataInvoice: any }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||||
const [isLoading, setLoading] = useState(false);
|
const [isLoading, setLoading] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<UIGlobal_LayoutTamplate
|
// <UIGlobal_LayoutTamplate
|
||||||
header={
|
// header={
|
||||||
<UIGlobal_LayoutHeaderTamplate
|
// <UIGlobal_LayoutHeaderTamplate
|
||||||
|
// title="Invoice"
|
||||||
|
// customButtonLeft={
|
||||||
|
// <ActionIcon
|
||||||
|
// variant="transparent"
|
||||||
|
// onClick={() => {
|
||||||
|
// setHotMenu(3);
|
||||||
|
// setLoading(true);
|
||||||
|
// router.push(RouterInvestasi_OLD.main_transaksi);
|
||||||
|
// }}
|
||||||
|
// >
|
||||||
|
// {isLoading ? <Loader color="yellow" /> : <IconX />}
|
||||||
|
// </ActionIcon>
|
||||||
|
// }
|
||||||
|
// />
|
||||||
|
// }
|
||||||
|
// >
|
||||||
|
// <Investasi_ViewInvoice dataInvoice={dataInvoice} />
|
||||||
|
// </UIGlobal_LayoutTamplate>
|
||||||
|
|
||||||
|
<UI_NewLayoutTamplate>
|
||||||
|
<UI_NewHeader>
|
||||||
|
<Component_Header
|
||||||
title="Invoice"
|
title="Invoice"
|
||||||
customButtonLeft={
|
customButtonLeft={
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
@@ -36,9 +60,10 @@ export function Investasi_UiInvoice({ dataInvoice }: { dataInvoice : any}) {
|
|||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
</UI_NewHeader>
|
||||||
>
|
<UI_NewChildren>
|
||||||
<Investasi_ViewInvoice dataInvoice={dataInvoice} />
|
<Investasi_ViewInvoice dataInvoice={dataInvoice} />
|
||||||
</UIGlobal_LayoutTamplate>
|
</UI_NewChildren>
|
||||||
|
</UI_NewLayoutTamplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
import UI_NewLayoutTamplate, {
|
||||||
|
UI_NewChildren,
|
||||||
|
UI_NewHeader,
|
||||||
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
import { Investasi_ViewMetodePembayaran } from "../../_view";
|
import { Investasi_ViewMetodePembayaran } from "../../_view";
|
||||||
|
|
||||||
export function Investasi_UiMetodePembayaran({
|
export function Investasi_UiMetodePembayaran({
|
||||||
@@ -9,18 +12,30 @@ export function Investasi_UiMetodePembayaran({
|
|||||||
investasiId,
|
investasiId,
|
||||||
}: {
|
}: {
|
||||||
listBank: any[];
|
listBank: any[];
|
||||||
investasiId: string
|
investasiId: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutTamplate
|
{/* <UIGlobal_LayoutTamplate
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Metode Pembayaran" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Metode Pembayaran" />}
|
||||||
>
|
>
|
||||||
<Investasi_ViewMetodePembayaran
|
<Investasi_ViewMetodePembayaran
|
||||||
listBank={listBank}
|
listBank={listBank}
|
||||||
investasiId={investasiId}
|
investasiId={investasiId}
|
||||||
/>
|
/>
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate> */}
|
||||||
|
|
||||||
|
<UI_NewLayoutTamplate>
|
||||||
|
<UI_NewHeader>
|
||||||
|
<Component_Header title="Metode Pembayaran" />
|
||||||
|
</UI_NewHeader>
|
||||||
|
<UI_NewChildren>
|
||||||
|
<Investasi_ViewMetodePembayaran
|
||||||
|
listBank={listBank}
|
||||||
|
investasiId={investasiId}
|
||||||
|
/>
|
||||||
|
</UI_NewChildren>
|
||||||
|
</UI_NewLayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
import { Component_Header } from "@/app_modules/_global/component/new/component_header";
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
import UI_NewLayoutTamplate, {
|
||||||
|
UI_NewChildren,
|
||||||
|
UI_NewHeader,
|
||||||
|
} from "@/app_modules/_global/ui/V2_layout_tamplate";
|
||||||
import { Investasi_ViewProsesPembelian } from "../../_view";
|
import { Investasi_ViewProsesPembelian } from "../../_view";
|
||||||
|
|
||||||
export function Investasi_UiProsesPembelian({
|
export function Investasi_UiProsesPembelian({
|
||||||
@@ -11,11 +14,20 @@ export function Investasi_UiProsesPembelian({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutTamplate
|
{/* <UIGlobal_LayoutTamplate
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Pembelian Saham" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Pembelian Saham" />}
|
||||||
>
|
>
|
||||||
<Investasi_ViewProsesPembelian dataInvestasi={dataInvestasi} />
|
<Investasi_ViewProsesPembelian dataInvestasi={dataInvestasi} />
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate> */}
|
||||||
|
|
||||||
|
<UI_NewLayoutTamplate>
|
||||||
|
<UI_NewHeader>
|
||||||
|
<Component_Header title="Pembelian Saham" />
|
||||||
|
</UI_NewHeader>
|
||||||
|
<UI_NewChildren>
|
||||||
|
<Investasi_ViewProsesPembelian dataInvestasi={dataInvestasi} />
|
||||||
|
</UI_NewChildren>
|
||||||
|
</UI_NewLayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ export function Investasi_ViewInvoice({
|
|||||||
color={copied ? "teal" : "yellow"}
|
color={copied ? "teal" : "yellow"}
|
||||||
c={"black"}
|
c={"black"}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Disalin" : "Salin"}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</CopyButton>
|
</CopyButton>
|
||||||
@@ -224,7 +224,7 @@ export function Investasi_ViewInvoice({
|
|||||||
c={"black"}
|
c={"black"}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Disalin" : "Salin"}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</CopyButton>
|
</CopyButton>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { IRealtimeData } from "@/lib/global_state";
|
|
||||||
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
|
||||||
import {
|
import {
|
||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
@@ -7,6 +5,8 @@ import {
|
|||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
|
import { notifikasiToAdmin_funCreate } from "@/app_modules/notifikasi/fun";
|
||||||
|
import { IRealtimeData } from "@/lib/global_state";
|
||||||
|
import { NEW_RouterInvestasi } from "@/lib/router_hipmi/router_investasi";
|
||||||
import { clientLogger } from "@/util/clientLogger";
|
import { clientLogger } from "@/util/clientLogger";
|
||||||
import { Button, Paper, Radio, Stack, Title } from "@mantine/core";
|
import { Button, Paper, Radio, Stack, Title } from "@mantine/core";
|
||||||
import { useLocalStorage } from "@mantine/hooks";
|
import { useLocalStorage } from "@mantine/hooks";
|
||||||
@@ -38,6 +38,7 @@ export function Investasi_ViewMetodePembayaran({
|
|||||||
|
|
||||||
async function onProses() {
|
async function onProses() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true);
|
||||||
const res = await investasi_funCreateInvoice({
|
const res = await investasi_funCreateInvoice({
|
||||||
data: {
|
data: {
|
||||||
total: total,
|
total: total,
|
||||||
@@ -48,6 +49,7 @@ export function Investasi_ViewMetodePembayaran({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res.status != 201) {
|
if (res.status != 201) {
|
||||||
|
setLoading(false);
|
||||||
ComponentGlobal_NotifikasiPeringatan(res.message);
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -73,13 +75,13 @@ export function Investasi_ViewMetodePembayaran({
|
|||||||
});
|
});
|
||||||
|
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setLoading(true);
|
|
||||||
router.push(NEW_RouterInvestasi.invoice + res.data?.id, {
|
router.push(NEW_RouterInvestasi.invoice + res.data?.id, {
|
||||||
scroll: false,
|
scroll: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
clientLogger.error("Error create invoice:", error);
|
clientLogger.error("Error create invoice:", error);
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +110,8 @@ export function Investasi_ViewMetodePembayaran({
|
|||||||
<Radio
|
<Radio
|
||||||
styles={{
|
styles={{
|
||||||
radio: {
|
radio: {
|
||||||
color: "yellow", backgroundColor: MainColor.white
|
color: "yellow",
|
||||||
|
backgroundColor: MainColor.white,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
value={e.id}
|
value={e.id}
|
||||||
|
|||||||
Reference in New Issue
Block a user