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",
"version": "1.0.11",
"version": "1.0.12",
"private": true,
"prisma": {
"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 React from "react";
import { Admin_ComponentPreviewImageAdmin } from "@/app_modules/admin/_admin_global/comp_preview_image_admin";
async function Page({ params }: { params: { id: string } }) {
const fileId = params.id;
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";
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
onClick={() => {
setLoading(true);
router.push(RouterAdminGlobal.preview_image({ id: fileId }), {
scroll: false,
});

View File

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

View File

@@ -1,7 +1,5 @@
import { Admin_ComponentLoadImageLandscape } from "./_component/comp_admin_load_image";
import { Admin_ComponentSkeletonNavbar } from "./_component/comp_admin_skeleton_navbar";
import { Admin_UiImagePreview } from "./_ui/ui_admin_image_preview";
export { Admin_ComponentLoadImageLandscape };
export { Admin_UiImagePreview };
export { Admin_ComponentSkeletonNavbar };
export { Admin_ComponentLoadImageLandscape, 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 {
AspectRatio,
Box,
Button,
Center,
Grid,
Image,
Stack,
Text,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { Box, Button, Center, Grid, Stack, Text } from "@mantine/core";
import {
IconBuildingSkyscraper,
IconListDetails,
@@ -18,42 +9,17 @@ import {
IconPhoneCall,
IconPinned,
} from "@tabler/icons-react";
import { useState } from "react";
import { adminMap_funGetOneById } from "../fun/fun_get_one_by_id";
import { Admin_ComponentLoadImageLandscape } from "../../_admin_global";
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 (
<>
<Stack>
<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> */}
<Admin_ComponentLoadImageLandscape fileId={data?.imageId as any} />
<Box>
<Grid>
@@ -97,7 +63,6 @@ export function ComponentAdminMap_DetailDataDrawer({
</Grid.Col>
</Grid>
</Box>
{data ? (
<Center>
<Button

View File

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

View File

@@ -1,25 +1,23 @@
"use client";
import { MODEL_MAP } from "@/app_modules/map/lib/interface";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
import { useState } from "react";
import { APIs } from "@/app/lib";
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
import {
defaultLatLong,
defaultMapZoom,
} 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 { useState } from "react";
import Map, {
AttributionControl,
Marker,
NavigationControl,
ScaleControl,
} from "react-map-gl";
import ComponentAdminGlobal_IsEmptyData from "../../_admin_global/is_empty_data";
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({
mapboxToken,

View File

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

View File

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