mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2026-04-06 01:25:33 +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 { 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}
|
||||||
|
|||||||
@ -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()
|
||||||
|
|||||||
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