setup paste ui

This commit is contained in:
2018-03-12 08:52:51 -06:00
parent 898bab21bf
commit 5692b739b2
26 changed files with 14678 additions and 934 deletions

49
assets/src/App.js Normal file
View File

@@ -0,0 +1,49 @@
import React, { Component } from 'react';
import Paste from './vendor/src/paste/Paste';
import Framework from './vendor/src/sour-is/Framework';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { remoteService } from "./vendor/src/sour-is/RemoteService";
const req = remoteService();
const APP_NAME = "DN42 Paste UI";
class App extends Component {
constructor(){
super()
this.state = {
name: APP_NAME,
api: "Paste API (Version Snapshot)"
}
}
componentDidMount() {
req('/app-info').get()
.then((response) => {
if (response.ok) return response.text().catch(()=>"");
else return "Unknown API"; })
.then((text) => { this.setState({app:{name: APP_NAME, api: text}}); });
}
render() {
const {api, name} = this.state;
return (
<BrowserRouter>
<React.Fragment key={1}>
<section className="container-responsive">
<Switch>
<Route path="/" component={Paste} />
</Switch>
</section>
<footer>
<span className="left text-muted">{name}</span>
<span className="right text-muted">{api}</span>
</footer>
</React.Fragment>
</BrowserRouter>
);
}
}
export default App;