You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

74 lines
2.2 KiB

<html>
<head>
<link rel="stylesheet" src="/static/css/noty.css" />
<link rel="stylesheet" src="/static/css/noty-relax.css" />
</head>
<body>
<div id="container"></div>
</body>
</html>
<script src="/static/js/react.min.js"></script>
<script src="/static/js/react-dom.min.js"></script>
<script src="/static/js/babel.min.js"></script>
<script src="/static/js/noty.js"></script>
<script type="text/babel">
'use strict';
const e = React.createElement;
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
looping: false
}
}
render() {
return(
<div>
<h1>we trade a lil {{ trade_currency }}</h1>
{this.state.looping && (
<p>market making is started</p>
) || (
<div>
<p>market making is paused</p>
<button onClick={() => {
new Noty({
theme: 'relax',
layout: 'topCenter',
text: 'yo doggy',
timeout: 4500
}).show();
}}>sup boi</button>
</div>
)}
</div>
)
}
}
// this.setState(prevState => {
// let jasper = { ...prevState.jasper }; // creating copy of state variable jasper
// jasper.name = 'someothername'; // update the name property, assign a new value
// return { jasper }; // return new object jasper object
// });
const domContainer = document.querySelector('#container');
const root = ReactDOM.createRoot(domContainer);
root.render(e(App));
// setInterval(function() {
// fetch('{{ url_for("tasks.store_ticker_data") }}');
// }, 10000)
// store market data - 10s
// update balances - 30s
// update bitcoin price - 120s
// update order status - 30s
// get trade history - 60s
</script>