-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.js
27 lines (26 loc) · 857 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from "react";
import { Route, Switch } from "react-router-dom";
import Home from "./Home";
import Products from "./Products";
import Product from "./Product";
import Cart from "./Cart";
import Header from "./Header";
import { Container } from "reactstrap";
export default class App extends React.Component {
render() {
return (
<div>
<Header location={this.props.location} />
<Container className="mt-5">
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/products" component={Products} />
<Route exact path="/products/:id(\d+)" component={Product} />
<Route exact path="/products/:brand(\w+)" component={Products} />
<Route path="/cart" component={Cart} />
</Switch>
</Container>
</div>
);
}
}