admin/home: donate button
Massimo Melina committed
Sep 22, 2024 at 16:57 UTC
2ff5333b11f289b281b56ffb58ea720e17da82ea
1 file changed
+10
-2
admin/src/HomePage.ts
+10
-2
@@ -3,8 +3,10 @@
3
import { createElement as h, ReactNode, useState } from 'react'
4
import { Box, Card, CardContent, LinearProgress, Link } from '@mui/material'
5
import { apiCall, useApiEx, useApiList } from './api'
6
-import { dontBotherWithKeys, objSameKeys, onlyTruthy, prefix, REPO_URL, md,
7
- replaceStringToReact, wait, with_, DAY } from './misc'
6
+import {
7
+ dontBotherWithKeys, objSameKeys, onlyTruthy, prefix, REPO_URL, md,
8
+ replaceStringToReact, wait, with_, DAY, HOUR
9
+} from './misc'
10
import { Btn, Flex, InLink, LinkBtn, wikiLink, } from './mui'
11
import { BrowserUpdated as UpdateIcon, CheckCircle, Error, Info, Launch, OpenInNew, Warning } from '@mui/icons-material'
12
import { state, useSnapState } from './state'
@@ -121,6 +123,12 @@ export default function HomePage() {
123
: h(Flex, { vert: true },
124
updates.map((x: any) => h(Update, { info: x })) )),
125
h(SwitchThemeBtn, { variant: 'outlined' }),
126
+ Date.now() - Number(new Date(status.started)) > HOUR && h(Link, {
127
+ title: "Donate",
128
+ target: 'donate',
129
+ style: { textDecoration: 'none', position: 'fixed', bottom: 0, right: 4, fontSize: 'large' },
130
+ href: 'https://www.paypal.com/donate/?hosted_button_id=HC8MB4GRVU5T2'
131
+ }, '❤️')
132
)
133
}
134