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:
parent
e21f281dc5
commit
9aa0c111ce
4 changed files with 89 additions and 18 deletions
43
src/pages/donate.js
Normal file
43
src/pages/donate.js
Normal 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>
|
||||
)
|
||||
}
|
||||
}
|
24
src/pages/donate.module.css
Normal file
24
src/pages/donate.module.css
Normal file
|
@ -0,0 +1,24 @@
|
|||
.address {
|
||||
margin: 20px 0px;
|
||||
font-size: 20px;
|
||||
color: white;
|
||||
word-wrap: break-word;
|
||||
overflow-wrap: anywhere;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text {
|
||||
margin: 5px 0px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.qr {
|
||||
max-width: 100%;
|
||||
width: 400px;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue