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 { UtopiaMapInner } from './UtopiaMapInner'
import type { UtopiaMapProps } from '#types/UtopiaMapProps'
import 'react-toastify/dist/ReactToastify.css' import 'react-toastify/dist/ReactToastify.css'
import type { GeoJsonObject } from 'geojson'
/** /**
* @category Map * @category Map
@ -21,9 +21,19 @@ function UtopiaMap({
showFilterControl = false, showFilterControl = false,
showGratitudeControl = false, showGratitudeControl = false,
showLayerControl = true, showLayerControl = true,
infoText,
donationWidget, 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 ( return (
<ContextWrapper> <ContextWrapper>
<MapContainer <MapContainer
@ -38,7 +48,6 @@ function UtopiaMap({
showFilterControl={showFilterControl} showFilterControl={showFilterControl}
showGratitudeControl={showGratitudeControl} showGratitudeControl={showGratitudeControl}
showLayerControl={showLayerControl} showLayerControl={showLayerControl}
infoText={infoText}
donationWidget={donationWidget} donationWidget={donationWidget}
> >
{children} {children}

View File

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