mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
added donation widget
This commit is contained in:
parent
0a70af994c
commit
e1b3492514
@ -19,6 +19,7 @@ function UtopiaMap({
|
|||||||
showGratitudeControl = false,
|
showGratitudeControl = false,
|
||||||
showLayerControl = true,
|
showLayerControl = true,
|
||||||
infoText,
|
infoText,
|
||||||
|
donationWidget,
|
||||||
}: UtopiaMapProps) {
|
}: UtopiaMapProps) {
|
||||||
return (
|
return (
|
||||||
<ContextWrapper>
|
<ContextWrapper>
|
||||||
@ -35,6 +36,7 @@ function UtopiaMap({
|
|||||||
showGratitudeControl={showGratitudeControl}
|
showGratitudeControl={showGratitudeControl}
|
||||||
showLayerControl={showLayerControl}
|
showLayerControl={showLayerControl}
|
||||||
infoText={infoText}
|
infoText={infoText}
|
||||||
|
donationWidget={donationWidget}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</UtopiaMapInner>
|
</UtopiaMapInner>
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export function UtopiaMapInner({
|
|||||||
showFilterControl = false,
|
showFilterControl = false,
|
||||||
showGratitudeControl = false,
|
showGratitudeControl = false,
|
||||||
showLayerControl = true,
|
showLayerControl = true,
|
||||||
infoText,
|
donationWidget,
|
||||||
}: UtopiaMapProps) {
|
}: UtopiaMapProps) {
|
||||||
const selectNewItemPosition = useSelectPosition()
|
const selectNewItemPosition = useSelectPosition()
|
||||||
const setSelectNewItemPosition = useSetSelectPosition()
|
const setSelectNewItemPosition = useSetSelectPosition()
|
||||||
@ -71,21 +71,21 @@ export function UtopiaMapInner({
|
|||||||
const init = useRef(false)
|
const init = useRef(false)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!init.current) {
|
if (!init.current) {
|
||||||
infoText &&
|
donationWidget &&
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
toast(
|
toast(
|
||||||
<>
|
<>
|
||||||
<TextView rawText={'## Do you like this Map?'} />
|
<TextView rawText={'## Do you like this Map?'} />
|
||||||
<div>
|
<div>
|
||||||
<PopupButton url={'https://opencollective.com/utopia-project'} text={'Donate'} />
|
|
||||||
<TextView
|
<TextView
|
||||||
rawText={'Support us building free opensource maps and help us grow 🌱☀️'}
|
rawText={'Support us building free opensource maps and help us grow 🌱☀️'}
|
||||||
/>
|
/>
|
||||||
|
<PopupButton url={'https://opencollective.com/utopia-project'} text={'Donate'} />
|
||||||
</div>
|
</div>
|
||||||
</>,
|
</>,
|
||||||
{ autoClose: false },
|
{ autoClose: false },
|
||||||
)
|
)
|
||||||
}, 10000)
|
}, 600000)
|
||||||
init.current = true
|
init.current = true
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
|||||||
1
src/types/UtopiaMapProps.d.ts
vendored
1
src/types/UtopiaMapProps.d.ts
vendored
@ -13,4 +13,5 @@ export interface UtopiaMapProps {
|
|||||||
showLayerControl?: boolean
|
showLayerControl?: boolean
|
||||||
showGratitudeControl?: boolean
|
showGratitudeControl?: boolean
|
||||||
infoText?: string
|
infoText?: string
|
||||||
|
donationWidget?: boolean
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user