all wow miners:
this pool miners: {poolStats.miners} miners digging (only {poolPercentage.toFixed(2)}%)
world blocke: {networkStats.height} with discovered {}
diff --git a/src/components/useAppState.js b/src/components/useAppState.js
index 8c72b0b..d88d0c3 100644
--- a/src/components/useAppState.js
+++ b/src/components/useAppState.js
@@ -7,7 +7,8 @@ const initialState = () => ({
appLoaded: false,
coinDecimals: 11,
coinSymbol: 9077, // hex 2375 (⍵) https://git.wownero.com/wownero/meta/issues/2
- networkUpdateInterval: 15,
+ minerStatsUpdateInterval: 15,
+ networkStatsUpdateInterval: 15,
poolStatsUpdateInterval: 30,
},
intervals: [],
@@ -20,6 +21,7 @@ const initialState = () => ({
},
user: {
loggedIn: false,
+ wallets: null,
},
});
@@ -46,8 +48,17 @@ const reducer = (state, action) => {
},
};
break;
+ case 'UPDATE_WALLETS':
+ result = {
+ ...state,
+ user: {
+ ...state.user,
+ wallets: JSON.parse(localStorage.getItem('pool.wowne.ro')),
+ },
+ };
+ break;
case 'SET_INTERVALS':
- const intervals = action.intervals.map(i => setInterval(i.fn, i.time * 1000));
+ const intervals = action.intervals.map(i => setInterval(i.fn, i.time * 1000, i.params));
result = {
...state,
intervals,
@@ -105,6 +116,7 @@ const reducer = (state, action) => {
default:
throw new Error();
}
+
updatedState.current = result;
return result;
};
diff --git a/src/helpers/ApiHelper.js b/src/helpers/ApiHelper.js
index 6c0d6eb..f914fe4 100644
--- a/src/helpers/ApiHelper.js
+++ b/src/helpers/ApiHelper.js
@@ -3,6 +3,11 @@ export default class ApiHelper {
this.apiURL = options.state.appSettings.apiURL;
}
+ getMinerStats = address => {
+ return this.fetch(`${this.apiURL}/miner/${address}/stats`, { method: 'GET' })
+ .then(res => Promise.resolve(res));
+ }
+
getNetworkStats = () => {
return this.fetch(`${this.apiURL}/network/stats`, { method: 'GET' })
.then(res => Promise.resolve(res));
diff --git a/src/helpers/Hooks.js b/src/helpers/Hooks.js
index b256fa2..30b1b5a 100644
--- a/src/helpers/Hooks.js
+++ b/src/helpers/Hooks.js
@@ -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, []);
diff --git a/src/index.js b/src/index.js
index 329f581..ef5f252 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,17 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom';
-import './static/css/main.css';
+
import App from './components/App';
-import reportWebVitals from './reportWebVitals';
-ReactDOM.render(
-
-
- ,
- document.getElementById('root')
-);
+import './static/css/main.css';
+
-// If you want to start measuring performance in your app, pass a function
-// to log results (for example: reportWebVitals(console.log))
-// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
-reportWebVitals();
+ReactDOM.render(
, document.getElementById('root'));
diff --git a/src/static/css/main.css b/src/static/css/main.css
index 80c9e42..ad52963 100644
--- a/src/static/css/main.css
+++ b/src/static/css/main.css
@@ -3,3 +3,26 @@
body {
font-family: 'Gaegu', cursive;
}
+
+hr {
+ background-color: rgb(238, 238, 238);
+ border: 0 none;
+ color: rgb(238, 238, 238);
+ height: 1px;
+}
+
+.header {
+ background-color: rgb(235, 18, 255);
+}
+
+.info {
+ background-color: rgb(255, 143, 5);
+}
+
+.pool {
+ background-color: rgb(255, 143, 5);
+}
+
+.miner {
+ background-color: rgb(235, 18, 255);
+}