MainImg.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import {BrowserRouter as Router, Route, Link, Switch, Redirect} from 'react-router-dom';
  2. import createHistory from "history/createBrowserHistory";
  3. import {actionCatalogCard} from "./index"
  4. import { useState } from 'react';
  5. import {Provider, connect} from 'react-redux';
  6. import {createStore, combineReducers, applyMiddleware} from 'redux';
  7. import thunk from 'redux-thunk';
  8. import store from "../reducers";
  9. import Catalog from "./catalog";
  10. import {Goods} from "./index";
  11. // import Goods from "../reducers/goods";
  12. const Main = ({className = "MainImg" }) => {
  13. return (
  14. <div className = {className}>
  15. <Switch>
  16. <aside>
  17. <Route path = "/catalog/" component={Catalog} />
  18. </aside>
  19. </Switch>
  20. <Switch>
  21. <content>
  22. <Route path = "/" component = {MainMag} exact/>
  23. <Route path = "/catalog/" component={MainCatalog} exact/>
  24. <Route path = "/catalog/:id" component= {({match}) => <Goods id = {match.params.id}/>}/>
  25. <Route path="/about" component = {About} exact/>
  26. <Route path = "/post" component = {Post} exact/>
  27. <Route path = "/contacts" component = {Contacts} />
  28. {/* <Route component = { NotFound } /> */}
  29. </content>
  30. </Switch>
  31. </div>
  32. )
  33. }
  34. const Id = ({name = "Idishnic"} )=> {
  35. return(<div>{name}</div>) }
  36. const MainMag = () => <div>Я тут кароче самый главный страниц</div>
  37. const About = () => <div>Мы крутой магазин, бла-бла</div>
  38. const NotFound = () => <div>Да пошел ты!</div>
  39. const MainCatalog = () => <div>Chose</div>
  40. const Post = () => <div className = "post">Точно не знаю зачем это, возможно потом уберу. Но в некоторых магазинах есть такое</div>
  41. const Contacts = () => <div className = "contacts">Тут будет адрес, номер телефона и соцсети</div>
  42. export default Main;