From 384a1e9ccc9f8398342f608dc4552c4d771f7d2c Mon Sep 17 00:00:00 2001 From: Alexandre Date: Sun, 6 Jul 2025 08:36:20 +0200 Subject: [PATCH] BuyMeACoffee --- frontend/index.html | 14 +------------- frontend/src/App.jsx | 2 ++ frontend/src/BuyMeACoffee.jsx | 31 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 frontend/src/BuyMeACoffee.jsx diff --git a/frontend/index.html b/frontend/index.html index 6e3c2d5c..16ff4cf9 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -48,18 +48,6 @@
- + diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 94c5687c..a0f46e34 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -9,6 +9,7 @@ import { signOut, } from "firebase/auth"; import logo from "./logo.svg"; +import Buymeacoffee from "./BuyMeACoffee"; const PARAM_START = ""; const PARAM_END = ""; @@ -340,6 +341,7 @@ export default function App() { )} )} + {goPro && ( diff --git a/frontend/src/BuyMeACoffee.jsx b/frontend/src/BuyMeACoffee.jsx new file mode 100644 index 00000000..71fbf600 --- /dev/null +++ b/frontend/src/BuyMeACoffee.jsx @@ -0,0 +1,31 @@ +import React, { useEffect } from "react"; + +export default function Buymeacoffee() { + useEffect(() => { + const script = document.createElement("script"); + const div = document.getElementById("supportByBMC"); + script.setAttribute("data-name", "BMC-Widget"); + script.src = "https://cdnjs.buymeacoffee.com/1.0.0/widget.prod.min.js"; + script.setAttribute("data-id", "alexandrev"); + script.setAttribute("data-description", "Support me on Buy me a coffee!"); + script.setAttribute( + "data-message", + "Thank you for visiting my website. If this app has helped you in anyway, consider buying us a coffee. ✨😎", + ); + script.setAttribute("data-color", "#FFDD00"); + script.setAttribute("data-position", "Right"); + script.setAttribute("data-x_margin", "18"); + script.setAttribute("data-y_margin", "18"); + script.async = true; + document.head.appendChild(script); + script.onload = function () { + var evt = document.createEvent("Event"); + evt.initEvent("DOMContentLoaded", false, false); + window.dispatchEvent(evt); + }; + + div.appendChild(script); + }, []); + + return
; +} \ No newline at end of file