This repository has been archived on 2023-11-14. You can view files and clone it, but cannot push or open issues/pull-requests.
valnet/src/App.tsx

65 lines
1.5 KiB
TypeScript
Raw Normal View History

2021-04-08 20:38:05 -04:00
import React from 'react';
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';
import icon from '../assets/icon.svg';
import './App.global.css';
2021-04-11 01:53:16 -04:00
import { IpcClient } from './lib/ipc';
2021-04-08 20:38:05 -04:00
2021-04-11 01:53:16 -04:00
class Hello extends React.Component {
api = new IpcClient('valnet');
constructor(props: {} | Readonly<{}>) {
super(props);
this.getData();
}
async getData() {
console.log(await this.api.getClients())
}
render() {
return (
<div>
<div className="Hello">
<img width="200px" alt="icon" src={icon} />
</div>
<h1>electron-react-boilerplate</h1>
<div className="Hello">
<a
href="https://electron-react-boilerplate.js.org/"
target="_blank"
rel="noreferrer"
>
<button type="button">
<span role="img" aria-label="books">
📚
</span>
Read our docs
</button>
</a>
<a
href="https://github.com/sponsors/electron-react-boilerplate"
target="_blank"
rel="noreferrer"
>
<button type="button">
<span role="img" aria-label="books">
🙏
</span>
Donate
</button>
</a>
</div>
2021-04-08 20:38:05 -04:00
</div>
2021-04-11 01:53:16 -04:00
);
}
}
2021-04-08 20:38:05 -04:00
export default function App() {
return (
<Router>
<Switch>
<Route path="/" component={Hello} />
</Switch>
</Router>
);
}