Initial project setup #1

Merged
bilal.catic merged 10 commits from initial-project-setup into master 2019-05-24 14:10:17 +02:00
4 changed files with 35 additions and 77 deletions
Showing only changes of commit 01244c3118 - Show all commits

View File

@@ -17,6 +17,7 @@
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
}, },
"proxy": "http://localhost:5000",
"browserslist": { "browserslist": {
"production": [ "production": [
">0.2%", ">0.2%",

View File

@@ -1,80 +1,19 @@
import React from "react"; import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import './App.css';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Home from './scenes/Home';
import NotFound from './scenes/NotFound';
function App() { class App extends Component {
return ( render() {
<Router> return (
<div> <Router>
<ul> <Switch>
<li> <Route exact path="/" component={Home} />
<Link to="/">Home</Link> <Route component={NotFound} />
</li> </Switch>
<li> </Router>
<Link to="/about">About</Link> );
</li> }
<li>
<Link to="/topics">Topics</Link>
</li>
</ul>
<hr />
<Route exact path="/" component={Home} />
<Route path="/about" component={About} />
<Route path="/topics" component={Topics} />
</div>
</Router>
);
} }
function Home() {
return (
<div>
<h2>Home</h2>
</div>
);
}
function About() {
return (
<div>
<h2>About</h2>
</div>
);
}
function Topics({ match }) {
return (
<div>
<h2>Topics</h2>
<ul>
<li>
<Link to={`${match.url}/rendering`}>Rendering with React</Link>
</li>
<li>
<Link to={`${match.url}/components`}>Components</Link>
</li>
<li>
<Link to={`${match.url}/props-v-state`}>Props v. State</Link>
</li>
</ul>
<Route path={`${match.path}/:topicId`} component={Topic} />
<Route
exact
path={match.path}
render={() => <h3>Please select a topic.</h3>}
/>
</div>
);
}
function Topic({ match }) {
return (
<div>
<h3>{match.params.topicId}</h3>
</div>
);
}
export default App; export default App;

View File

@@ -0,0 +1,9 @@
import React from 'react';
export default function Home () {
return (
<div>
<h3>Sima Space - CRM Integration</h3>
</div>
);
}

View File

@@ -0,0 +1,9 @@
import React from 'react';
export default function NotFound () {
return (
<div>
<h1>Page not found</h1>
</div>
);
}