mirror of
https://github.com/status-im/sourcecred.git
synced 2025-02-04 00:34:07 +00:00
Setup credExplorer app scaffold (#249)
Test plan: Run `yarn start`, and observe that the Cred Explorer is now included in the nav bar, and can be selected, in which case a short message is displayed.
This commit is contained in:
parent
0c59435a2b
commit
ac8d0ff66c
@ -4,10 +4,12 @@ import React from "react";
|
||||
import {BrowserRouter as Router, Route, NavLink} from "react-router-dom";
|
||||
|
||||
import ArtifactEditor from "../plugins/artifact/editor/App";
|
||||
import CredExplorer from "./credExplorer/App";
|
||||
|
||||
export default class App extends React.Component<{}> {
|
||||
render() {
|
||||
const ARTIFACT_EDITOR_ROUTE = "/plugins/artifact/editor";
|
||||
const CRED_EXPLORER_ROUTE = "/explorer";
|
||||
return (
|
||||
<Router>
|
||||
<div>
|
||||
@ -16,6 +18,9 @@ export default class App extends React.Component<{}> {
|
||||
<li>
|
||||
<NavLink to="/">Home</NavLink>
|
||||
</li>
|
||||
<li>
|
||||
<NavLink to={CRED_EXPLORER_ROUTE}>Cred Explorer</NavLink>
|
||||
</li>
|
||||
<li>
|
||||
<NavLink to={ARTIFACT_EDITOR_ROUTE}>Artifact Editor</NavLink>
|
||||
</li>
|
||||
@ -24,6 +29,7 @@ export default class App extends React.Component<{}> {
|
||||
|
||||
<hr />
|
||||
<Route exact path="/" component={Home} />
|
||||
<Route path={CRED_EXPLORER_ROUTE} component={CredExplorer} />
|
||||
<Route path={ARTIFACT_EDITOR_ROUTE} component={ArtifactEditor} />
|
||||
</div>
|
||||
</Router>
|
||||
|
26
src/app/credExplorer/App.js
Normal file
26
src/app/credExplorer/App.js
Normal file
@ -0,0 +1,26 @@
|
||||
// @flow
|
||||
|
||||
import React from "react";
|
||||
import {StyleSheet, css} from "aphrodite/no-important";
|
||||
|
||||
type Props = {};
|
||||
type State = {};
|
||||
|
||||
export default class App extends React.Component<Props, State> {
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<header className={css(styles.header)}>
|
||||
<h1>Cred Explorer</h1>
|
||||
</header>
|
||||
<p>Welcome to the SourceCred Explorer!</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
header: {
|
||||
color: "#f0f",
|
||||
},
|
||||
});
|
13
src/app/credExplorer/App.test.js
Normal file
13
src/app/credExplorer/App.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
// @flow
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import App from "./App";
|
||||
|
||||
require("../testUtil").configureAphrodite();
|
||||
|
||||
// Check that PropTypes check out.
|
||||
it("renders without crashing", () => {
|
||||
const div = document.createElement("div");
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user