1
0
Fork 0
mirror of https://gitlab.com/MrFry/qmining-page synced 2025-04-01 20:23:44 +02:00

Changed/added donate page

This commit is contained in:
mrfry 2020-11-03 12:37:11 +01:00
parent e21f281dc5
commit 9aa0c111ce
4 changed files with 89 additions and 18 deletions
src/pages

43
src/pages/donate.js Normal file
View file

@ -0,0 +1,43 @@
import React, { useState, useEffect } from 'react'
import LoadingIndicator from '../components/LoadingIndicator.js'
import constants from '../constants.json'
import styles from './donate.module.css'
export default function Donate(props) {
const [btcAddress, setBtcAddress] = useState()
useEffect(() => {
console.info('Fetching news.json')
fetch(`${constants.apiUrl}btc/btcaddress`, {
credentials: 'include',
})
.then((resp) => {
return resp.text()
})
.then((data) => {
setBtcAddress(data)
})
}, [])
if (!btcAddress) {
return <LoadingIndicator />
} else {
return (
<div className={styles.container}>
<div className={styles.text}>
Privacy okokból csak bitcoint lehet adományozni. Ezen az oldalon
található a bitcoin cím, és a hozzá tartozó QR kód.
</div>
<div className={styles.address}>{btcAddress}</div>
<div>
<img
src={`${constants.apiUrl}btc/btcaddress.png`}
className={styles.qr}
/>
</div>
</div>
)
}
}