added donation widget

This commit is contained in:
Anton Tranelis 2025-02-11 13:53:03 +00:00
parent 0a70af994c
commit e1b3492514
3 changed files with 7 additions and 4 deletions

View File

@ -19,6 +19,7 @@ function UtopiaMap({
showGratitudeControl = false,
showLayerControl = true,
infoText,
donationWidget,
}: UtopiaMapProps) {
return (
<ContextWrapper>
@ -35,6 +36,7 @@ function UtopiaMap({
showGratitudeControl={showGratitudeControl}
showLayerControl={showLayerControl}
infoText={infoText}
donationWidget={donationWidget}
>
{children}
</UtopiaMapInner>

View File

@ -47,7 +47,7 @@ export function UtopiaMapInner({
showFilterControl = false,
showGratitudeControl = false,
showLayerControl = true,
infoText,
donationWidget,
}: UtopiaMapProps) {
const selectNewItemPosition = useSelectPosition()
const setSelectNewItemPosition = useSetSelectPosition()
@ -71,21 +71,21 @@ export function UtopiaMapInner({
const init = useRef(false)
useEffect(() => {
if (!init.current) {
infoText &&
donationWidget &&
setTimeout(() => {
toast(
<>
<TextView rawText={'## Do you like this Map?'} />
<div>
<PopupButton url={'https://opencollective.com/utopia-project'} text={'Donate'} />
<TextView
rawText={'Support us building free opensource maps and help us grow 🌱☀️'}
/>
<PopupButton url={'https://opencollective.com/utopia-project'} text={'Donate'} />
</div>
</>,
{ autoClose: false },
)
}, 10000)
}, 600000)
init.current = true
}
// eslint-disable-next-line react-hooks/exhaustive-deps

View File

@ -13,4 +13,5 @@ export interface UtopiaMapProps {
showLayerControl?: boolean
showGratitudeControl?: boolean
infoText?: string
donationWidget?: boolean
}