Add Donation Dialog
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 174
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
I am one of the Lemmy maintainers and work on the project fulltime together with Dessalines. Our work is funded by donations, but these are gradually going down and don't even cover a single dev salary now (see [join-lemmy.org](https://join-lemmy.org/donate)). That's why we added a new donation dialog in 0.19.11 which is shown once a year to every user:

---
Many people use Lemmy exclusively through apps, so we would greatly appreciate if you could add such a dialog to your app too. The logic is relatively simple:
- From the `/api/v3/site` response, check `my_user.local_user_view.local_user.last_donation_notification`
- If the date is more than one year ago, display a dialog like the one above with buttons Donate, Close
- When Donate is clicked:
- Open `https://join-lemmy.org/donate`
- Close dialog
- Call `POST /api/v3/user/donation_dialog_shown` to hide dialog until next year
- When Close is clicked also call the `donation_dialog_shown` endpoint
To test this functionality with a 0.19.11 instance, run the SQL query `update local_user set last_donation_notification = '2024-04-07 09:05:06';` which shows the dialog for all local users. You can reuse the [code](https://github.com/LemmyNet/lemmy-ui/blob/release/v0.19/src/shared/components/home/donation_dialog.tsx) and [strings](https://github.com/LemmyNet/lemmy-translations/pull/161/files) used in lemmy-ui.
Thanks for your consideration!
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.