Fix: Navbar admin
Deskripsi: - Fix bug navbar yang terpotong bagian atasnya
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, Group, Header, Title } from "@mantine/core";
|
||||
import { IconChevronLeft } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
|
||||
@@ -17,31 +14,7 @@ export default function LayoutDetailInvestasi({
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate title="Detail" />
|
||||
// <Header height={50} style={{ borderStyle: "none" }}>
|
||||
// <Group h={50} position="apart" px={"md"}>
|
||||
// <ActionIcon
|
||||
// variant="transparent"
|
||||
// onClick={() => {
|
||||
// router.back();
|
||||
// }}
|
||||
// >
|
||||
// <IconChevronLeft />
|
||||
// </ActionIcon>
|
||||
// <Title order={5}>Detail Investasi</Title>
|
||||
// <ActionIcon
|
||||
// variant="transparent"
|
||||
// disabled
|
||||
// onClick={() => {
|
||||
// router.replace("");
|
||||
// }}
|
||||
// >
|
||||
// {/* <IconEdit /> */}
|
||||
// </ActionIcon>
|
||||
// </Group>
|
||||
// </Header>
|
||||
}
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Detail" />}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDetailBeritaInvestasi({
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDetailDokumenInvestasi({
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, AppShell } from "@mantine/core";
|
||||
import { ActionIcon } from "@mantine/core";
|
||||
import { IconDotsVertical, IconEdit, IconFilePencil } from "@tabler/icons-react";
|
||||
import React, { useState } from "react";
|
||||
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDetailPublishInvestasi({
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDetailRejecttInvestasi({
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDetailReviewInvestasi({
|
||||
|
||||
@@ -3,17 +3,13 @@
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import {
|
||||
AppShell,
|
||||
CloseButton,
|
||||
Footer,
|
||||
Group,
|
||||
Header,
|
||||
Text,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import router from "next/router";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutDialogPageCreateInvestasi({
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { AppShell, CloseButton, Group, Header, Text } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutCountDownTransaksiInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<Header height={50} sx={{ borderStyle: "none" }} px={"md"}>
|
||||
<Group h={50} align="center">
|
||||
<CloseButton
|
||||
size={"md"}
|
||||
onClick={() => {
|
||||
router.push(RouterInvestasi_OLD.main_transaksi), setHotMenu(3);
|
||||
}}
|
||||
/>
|
||||
<Text>Status Transfer</Text>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Box, Center, Loader, Stack, Text, Title } from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import Countdown from "react-countdown";
|
||||
|
||||
export default function CountDownTransaksiInvestasi() {
|
||||
const router = useRouter();
|
||||
const [count, setCount] = useState<any | null>(10);
|
||||
useShallowEffect(() => {
|
||||
setTimeout(() => router.push(RouterInvestasi_OLD.status_transaksi), 10000);
|
||||
}, []);
|
||||
|
||||
const PopupCD = () => <Text>Sedang di Proses</Text>;
|
||||
const countD = ({ hours, minutes, seconds, completed }: any) => {
|
||||
if (completed) {
|
||||
return PopupCD();
|
||||
} else {
|
||||
return (
|
||||
<>
|
||||
{minutes}:{seconds}
|
||||
</>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Center h={"80vh"}>
|
||||
<Stack>
|
||||
<Box>
|
||||
<Center>
|
||||
<Stack spacing={"sm"}>
|
||||
<Text>Xendit sedang memproses transaksimu</Text>
|
||||
<Center>
|
||||
<Title order={5}>
|
||||
<Countdown date={Date.now() + 600000} renderer={countD} />
|
||||
</Title>
|
||||
</Center>
|
||||
<Center>
|
||||
<Loader size={"xl"} variant="bars" />
|
||||
</Center>
|
||||
</Stack>
|
||||
</Center>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
UIGlobal_LayoutHeaderTamplate,
|
||||
UIGlobal_LayoutTamplate,
|
||||
} from "@/app_modules/_global/ui";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutEditBeritaInvestasi({
|
||||
@@ -10,14 +11,13 @@ export default function LayoutEditBeritaInvestasi({
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentGlobal_HeaderTamplate title="Edit Berita" />}
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={<UIGlobal_LayoutHeaderTamplate title="Edit Berita" />}
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
import InvestasiCreate from "./create/view";
|
||||
import InvestasiCreateLayout from "./create/layout";
|
||||
import UploadGambarInvestasi from "./upload/view";
|
||||
import LayoutUploadGambarInvestasi from "./upload/layout";
|
||||
import DetailInvestasi from "./detail/view";
|
||||
import LayoutDetailInvestasi from "./detail/layout";
|
||||
import ProsesInvestasi from "./proses_investasi/view";
|
||||
import LayoutProsesInvestasi from "./proses_investasi/layout";
|
||||
import UploadBuktiTransferInvestasi from "./upload_bukti/view";
|
||||
import LayoutBuktiTransferInvestasi from "./upload_bukti/layout";
|
||||
import CountDownTransaksiInvestasi from "./dialog_page/transaksi_saham/view";
|
||||
import LayoutCountDownTransaksiInvestasi from "./dialog_page/transaksi_saham/layout";
|
||||
import PortofolioInvestasi from "./portofolio/view";
|
||||
import LayoutPortofolioInvestasi from "./portofolio/layout";
|
||||
import EditIntroInvestasi from "./edit_intro/view";
|
||||
@@ -28,12 +20,7 @@ import DetailBeritaInvestasi from "./detail_berita/view";
|
||||
import LayoutDetailBeritaInvestasi from "./detail_berita/layout";
|
||||
import BeritaInvestasi from "./berita/view";
|
||||
import LayoutBeritaInvestasi from "./berita/layout";
|
||||
import MetodeTransferInvestasi from "./metode_transfer/view";
|
||||
import LayoutMetodeTransferInvestasi from "./metode_transfer/layout";
|
||||
import TransferInvestasi from "./transfer/view";
|
||||
import LayoutTransferInvestasi from "./transfer/layout";
|
||||
import StatusTransaksiInvestasi from "./status_transaksi/view";
|
||||
import LayoutStatusTransaksiInvestasi from "./status_transaksi/layout";
|
||||
import DialogPageCreateInvestasi from "./dialog_page/create/view";
|
||||
import LayoutDialogPageCreateInvestasi from "./dialog_page/create/layout";
|
||||
import CreateBeritaInvestasi from "./create_berita/view";
|
||||
@@ -52,7 +39,6 @@ import LayoutDetailRejectInvestasi from "./detail_portofolio/reject/layout";
|
||||
import TransaksiInvestasi from "./transaksi/view";
|
||||
import LayoutTransaksiInvestasi from "./transaksi/layout";
|
||||
import StatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/view";
|
||||
import LayoutStatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/layout";
|
||||
import UploadProspektusInvestasi from "./upload_prospektus/view";
|
||||
import LayoutUploadProspektusInvestasi from "./upload_prospektus/layout";
|
||||
import UploadDokumenInvestasi from "./upload_dokumen/view";
|
||||
@@ -65,16 +51,8 @@ import LayoutStatusPesananInvestasi from "./status_pesanan/layout";
|
||||
export {
|
||||
InvestasiCreate,
|
||||
InvestasiCreateLayout,
|
||||
UploadGambarInvestasi,
|
||||
LayoutUploadGambarInvestasi,
|
||||
DetailInvestasi,
|
||||
LayoutDetailInvestasi,
|
||||
ProsesInvestasi,
|
||||
LayoutProsesInvestasi,
|
||||
UploadBuktiTransferInvestasi,
|
||||
LayoutBuktiTransferInvestasi,
|
||||
CountDownTransaksiInvestasi as KonfirmasiBuktiInvestasi,
|
||||
LayoutCountDownTransaksiInvestasi as LayoutKonfirmasiBuktiInvestasi,
|
||||
PortofolioInvestasi,
|
||||
LayoutPortofolioInvestasi,
|
||||
EditIntroInvestasi,
|
||||
@@ -93,12 +71,7 @@ export {
|
||||
LayoutDetailBeritaInvestasi,
|
||||
BeritaInvestasi,
|
||||
LayoutBeritaInvestasi as LayoutBeritaInvestasi,
|
||||
MetodeTransferInvestasi,
|
||||
LayoutMetodeTransferInvestasi,
|
||||
TransferInvestasi,
|
||||
LayoutTransferInvestasi,
|
||||
StatusTransaksiInvestasi,
|
||||
LayoutStatusTransaksiInvestasi,
|
||||
DialogPageCreateInvestasi,
|
||||
LayoutDialogPageCreateInvestasi,
|
||||
CreateBeritaInvestasi,
|
||||
@@ -117,7 +90,6 @@ export {
|
||||
TransaksiInvestasi,
|
||||
LayoutTransaksiInvestasi,
|
||||
StatusTransaksiInvestasi_Gagal,
|
||||
LayoutStatusTransaksiInvestasi_Gagal,
|
||||
UploadProspektusInvestasi,
|
||||
LayoutUploadProspektusInvestasi,
|
||||
UploadDokumenInvestasi,
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { ActionIcon, AppShell } from "@mantine/core";
|
||||
import { IconDotsVertical, IconPencilPlus } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
import getOneInvestasiById from "../fun/get_one_investasi_by_id";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import { useRouter } from "next/navigation";
|
||||
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon } from "@mantine/core";
|
||||
import { IconDotsVertical, IconPencilPlus } from "@tabler/icons-react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutListEditBeritaInvestasi({
|
||||
children,
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutMetodeTransferInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<ComponentGlobal_HeaderTamplate title="Pilih Metode Transfer" />
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,122 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Flex,
|
||||
Paper,
|
||||
Radio,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVESTASI, MODEL_MASTER_BANK } from "../_lib/interface";
|
||||
import funCreateTransaksiInvestasi from "../fun/fun_create_transaksi";
|
||||
import getNorekInvestasi from "../fun/get_norek";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
|
||||
export default function MetodeTransferInvestasi({
|
||||
dataInvestasi,
|
||||
namaBank,
|
||||
authorId,
|
||||
}: {
|
||||
dataInvestasi: MODEL_INVESTASI;
|
||||
namaBank: MODEL_MASTER_BANK[];
|
||||
authorId: string;
|
||||
}) {
|
||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||
const [bank, setBank] = useState(namaBank);
|
||||
const [pilihBank, setPilihBank] = useState<string | null>(null);
|
||||
const router = useRouter();
|
||||
const [transferValue, setTransferValue] = useAtom(gs_TransferValue);
|
||||
|
||||
async function onSubmit() {
|
||||
// Create Transaksi
|
||||
await funCreateTransaksiInvestasi(
|
||||
transferValue as any,
|
||||
investasi.id,
|
||||
authorId
|
||||
).then(async (res) => {
|
||||
if (res.status === 201) {
|
||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||
router.push(RouterInvestasi_OLD.transfer + `${res.res?.id}`);
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function onSelect(id: string) {
|
||||
await getNorekInvestasi(id).then((res) => {
|
||||
if (res.status === 200) {
|
||||
setTransferValue({
|
||||
...transferValue,
|
||||
namaBank: res.res?.namaBank as any,
|
||||
nomorRekening: res.res?.norek as any,
|
||||
});
|
||||
} else {
|
||||
ComponentGlobal_NotifikasiGagal(res.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(transferValue, null, 2)}</pre> */}
|
||||
{/* Box judul */}
|
||||
<Paper bg={"gray"} p={"xs"} shadow="lg" mb={"md"}>
|
||||
<Title order={5}>{investasi.title}</Title>
|
||||
<Text fz={"sm"}>Total Transfer : Rp.{transferValue.totalTransfer}</Text>
|
||||
</Paper>
|
||||
|
||||
{/* Metode transfer */}
|
||||
<Radio.Group
|
||||
name="Metode Trf"
|
||||
label="Metode Transfer"
|
||||
description="Pilih salah satu bank"
|
||||
withAsterisk
|
||||
my={"md"}
|
||||
onChange={(val) => {
|
||||
setPilihBank(val);
|
||||
onSelect(val);
|
||||
}}
|
||||
value={"" + pilihBank}
|
||||
>
|
||||
<Flex direction={"column"} gap={"lg"} mt="xs">
|
||||
{bank.map((e) => (
|
||||
<Box key={e.id}>
|
||||
<Radio value={e.id} label={e.namaBank} />
|
||||
</Box>
|
||||
))}
|
||||
</Flex>
|
||||
</Radio.Group>
|
||||
|
||||
<Center>
|
||||
{pilihBank === null ? (
|
||||
<Button my={"md"} w={300} disabled radius={50}>
|
||||
Pilih Bank
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
my={"md"}
|
||||
w={300}
|
||||
bg={Warna.biru}
|
||||
radius={50}
|
||||
onClick={() => {
|
||||
onSubmit();
|
||||
}}
|
||||
>
|
||||
Lanjutkan Untuk Transfer
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,14 +1,6 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import {
|
||||
AppShell,
|
||||
Box,
|
||||
Button,
|
||||
Group,
|
||||
Header,
|
||||
ScrollArea,
|
||||
} from "@mantine/core";
|
||||
import React, { useState } from "react";
|
||||
|
||||
export default function LayoutPortofolioInvestasi({
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutProsesInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={<ComponentGlobal_HeaderTamplate title="Proses Investasi" />}
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
Group,
|
||||
NumberInput,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useFocusTrap } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
import { MODEL_INVESTASI } from "../_lib/interface";
|
||||
import { gs_TransferValue } from "../g_state";
|
||||
|
||||
export default function ProsesInvestasi({
|
||||
dataInvestasi,
|
||||
}: {
|
||||
dataInvestasi: MODEL_INVESTASI;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const focusTrapRef = useFocusTrap();
|
||||
|
||||
const [jumlah, setJumlah] = useState(0);
|
||||
const [hargaLembar, setHargaLembar] = useState<number>(
|
||||
Number(dataInvestasi.hargaLembar)
|
||||
);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [investasi, setInvestasi] = useState(dataInvestasi);
|
||||
const [maxPembelian, setMaxPembelian] = useState<number>(
|
||||
Number(dataInvestasi.totalLembar)
|
||||
);
|
||||
const [transferValue, setTransferValue] = useAtom(gs_TransferValue);
|
||||
|
||||
// async function onBeli() {
|
||||
// setTransferValue({
|
||||
// ...transferValue,
|
||||
// totalTransfer: total as any,
|
||||
// lembarTerbeli: jumlah as any,
|
||||
// });
|
||||
// router.push(RouterInvestasi.metode_transfer + `${investasi.id}`);
|
||||
// }
|
||||
const date = new Date();
|
||||
const randomId = date.getTime();
|
||||
|
||||
async function onProses() {
|
||||
const body = {
|
||||
transaction_details: {
|
||||
order_id: "hipmi_" + `${randomId}`,
|
||||
gross_amount: total,
|
||||
},
|
||||
item_details: [
|
||||
{
|
||||
id: "item_" + `${randomId}`,
|
||||
name: investasi.title,
|
||||
price: Number(investasi.hargaLembar),
|
||||
quantity: transferValue.lembarTerbeli,
|
||||
merchant_name: "Transaksi Saham",
|
||||
},
|
||||
],
|
||||
customer_details: {
|
||||
first_name: "",
|
||||
email: "test@midtrans.com",
|
||||
phone: "+628123456",
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
||||
<Box px={"md"}>
|
||||
{/* Sisa Lembar Saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Sisa Lembar Saham</Text>
|
||||
<Text fz={23}>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.totalLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
{/* Harga perlembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Text>Harga Perlembar</Text>
|
||||
<Text fz={23}>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumFractionDigits: 10,
|
||||
}).format(+investasi.hargaLembar)}{" "}
|
||||
</Text>
|
||||
</Group>
|
||||
|
||||
{/* Lembar saham */}
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Jumlah Pembelian</Text>
|
||||
<Text c={"orange"} fs={"italic"} fz={10}>
|
||||
minimal pembelian 10 lembar
|
||||
</Text>
|
||||
{/* <Text c={"red"} fs={"italic"} fz={10}>
|
||||
maximal pembelian {maxPembelian} lembar
|
||||
</Text> */}
|
||||
</Box>
|
||||
<NumberInput
|
||||
type="number"
|
||||
ref={focusTrapRef}
|
||||
w={100}
|
||||
max={maxPembelian}
|
||||
onChange={(val: number) => {
|
||||
setTotal(val * hargaLembar);
|
||||
setJumlah(val);
|
||||
// console.log(val);
|
||||
}}
|
||||
/>
|
||||
</Group>
|
||||
|
||||
<Divider my={"lg"} />
|
||||
|
||||
<Group position="apart" mb={"md"}>
|
||||
<Box>
|
||||
<Text>Total Harga</Text>
|
||||
</Box>
|
||||
<Text fz={25}>Rp.{total} </Text>
|
||||
</Group>
|
||||
|
||||
<Center>
|
||||
{jumlah < 10 ? (
|
||||
<Button w={350} radius={50} bg={"gray"} disabled>
|
||||
Beli Saham
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
w={350}
|
||||
radius={50}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
// onBeli();
|
||||
onProses();
|
||||
}}
|
||||
>
|
||||
Beli Saham
|
||||
</Button>
|
||||
)}
|
||||
</Center>
|
||||
</Box>
|
||||
|
||||
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,16 +1,11 @@
|
||||
"use client";
|
||||
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { ActionIcon, AppShell, Box, Group, Header, Text } from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import React, { useState } from "react";
|
||||
import { gs_midtrans_snap } from "../g_state";
|
||||
import { IconArrowLeft } from "@tabler/icons-react";
|
||||
import { title } from "process";
|
||||
import { useRouter } from "next/navigation";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { gs_midtrans_snap } from "../g_state";
|
||||
|
||||
export default function LayoutProsesTransaksiInvestasi({
|
||||
children,
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { ActionIcon, AppShell, Group, Header, Text } from "@mantine/core";
|
||||
import { IconArrowLeft } from "@tabler/icons-react";
|
||||
import router from "next/router";
|
||||
import { title } from "process";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutStatusPesananInvestasi({
|
||||
@@ -19,12 +13,10 @@ export default function LayoutStatusPesananInvestasi({
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<UIGlobal_LayoutHeaderTamplate title="Status Transaksi" hideButtonLeft/>
|
||||
// <Header height={50}>
|
||||
// <Group h={50} position="center" px={"md"}>
|
||||
// <Text>Status Transaksi</Text>
|
||||
// </Group>
|
||||
// </Header>
|
||||
<UIGlobal_LayoutHeaderTamplate
|
||||
title="Status Transaksi"
|
||||
hideButtonLeft
|
||||
/>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import {
|
||||
AppShell,
|
||||
Header,
|
||||
Group,
|
||||
CloseButton,
|
||||
ActionIcon,
|
||||
Footer,
|
||||
Center,
|
||||
Button,
|
||||
Text,
|
||||
Center,
|
||||
CloseButton,
|
||||
Footer,
|
||||
Group,
|
||||
Header,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { gs_investas_menu } from "../../g_state";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
|
||||
export default function LayoutStatusTransaksiInvestasi_Gagal({
|
||||
children,
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Button,
|
||||
Center,
|
||||
CloseButton,
|
||||
Footer,
|
||||
Group,
|
||||
Header,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { gs_investas_menu } from "../g_state";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
|
||||
export default function LayoutStatusTransaksiInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
|
||||
return (
|
||||
<>
|
||||
<UIGlobal_LayoutTamplate
|
||||
header={
|
||||
<Header height={50}>
|
||||
<Group position="apart" align="center" h={50} px={"md"}>
|
||||
<CloseButton
|
||||
size={"md"}
|
||||
onClick={() => {
|
||||
router.push(RouterInvestasi_OLD.main_transaksi);
|
||||
setHotMenu(3);
|
||||
}}
|
||||
/>
|
||||
<Text>Status Transaksi</Text>
|
||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
footer={
|
||||
<Footer height={70} sx={{ borderStyle: "none" }}>
|
||||
<Center>
|
||||
<Button
|
||||
w={300}
|
||||
radius={50}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
router.push(RouterInvestasi_OLD.main_investasi), setHotMenu(2);
|
||||
}}
|
||||
>
|
||||
Kembali Ke Investasi
|
||||
</Button>
|
||||
</Center>
|
||||
</Footer>
|
||||
}
|
||||
>
|
||||
{children}
|
||||
</UIGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell, Title } from "@mantine/core";
|
||||
import { Title } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutTransaksiInvestasi({
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import {
|
||||
ActionIcon,
|
||||
AppShell,
|
||||
Button,
|
||||
Center,
|
||||
CloseButton,
|
||||
Footer,
|
||||
Group,
|
||||
Header,
|
||||
Text,
|
||||
} from "@mantine/core";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import React from "react";
|
||||
import { gs_investas_menu } from "../g_state";
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
|
||||
export default function LayoutTransferInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [hotMenu, setHotMenu] = useAtom(gs_investas_menu);
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate
|
||||
header={
|
||||
<Header height={50}>
|
||||
<Group position="apart" h={50} px={"md"}>
|
||||
<CloseButton
|
||||
size={"md"}
|
||||
onClick={() => {
|
||||
router.push(RouterInvestasi_OLD.main_transaksi), setHotMenu(3);
|
||||
}}
|
||||
/>
|
||||
<Text>Transfer</Text>
|
||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||
</Group>
|
||||
</Header>
|
||||
}
|
||||
// footer={
|
||||
// <Footer height={70} sx={{ borderStyle: "none" }}>
|
||||
|
||||
// </Footer>
|
||||
// }
|
||||
>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,240 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Avatar,
|
||||
Box,
|
||||
Button,
|
||||
Center,
|
||||
CopyButton,
|
||||
Divider,
|
||||
FileButton,
|
||||
Flex,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||
import moment from "moment";
|
||||
import { redirect, useRouter } from "next/navigation";
|
||||
|
||||
import { useState } from "react";
|
||||
import Countdown from "react-countdown";
|
||||
import {
|
||||
MODEL_INVESTASI,
|
||||
MODEL_Transaksi_Investasi,
|
||||
} from "../_lib/interface";
|
||||
import { RouterInvestasi_OLD } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { useAtom } from "jotai";
|
||||
import { gs_TransferValue, gs_investas_menu } from "../g_state";
|
||||
import funGantiStatusTransaksi_Investasi from "../fun/fun_ganti_status_transaksi";
|
||||
|
||||
export default function TransferInvestasi({
|
||||
dataTransaksi,
|
||||
}: {
|
||||
dataTransaksi: MODEL_Transaksi_Investasi;
|
||||
}) {
|
||||
const router = useRouter();
|
||||
const [transaksi, setTransaksi] = useState(dataTransaksi);
|
||||
const [countDown, setCountDown] = useState<number | any>({
|
||||
jam: null,
|
||||
menit: null,
|
||||
detik: null,
|
||||
});
|
||||
|
||||
// useShallowEffect(() => {
|
||||
// const inter = apa_kabar("2023-11-18");
|
||||
// return () => clearInterval(inter);
|
||||
// }, []);
|
||||
// function apa_kabar(date: string) {
|
||||
// let d = moment.duration(moment(date).diff(new Date()));
|
||||
// const inter = setInterval(() => {
|
||||
// d = moment.duration(+d - 1000, "milliseconds");
|
||||
|
||||
// console.log(d.days(), "=", d.hours(), ":", d.minutes(), ":", d.seconds());
|
||||
// }, 1000);
|
||||
// return inter;
|
||||
// }
|
||||
|
||||
// useShallowEffect(() => {
|
||||
// const mulai = moment(transaksi.createdAt).format();
|
||||
// const selesai = moment(transaksi.createdAt).add(1, "days").format();
|
||||
// const timer = funCountDown(mulai as any, selesai as any);
|
||||
|
||||
// return () => clearInterval(timer);
|
||||
// }, []);
|
||||
|
||||
// functionbaru ==========================//
|
||||
const selesai = moment(transaksi.createdAt).add(1, "days").format();
|
||||
let durasi = moment.duration(moment(selesai).diff(new Date()));
|
||||
const interval = useInterval(() => {
|
||||
durasi = moment.duration(+durasi - 1000, "milliseconds");
|
||||
if (durasi.hours() <= 0 && durasi.minutes() <= 0 && durasi.seconds() <= 0) {
|
||||
funGantiStatusTransaksi_Investasi(transaksi.id, "4").then((res) => {
|
||||
if (res.status === 200) {
|
||||
router.push(
|
||||
RouterInvestasi_OLD.status_transaksi_gagal + `${transaksi.id}`
|
||||
);
|
||||
interval.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
setCountDown({
|
||||
...countDown,
|
||||
jam: durasi.hours(),
|
||||
menit: durasi.minutes(),
|
||||
detik: durasi.seconds(),
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
useShallowEffect(() => {
|
||||
interval.start();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(transaksi, null,2)}</pre> */}
|
||||
{/* {countDown.jam} */}
|
||||
<Stack spacing={"lg"}>
|
||||
<Stack spacing={0} mb={"xs"}>
|
||||
<Text fz={12}>Mohon transfer untuk diteruskan ke :</Text>
|
||||
<Group align="center">
|
||||
<Title order={5}>{transaksi.Investasi.title}</Title>
|
||||
</Group>
|
||||
<Divider my={"md"} />
|
||||
<Grid>
|
||||
<Grid.Col span={4}>
|
||||
<Text fz={"xs"}>Transfer sebelum</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={5}>
|
||||
<Text fz={"xs"} fw={"bold"}>
|
||||
{moment(transaksi.createdAt).format("lll")}
|
||||
</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={3} fz={"xs"}>
|
||||
<Paper bg={"red"} px={"xs"}>
|
||||
<Center>
|
||||
{countDown.jam <= 0 &&
|
||||
countDown.menit <= 0 &&
|
||||
countDown.detik <= 0 ? (
|
||||
<Flex align={"center"} justify={"center"}>
|
||||
<Text fz={9}>Waktu Habis</Text>
|
||||
</Flex>
|
||||
) : (
|
||||
<Box>
|
||||
{countDown.jam}:{countDown.menit}:{countDown.detik}
|
||||
</Box>
|
||||
)}
|
||||
</Center>
|
||||
</Paper>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Stack>
|
||||
|
||||
<Stack spacing={"xl"}>
|
||||
{/* Nama Rekening */}
|
||||
<Stack spacing={5}>
|
||||
<Group>
|
||||
<Avatar size={"md"} variant="filled" />
|
||||
<Stack spacing={0}>
|
||||
<Text>Bank {transaksi.namaBank}</Text>
|
||||
<Text>PT. Xendit Jakarta</Text>
|
||||
</Stack>
|
||||
</Group>
|
||||
<Paper
|
||||
bg={"gray.3"}
|
||||
sx={{ alignContent: "center" }}
|
||||
p={"sm"}
|
||||
radius={10}
|
||||
>
|
||||
<Grid align="center">
|
||||
<Grid.Col span={8}>
|
||||
<Text fw={"bold"}>{transaksi.nomorRekening}</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4}>
|
||||
<Center>
|
||||
<CopyButton value={transaksi.nomorRekening}>
|
||||
{({ copied, copy }) => (
|
||||
<Button
|
||||
variant="filled"
|
||||
radius={50}
|
||||
compact
|
||||
bg={copied ? "teal" : "gray"}
|
||||
color="gray"
|
||||
onClick={copy}
|
||||
>
|
||||
{copied ? "Tersalin" : "Salin"}
|
||||
</Button>
|
||||
)}
|
||||
</CopyButton>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
</Stack>
|
||||
|
||||
{/* Nomor rekening */}
|
||||
<Stack spacing={5}>
|
||||
<Text>Total Transfer</Text>
|
||||
<Paper
|
||||
bg={"gray.3"}
|
||||
sx={{ alignContent: "center" }}
|
||||
p={"sm"}
|
||||
radius={10}
|
||||
>
|
||||
<Grid align="center">
|
||||
<Grid.Col span={8}>
|
||||
{/* <Text fw={"bold"}>Rp. {transaksi.totalTransfer}</Text> */}
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4}>
|
||||
<Center>
|
||||
{/* <CopyButton value={transaksi.totalTransfer}>
|
||||
{({ copied, copy }) => (
|
||||
<Button
|
||||
variant="filled"
|
||||
radius={50}
|
||||
compact
|
||||
bg={copied ? "teal" : "gray"}
|
||||
color="gray"
|
||||
onClick={copy}
|
||||
>
|
||||
{copied ? "Tersalin" : "Salin"}
|
||||
</Button>
|
||||
)}
|
||||
</CopyButton> */}
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
<Group spacing={5}>
|
||||
<IconAlertTriangle color="orange" size={10} />
|
||||
<Text fz={"sm"}>Pastikan jumlahnya benar</Text>
|
||||
</Group>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</Stack>
|
||||
|
||||
{/* Tombol Sudah Transfer */}
|
||||
<Center mt={100}>
|
||||
<Button
|
||||
radius={50}
|
||||
w={300}
|
||||
bg={Warna.biru}
|
||||
onClick={() => {
|
||||
router.push(RouterInvestasi_OLD.dialog_transaksi);
|
||||
// setHotMenu(1);
|
||||
// router.push(RouterInvestasi.status_transaksi);
|
||||
}}
|
||||
>
|
||||
Sudah Transfer
|
||||
</Button>
|
||||
</Center>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutUploadGambarInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate header={<ComponentGlobal_HeaderTamplate title="Upload Gambar Investasi" />}>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function UploadGambarInvestasi() {
|
||||
const [img, setImg] = useState<any | null>();
|
||||
return (
|
||||
<>
|
||||
<Group position="center">
|
||||
<FileButton
|
||||
onChange={async (files : any) => {
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array( await files.arrayBuffer())])
|
||||
);
|
||||
setImg(buffer);
|
||||
}}
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => <Button {...props}>Upload image</Button>}
|
||||
</FileButton>
|
||||
</Group>
|
||||
|
||||
{img && <Image alt="" src={img}/>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutBuktiTransferInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppComponentGlobal_LayoutTamplate header={<ComponentGlobal_HeaderTamplate title="Upload Bukti Transfer" />}>
|
||||
{children}
|
||||
</AppComponentGlobal_LayoutTamplate>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
FileButton,
|
||||
Grid,
|
||||
Group,
|
||||
Image,
|
||||
Text
|
||||
} from "@mantine/core";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function UploadBuktiTransferInvestasi() {
|
||||
const router = useRouter();
|
||||
const [fl, setFl] = useState<File | null>(null);
|
||||
const [img, setImg] = useState<any | null>(null);
|
||||
const [total, setTotal] = useState<any | null>(null);
|
||||
const [bank, setBank] = useState<any | null>(null);
|
||||
|
||||
useShallowEffect(() => {
|
||||
if (typeof window !== undefined) {
|
||||
const totalHarga = localStorage.getItem("total_harga");
|
||||
const pilihBank = localStorage.getItem("bank");
|
||||
setTotal(totalHarga);
|
||||
setBank(pilihBank);
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Nama Rekening */}
|
||||
<Grid align="center">
|
||||
<Grid.Col span={5}>
|
||||
<Text>Nama Rekening</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>Xendit</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
{/* Nomor rekening */}
|
||||
<Grid align="center">
|
||||
<Grid.Col span={5}>
|
||||
<Text>Nomor Rekening</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>{bank}</Text>
|
||||
</Grid.Col>
|
||||
{/* <Grid.Col span={"auto"}>
|
||||
<CopyButton value="908765467897654567">
|
||||
{({ copied, copy }) => (
|
||||
<Button
|
||||
compact
|
||||
radius={50}
|
||||
color={copied ? "teal" : "indigo"}
|
||||
onClick={copy}
|
||||
>
|
||||
{copied ? "Copied url" : "Copy url"}
|
||||
</Button>
|
||||
)}
|
||||
</CopyButton>
|
||||
</Grid.Col> */}
|
||||
</Grid>
|
||||
|
||||
{/* Total Bayar */}
|
||||
<Grid align="center">
|
||||
<Grid.Col span={5}>
|
||||
<Text>Total Bayar</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={7}>
|
||||
<Text fw={"bold"}>Rp. {total}</Text>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
{/* Upload */}
|
||||
<Group position="center" mt="lg" mb={"md"}>
|
||||
<FileButton
|
||||
onChange={async (files: any) => {
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||
);
|
||||
setImg(buffer);
|
||||
setFl(files);
|
||||
}}
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => (
|
||||
<Button
|
||||
{...props}
|
||||
// w={350}
|
||||
compact
|
||||
radius={50}
|
||||
bg={Warna.biru}
|
||||
// onClick={() => router.push("/dev/investasi/upload")}
|
||||
>
|
||||
Upload
|
||||
</Button>
|
||||
)}
|
||||
</FileButton>
|
||||
</Group>
|
||||
<AspectRatio ratio={16 / 9} mb={"lg"}>
|
||||
{img ? (
|
||||
<Image alt="" src={img} />
|
||||
) : (
|
||||
<Image alt="" src={"/aset/no-img.png"} />
|
||||
)}
|
||||
</AspectRatio>
|
||||
|
||||
{/* <Center>
|
||||
{img === null ? (
|
||||
<Button
|
||||
disabled
|
||||
w={350}
|
||||
radius={50}
|
||||
bg={"gray"}
|
||||
onClick={() => toast("Masukan Bukti Transfer")}
|
||||
>
|
||||
Selesai
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
w={350}
|
||||
radius={50}
|
||||
bg={"blue"}
|
||||
onClick={() => router.push("/dev/investasi/konfirmasi")}
|
||||
>
|
||||
Selesai
|
||||
</Button>
|
||||
)}
|
||||
</Center> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutUploadDokumenInvestasi({
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutUploadProspektusInvestasi({
|
||||
|
||||
Reference in New Issue
Block a user