parent
90960bf9b5
commit
9b75fed62d
@ -0,0 +1,10 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
|
||||||
|
const Header = () => (
|
||||||
|
<div className="header">
|
||||||
|
<h1>wow!</h1>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
export default Header;
|
@ -0,0 +1,27 @@
|
|||||||
|
import React, { useContext } from 'react';
|
||||||
|
|
||||||
|
import { AppContext } from './ContextProvider';
|
||||||
|
import { ToCoins } from '../helpers/utils';
|
||||||
|
|
||||||
|
|
||||||
|
const Info = () => {
|
||||||
|
const { state } = useContext(AppContext);
|
||||||
|
const { pool } = state;
|
||||||
|
const { config } = pool;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="info">
|
||||||
|
<p>welcome good friend <3 thank so much for mining!</p>
|
||||||
|
<p>very mining with you from <strong>blocke 62</strong></p>
|
||||||
|
<p>such good pool:</p>
|
||||||
|
<ul>
|
||||||
|
<li>PPLNS fee for miner: {config.pplns_fee}%</li>
|
||||||
|
<li>SOLO fee for miner: {config.solo_fee}%</li>
|
||||||
|
<li>min payout for miner: <ToCoins coins={config.min_wallet_payout} /></li>
|
||||||
|
<li>min payout for miner on exchange: <ToCoins coins={config.min_exchange_payout} /></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Info;
|
@ -0,0 +1,40 @@
|
|||||||
|
import React, { useContext } from 'react';
|
||||||
|
|
||||||
|
import { AppContext } from './ContextProvider';
|
||||||
|
import { useFormInput } from '../helpers/Hooks';
|
||||||
|
import {ToCoins, ToDate} from '../helpers/utils';
|
||||||
|
|
||||||
|
|
||||||
|
const Miner = () => {
|
||||||
|
const { actions, state } = useContext(AppContext);
|
||||||
|
const { addWallet } = actions;
|
||||||
|
const { user } = state;
|
||||||
|
const { wallets } = user;
|
||||||
|
|
||||||
|
const { value: address, bind: bindAddress } = useFormInput('');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="miner">
|
||||||
|
<form
|
||||||
|
onSubmit={e => {
|
||||||
|
e.preventDefault();
|
||||||
|
addWallet(address);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<p>{!wallets ? 'you miner? your wow address miner pleas? ->' : 'add more address miner! ->'} <input {...bindAddress} /></p>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
{wallets && Object.keys(wallets).map(wallet =>
|
||||||
|
<div key={wallet}>
|
||||||
|
<div>{wallet}</div>
|
||||||
|
<div>last hashe: <ToDate timeStamp={wallets[wallet].lastHash} /></div>
|
||||||
|
<div>all hashe: {wallets[wallet].totalHashes}</div>
|
||||||
|
<div>all pay: <ToCoins coins={wallets[wallet].amtPaid} /></div>
|
||||||
|
<div>still wait pay: <ToCoins coins={wallets[wallet].amtDue} /></div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Miner;
|
@ -1,4 +1,11 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
|
||||||
export const useEffectOnce = fn => useEffect(fn, []);
|
export const useFormInput = init => {
|
||||||
|
const [value, setValue] = useState(init);
|
||||||
|
const onChange = e => setValue(e.target.value);
|
||||||
|
const reset = () => setValue('');
|
||||||
|
return { bind: { value, onChange }, reset, setValue, value };
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useEffectOnce = aids => useEffect(aids, []);
|
||||||
|
@ -1,17 +1,9 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import './static/css/main.css';
|
|
||||||
import App from './components/App';
|
import App from './components/App';
|
||||||
import reportWebVitals from './reportWebVitals';
|
|
||||||
|
|
||||||
ReactDOM.render(
|
import './static/css/main.css';
|
||||||
<React.StrictMode>
|
|
||||||
<App />
|
|
||||||
</React.StrictMode>,
|
|
||||||
document.getElementById('root')
|
|
||||||
);
|
|
||||||
|
|
||||||
// If you want to start measuring performance in your app, pass a function
|
ReactDOM.render(<App />, document.getElementById('root'));
|
||||||
// to log results (for example: reportWebVitals(console.log))
|
|
||||||
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
|
||||||
reportWebVitals();
|
|
||||||
|
Loading…
Reference in new issue