File tree Expand file tree Collapse file tree 2 files changed +2
-20
lines changed
components/domain/hosting Expand file tree Collapse file tree 2 files changed +2
-20
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { memo } from "react" ;
43import MapboxMap , { Marker , NavigationControl } from "react-map-gl/mapbox" ;
54import type { Hosting } from "@/lib/schemas" ;
65
7- function MapInner ( { hosting } : { hosting : Hosting } ) {
6+ export function HostingMap ( { hosting } : { hosting : Hosting } ) {
87 if ( ! process . env . NEXT_PUBLIC_MAPBOX_TOKEN ) return null ;
98
109 const lat = hosting . geo . lat ;
@@ -26,7 +25,6 @@ function MapInner({ hosting }: { hosting: Hosting }) {
2625 touchZoomRotate = { false }
2726 style = { { height : 280 , width : "100%" } }
2827 mapStyle = "mapbox://styles/mapbox/standard"
29- reuseMaps
3028 >
3129 < Marker longitude = { lon } latitude = { lat } >
3230 < div className = "h-4 w-4 rounded-full bg-blue-600 shadow-2xl ring-2 ring-white" />
@@ -36,9 +34,3 @@ function MapInner({ hosting }: { hosting: Hosting }) {
3634 </ div >
3735 ) ;
3836}
39-
40- export const HostingMap = memo ( MapInner , ( prev , next ) => {
41- const p = prev . hosting . geo ;
42- const n = next . hosting . geo ;
43- return p . lat === n . lat && p . lon === n . lon ;
44- } ) ;
Original file line number Diff line number Diff line change 22
33import { hasFlag } from "country-flag-icons" ;
44import { MailQuestionMark } from "lucide-react" ;
5- import dynamic from "next/dynamic" ;
6- import { MapSkeleton } from "@/components/domain/hosting/map-skeleton" ;
5+ import { HostingMap } from "@/components/domain/hosting/hosting-map" ;
76import { KeyValue } from "@/components/domain/key-value" ;
87import { KeyValueGrid } from "@/components/domain/key-value-grid" ;
98import { Section } from "@/components/domain/section" ;
@@ -19,15 +18,6 @@ import type { Hosting } from "@/lib/schemas";
1918import { sections } from "@/lib/sections-meta" ;
2019import { cn } from "@/lib/utils" ;
2120
22- const HostingMap = dynamic (
23- ( ) =>
24- import ( "@/components/domain/hosting/hosting-map" ) . then ( ( m ) => m . HostingMap ) ,
25- {
26- ssr : false ,
27- loading : ( ) => < MapSkeleton /> ,
28- } ,
29- ) ;
30-
3121function formatLocation ( geo : Hosting [ "geo" ] ) : string {
3222 const parts = [ geo . city , geo . region , geo . country ] . filter ( Boolean ) ;
3323 return parts . join ( ", " ) ;
You can’t perform that action at this time.
0 commit comments