# fix
## Deskripsi: - Perubahan tampilan notifikasi - Pin map sesuai logo - Pin map bisa custom ### No Issue
This commit is contained in:
32
src/app/api/map/foto/[id]/route.ts
Normal file
32
src/app/api/map/foto/[id]/route.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import prisma from "@/app/lib/prisma";
|
||||
import fs from "fs";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: { id: string } }
|
||||
) {
|
||||
const get = await prisma.images.findUnique({
|
||||
where: {
|
||||
id: params.id,
|
||||
},
|
||||
select: {
|
||||
url: true,
|
||||
},
|
||||
});
|
||||
|
||||
if (!fs.existsSync(`./public/map/foto/${get?.url}`)) {
|
||||
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
|
||||
return new NextResponse(notFile, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
const file = fs.readFileSync(`./public/map/foto/${get?.url}`);
|
||||
return new NextResponse(file, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -15,7 +15,7 @@ export async function GET(
|
||||
},
|
||||
});
|
||||
|
||||
if (!fs.existsSync(`./public/map/${get?.url}`)) {
|
||||
if (!fs.existsSync(`./public/map/pin/${get?.url}`)) {
|
||||
const notFile = fs.readFileSync("./public/aset/global/no_img.png");
|
||||
return new NextResponse(notFile, {
|
||||
headers: {
|
||||
@@ -23,7 +23,7 @@ export async function GET(
|
||||
},
|
||||
});
|
||||
}
|
||||
const file = fs.readFileSync(`./public/map/${get?.url}`);
|
||||
const file = fs.readFileSync(`./public/map/pin/${get?.url}`);
|
||||
return new NextResponse(file, {
|
||||
headers: {
|
||||
"Content-Type": "image/png",
|
||||
50
src/app/contoh/page.tsx
Normal file
50
src/app/contoh/page.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
"use client";
|
||||
import { ComponentNotifikasi_CardSkeleton } from "@/app_modules/notifikasi/component";
|
||||
import { Box, Button, Flex, Paper, Stack, Title } from "@mantine/core";
|
||||
|
||||
export default function Page() {
|
||||
|
||||
return<>
|
||||
<ComponentNotifikasi_CardSkeleton/>
|
||||
</>
|
||||
|
||||
|
||||
return (
|
||||
<Stack
|
||||
bg={"gray"}
|
||||
h={"100vh"}
|
||||
style={{
|
||||
position: "relative",
|
||||
width: "100%",
|
||||
overflow: "scroll",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
p={"md"}
|
||||
style={{
|
||||
display: "flex",
|
||||
// width: "700px",
|
||||
gap: "20px",
|
||||
position: "relative",
|
||||
overflowX: "scroll",
|
||||
// scrollSnapType: "x",
|
||||
// scrollbarGutter: "unset",
|
||||
scrollbarWidth: "none",
|
||||
backgroundColor:"red"
|
||||
}}
|
||||
>
|
||||
<Flex gap={"md"} bg={"cyan"}>
|
||||
{Array.from(new Array(10), (_, i) => (
|
||||
<Paper component={Button} w={"200px"} px={"md"} key={i}>
|
||||
Contoh
|
||||
</Paper>
|
||||
))}
|
||||
</Flex>
|
||||
</Box>
|
||||
|
||||
<Stack>
|
||||
<Title>Ini Bagian Yang Gak Ikut</Title>
|
||||
</Stack>
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
12
src/app/dev/investasi/transaksi/invoice/[id]/page.tsx
Normal file
12
src/app/dev/investasi/transaksi/invoice/[id]/page.tsx
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Investasi_UiInvoice } from "@/app_modules/investasi/_ui";
|
||||
|
||||
export default function Page({ params }: { params: { id: string } }) {
|
||||
const invoiceId = params.id;
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Investasi_UiInvoice />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { investasi_funGetOneInvestasiById } from "@/app_modules/investasi/_fun";
|
||||
import { Investasi_UiProsesTransaksi } from "@/app_modules/investasi/_ui";
|
||||
import { Investasi_UiProsesPembelian } from "@/app_modules/investasi/_ui";
|
||||
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const investasiId = params.id;
|
||||
@@ -7,7 +8,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Investasi_UiProsesTransaksi dataInvestasi={dataInvestasi} />
|
||||
<Investasi_UiProsesPembelian dataInvestasi={dataInvestasi} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Investasi_UiProsesTransaksi } from "@/app_modules/investasi/_ui";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const invoiceId = params.id;
|
||||
|
||||
return (
|
||||
<>
|
||||
<Investasi_UiProsesTransaksi />
|
||||
</>
|
||||
);
|
||||
}
|
||||
16
src/app/dev/map/custom-pin/[id]/page.tsx
Normal file
16
src/app/dev/map/custom-pin/[id]/page.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { map_funGetOneBusinessMapByPortofolioId } from "@/app_modules/map/fun/get/fun_get_one_by_portofolio_id";
|
||||
import { Map_CustomPin } from "@/app_modules/map/view";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const portofolioId = params.id;
|
||||
const dataMap = await map_funGetOneBusinessMapByPortofolioId({
|
||||
portofolioId: portofolioId,
|
||||
});
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Map_CustomPin dataMap={dataMap} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import { map_funGetOneByPortofolioId } from "@/app_modules/map/fun/get/fun_get_one_by_portofolio_id";
|
||||
import { map_funGetOneBusinessMapByPortofolioId } from "@/app_modules/map/fun/get/fun_get_one_by_portofolio_id";
|
||||
import { Map_EditPin } from "@/app_modules/map/view";
|
||||
|
||||
export default async function Page({ params }: { params: { id: string } }) {
|
||||
const portofolioId = params.id;
|
||||
const dataMap = await map_funGetOneByPortofolioId({portofolioId: portofolioId})
|
||||
const dataMap = await map_funGetOneBusinessMapByPortofolioId({portofolioId: portofolioId})
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||
import { map_funGetAllMap } from "@/app_modules/map/fun/get/fun_get_all_map";
|
||||
import { Map_View } from "@/app_modules/map/view";
|
||||
|
||||
const mapboxToken = process.env.MAPBOX_TOKEN!;
|
||||
export default async function Page() {
|
||||
if (!mapboxToken)
|
||||
return <ComponentGlobal_IsEmptyData text="Mapbox token not found" />;
|
||||
const dataMap = await map_funGetAllMap();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Map_View mapboxToken={mapboxToken} />
|
||||
<Map_View mapboxToken={mapboxToken} dataMap={dataMap} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
import { Notifikasi_MainView } from "@/app_modules/notifikasi";
|
||||
import { ComponentNotifikasi_CardSkeleton } from "@/app_modules/notifikasi/component";
|
||||
import { notifikasi_funGetKategoriApp } from "@/app_modules/notifikasi/fun/get/fun_get_kategori_app";
|
||||
import notifikasi_getByUserId from "@/app_modules/notifikasi/fun/get/get_notifiaksi_by_id";
|
||||
import { Notifikasi_MainView } from "@/app_modules/notifikasi/view";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export default async function Page() {
|
||||
const listNotifikasi = await notifikasi_getByUserId({ page: 1 });
|
||||
const listNotifikasi = await notifikasi_getByUserId({
|
||||
page: 1,
|
||||
kategoriApp: "Semua",
|
||||
});
|
||||
const masterKategori = await notifikasi_funGetKategoriApp();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Notifikasi_MainView listNotifikasi={listNotifikasi as any} />
|
||||
<Suspense fallback={<ComponentNotifikasi_CardSkeleton />}>
|
||||
<Notifikasi_MainView
|
||||
listNotifikasi={listNotifikasi as any}
|
||||
masterKategori={masterKategori}
|
||||
/>
|
||||
</Suspense>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ export const NEW_RouterInvestasi = {
|
||||
// Transaksi
|
||||
pembelian: "/dev/investasi/transaksi/pembelian/",
|
||||
metode_pembayaran: "/dev/investasi/transaksi/metode-pembayaran/",
|
||||
invoice: "/dev/investasi/transaksi/invoice/",
|
||||
proses_transaksi: "/dev/investasi/transaksi/proses-transaksi/",
|
||||
|
||||
// file view
|
||||
file_view: "/dev/investasi/file-view/",
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
export const RouterMap = {
|
||||
// api
|
||||
api_foto: "/api/map/",
|
||||
api_foto: "/api/map/foto/",
|
||||
api_custom_pin: "/api/map/pin/",
|
||||
|
||||
// main
|
||||
splash: "/dev/map/splash",
|
||||
main_view: "/dev/map/main",
|
||||
create: "/dev/map/create/",
|
||||
edit: "/dev/map/edit/",
|
||||
custom_pin: "/dev/map/custom-pin/",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user