mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-03-01 12:44:17 +00:00
cleand up types of UtopiaMap and UtopiaMapInner
This commit is contained in:
parent
1bd3a8a33b
commit
c788569cc1
@ -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}
|
||||
|
||||
@ -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()
|
||||
|
||||
17
src/types/UtopiaMapProps.d.ts
vendored
17
src/types/UtopiaMapProps.d.ts
vendored
@ -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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user