cleand up types of UtopiaMap and UtopiaMapInner

This commit is contained in:
Anton Tranelis 2025-02-27 12:17:21 +00:00
parent 1bd3a8a33b
commit c788569cc1
3 changed files with 22 additions and 24 deletions

View File

@ -5,8 +5,8 @@ import { ContextWrapper } from '#components/AppShell/ContextWrapper'
import { UtopiaMapInner } from './UtopiaMapInner'
import type { UtopiaMapProps } from '#types/UtopiaMapProps'
import 'react-toastify/dist/ReactToastify.css'
import type { GeoJsonObject } from 'geojson'
/**
* @category Map
@ -21,9 +21,19 @@ function UtopiaMap({
showFilterControl = false,
showGratitudeControl = false,
showLayerControl = true,
infoText,
donationWidget,
}: UtopiaMapProps) {
}: {
height?: string
width?: string
center?: [number, number]
zoom?: number
children?: React.ReactNode
geo?: GeoJsonObject
showFilterControl?: boolean
showLayerControl?: boolean
showGratitudeControl?: boolean
donationWidget?: boolean
}) {
return (
<ContextWrapper>
<MapContainer
@ -38,7 +48,6 @@ function UtopiaMap({
showFilterControl={showFilterControl}
showGratitudeControl={showGratitudeControl}
showLayerControl={showLayerControl}
infoText={infoText}
donationWidget={donationWidget}
>
{children}

View File

@ -36,8 +36,7 @@ import { TextView } from './Subcomponents/ItemPopupComponents/TextView'
import { SelectPosition } from './Subcomponents/SelectPosition'
import type { ItemFormPopupProps } from '#types/ItemFormPopupProps'
import type { UtopiaMapProps } from '#types/UtopiaMapProps'
import type { Feature, Geometry as GeoJSONGeometry } from 'geojson'
import type { Feature, Geometry as GeoJSONGeometry, GeoJsonObject } from 'geojson'
export function UtopiaMapInner({
children,
@ -46,7 +45,14 @@ export function UtopiaMapInner({
showGratitudeControl = false,
showLayerControl = true,
donationWidget,
}: UtopiaMapProps) {
}: {
children?: React.ReactNode
geo?: GeoJsonObject
showFilterControl?: boolean
showLayerControl?: boolean
showGratitudeControl?: boolean
donationWidget?: boolean
}) {
const selectNewItemPosition = useSelectPosition()
const setSelectNewItemPosition = useSetSelectPosition()
const setClusterRef = useSetClusterRef()

View File

@ -1,17 +0,0 @@
import type { Tag } from './Tag'
import type { GeoJsonObject } from 'geojson'
export interface UtopiaMapProps {
height?: string
width?: string
center?: [number, number]
zoom?: number
tags?: Tag[]
children?: React.ReactNode
geo?: GeoJsonObject
showFilterControl?: boolean
showLayerControl?: boolean
showGratitudeControl?: boolean
infoText?: string
donationWidget?: boolean
}