Fix: admin map

Deskripsi:
- Fix map image
## No Issue
This commit is contained in:
2024-11-05 17:37:05 +08:00
parent 3aea046046
commit 8cedf7db61
83 changed files with 32 additions and 94 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "hipmi", "name": "hipmi",
"version": "1.0.11", "version": "1.0.12",
"private": true, "private": true,
"prisma": { "prisma": {
"seed": "npx tsx prisma/seed.ts" "seed": "npx tsx prisma/seed.ts"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -1 +0,0 @@
// Image for file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1 +0,0 @@
// Image for investasi

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -1 +0,0 @@
# Test

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,12 +1,11 @@
import { Admin_UiImagePreview } from "@/app_modules/admin/_admin_global"; import { Admin_ComponentPreviewImageAdmin } from "@/app_modules/admin/_admin_global/comp_preview_image_admin";
import React from "react";
async function Page({ params }: { params: { id: string } }) { async function Page({ params }: { params: { id: string } }) {
const fileId = params.id; const fileId = params.id;
return ( return (
<> <>
<Admin_UiImagePreview fileId={fileId} /> <Admin_ComponentPreviewImageAdmin fileId={fileId} />
</> </>
); );
} }

View File

@@ -1,6 +1,3 @@
import { funCheckToken } from "@/app_modules/_global/fun/get";
import { redirect } from "next/navigation";
import { RouterAuth } from "../lib/router_hipmi/router_auth";
import { CheckCookies_UiLayout } from "@/app_modules/check_cookies"; import { CheckCookies_UiLayout } from "@/app_modules/check_cookies";
export default async function Layout({ export default async function Layout({

View File

@@ -1,5 +0,0 @@
.lebar-full {
width: 100%;
/* padding: 30px; */
background-color: aqua;
}

View File

@@ -56,7 +56,6 @@ export function Admin_ComponentLoadImageLandscape({
<Image <Image
onClick={() => { onClick={() => {
setLoading(true); setLoading(true);
router.push(RouterAdminGlobal.preview_image({ id: fileId }), { router.push(RouterAdminGlobal.preview_image({ id: fileId }), {
scroll: false, scroll: false,
}); });

View File

@@ -1,16 +1,17 @@
"use client"; "use client";
import { Box, Center, Image, ScrollArea, Skeleton, Stack, Text } from "@mantine/core";
import AdminGlobal_ComponentBackButton from "./back_button";
import { APIs, pathAssetImage } from "@/app/lib"; import { APIs, pathAssetImage } from "@/app/lib";
import { Box, Center, Image, ScrollArea, Skeleton, Stack } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks"; import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react"; import { useState } from "react";
import AdminGlobal_ComponentBackButton from "../back_button";
export function Admin_UiImagePreview({ fileId }: { fileId: string }) { export function Admin_ComponentPreviewImageAdmin({
const router = useRouter(); fileId,
}: {
fileId: string;
}) {
const [isImage, setIsImage] = useState<boolean | null>(null); const [isImage, setIsImage] = useState<boolean | null>(null);
const [isLoading, setIsLoading] = useState(false);
const url = APIs.GET({ fileId: fileId }); const url = APIs.GET({ fileId: fileId });
@@ -29,14 +30,16 @@ export function Admin_UiImagePreview({ fileId }: { fileId: string }) {
console.log(error); console.log(error);
} }
} }
return ( return (
<> <>
<Stack> <Stack>
<AdminGlobal_ComponentBackButton /> <AdminGlobal_ComponentBackButton />
<Box style={{ zIndex: 0 }} h={"90vh"} pos={"static"} px={"lg"}> <Box style={{ zIndex: 0 }} h={"90vh"} pos={"static"} px={"lg"}>
{isImage === null ? ( {isImage === null ? (
<Skeleton height={200} radius={"sm"} /> <Center>
<Skeleton height={300} w={200} radius={"sm"} />
</Center>
) : isImage ? ( ) : isImage ? (
<ScrollArea h={"100%"}> <ScrollArea h={"100%"}>
<Center> <Center>

View File

@@ -1,7 +1,5 @@
import { Admin_ComponentLoadImageLandscape } from "./_component/comp_admin_load_image"; import { Admin_ComponentLoadImageLandscape } from "./_component/comp_admin_load_image";
import { Admin_ComponentSkeletonNavbar } from "./_component/comp_admin_skeleton_navbar"; import { Admin_ComponentSkeletonNavbar } from "./_component/comp_admin_skeleton_navbar";
import { Admin_UiImagePreview } from "./_ui/ui_admin_image_preview";
export { Admin_ComponentLoadImageLandscape }; export { Admin_ComponentLoadImageLandscape, Admin_ComponentSkeletonNavbar };
export { Admin_UiImagePreview };
export { Admin_ComponentSkeletonNavbar };

View File

@@ -1,16 +1,7 @@
import { APIs } from "@/app/lib"; "use client";
import { MODEL_MAP } from "@/app_modules/map/lib/interface"; import { MODEL_MAP } from "@/app_modules/map/lib/interface";
import { import { Box, Button, Center, Grid, Stack, Text } from "@mantine/core";
AspectRatio,
Box,
Button,
Center,
Grid,
Image,
Stack,
Text,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { import {
IconBuildingSkyscraper, IconBuildingSkyscraper,
IconListDetails, IconListDetails,
@@ -18,42 +9,17 @@ import {
IconPhoneCall, IconPhoneCall,
IconPinned, IconPinned,
} from "@tabler/icons-react"; } from "@tabler/icons-react";
import { useState } from "react";
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global"; import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
export function ComponentAdminMap_DetailDataDrawer({ export function ComponentAdminMap_DetailDataDrawer({
mapId, data,
}: { }: {
mapId: string; data: MODEL_MAP;
}) { }) {
const [data, setData] = useState<MODEL_MAP>();
useShallowEffect(() => {
onLoadMap(mapId);
}, [mapId]);
async function onLoadMap(mapId: string) {
try {
const res = await adminMap_funGetOneById({ mapId: mapId });
setData(res as any);
} catch (error) {
console.log(error);
}
}
return ( return (
<> <>
<Stack> <Stack>
<Admin_ComponentLoadImageLandscape fileId={data?.imageId as any}/> <Admin_ComponentLoadImageLandscape fileId={data?.imageId as any} />
{/* <AspectRatio ratio={1 / 1} mah={300}>
<Image
radius={"md"}
width={300}
alt="Photo"
src={APIs.GET({ fileId: data?.imageId as string })}
/>
</AspectRatio> */}
<Box> <Box>
<Grid> <Grid>
@@ -97,7 +63,6 @@ export function ComponentAdminMap_DetailDataDrawer({
</Grid.Col> </Grid.Col>
</Grid> </Grid>
</Box> </Box>
{data ? ( {data ? (
<Center> <Center>
<Button <Button

View File

@@ -1,11 +1,7 @@
"use client"; "use client";
import { MODEL_MAP } from "@/app_modules/map/lib/interface"; import { MODEL_MAP } from "@/app_modules/map/lib/interface";
import { import { Drawer, Group, Text } from "@mantine/core";
Drawer,
Group,
Text
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks"; import { useShallowEffect } from "@mantine/hooks";
import _ from "lodash"; import _ from "lodash";
import { useState } from "react"; import { useState } from "react";
@@ -55,7 +51,7 @@ export function ComponentAdminMap_Drawer({
{_.isEmpty(data) ? ( {_.isEmpty(data) ? (
<ComponentAdminMap_SkeletonDrawer /> <ComponentAdminMap_SkeletonDrawer />
) : ( ) : (
<ComponentAdminMap_DetailDataDrawer mapId={mapId} /> <ComponentAdminMap_DetailDataDrawer data={data} />
)} )}
{/* <pre>{JSON.stringify(data, null, 2)}</pre> */} {/* <pre>{JSON.stringify(data, null, 2)}</pre> */}

View File

@@ -1,25 +1,23 @@
"use client"; "use client";
import { MODEL_MAP } from "@/app_modules/map/lib/interface"; import { APIs } from "@/app/lib";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data"; import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { useState } from "react";
import { import {
defaultLatLong, defaultLatLong,
defaultMapZoom, defaultMapZoom,
} from "@/app_modules/map/lib/default_lat_long"; } from "@/app_modules/map/lib/default_lat_long";
import { Avatar, Image, Paper, Stack, Text } from "@mantine/core"; import { MODEL_MAP } from "@/app_modules/map/lib/interface";
import { Avatar, Stack } from "@mantine/core";
import "mapbox-gl/dist/mapbox-gl.css"; import "mapbox-gl/dist/mapbox-gl.css";
import { useState } from "react";
import Map, { import Map, {
AttributionControl, AttributionControl,
Marker, Marker,
NavigationControl, NavigationControl,
ScaleControl, ScaleControl,
} from "react-map-gl"; } from "react-map-gl";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
import { ComponentAdminMap_Drawer } from "../component"; import { ComponentAdminMap_Drawer } from "../component";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import { RouterPortofolio } from "@/app/lib/router_hipmi/router_katalog";
import { RouterMap } from "@/app/lib/router_hipmi/router_map";
import { APIs } from "@/app/lib";
export function UiAdminMap_MapBoxView({ export function UiAdminMap_MapBoxView({
mapboxToken, mapboxToken,

View File

@@ -2,16 +2,7 @@
import { RouterAuth } from "@/app/lib/router_hipmi/router_auth"; import { RouterAuth } from "@/app/lib/router_hipmi/router_auth";
import { RouterHome } from "@/app/lib/router_hipmi/router_home"; import { RouterHome } from "@/app/lib/router_hipmi/router_home";
import { MainColor } from "@/app_modules/_global/color/color_pallet"; import { Avatar, BackgroundImage, Center, Image, Stack } from "@mantine/core";
import UIGlobal_SplashScreen from "@/app_modules/_global/ui/ui_splash";
import {
Avatar,
BackgroundImage,
Center,
Image,
Paper,
Stack,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks"; import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";

View File

@@ -23,5 +23,5 @@ export function CheckCookies_UiLayout({
} }
} }
return <>{children}</>; return children;
} }