App.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. import React from "react";
  2. import "./App.css";
  3. import Header from "./Header/header";
  4. import Navigation from "./Content/Navigation/navigation";
  5. import News from "./Content/News/news";
  6. import { Redirect, Route, BrowserRouter as Router, Switch } from "react-router-dom";
  7. // import { Redirect, Route, Router, Switch } from "react-router-dom";
  8. import Music from "./Content/Music/music";
  9. import Profile from "./Content/Profile/profile";
  10. import Settings from "./Content/Settings/settings";
  11. import Login from "./Content/Login/Login";
  12. import Registration from "./Content/Registration/Registration";
  13. import Users from "./Content/Users/users";
  14. import Messages from "./Content/Messages/messages";
  15. import Page404 from "./Components/404_Page/404_Page";
  16. import { store } from "./Redux/promise_reducer";
  17. import { Provider } from "react-redux";
  18. import history from "./history";
  19. function fff(a) {
  20. console.log(a)
  21. return <div>Пусто</div>
  22. }
  23. function App() {
  24. return (
  25. <Provider store={store}>
  26. <Router history={history}>
  27. <div className="app-wrapper">
  28. <Header />
  29. <div className="content-block">
  30. <Navigation />
  31. <div className="app-wrapper-content">
  32. <Switch>
  33. <Redirect exact from="/" to="/profile" />
  34. <Route
  35. path="/profile"
  36. render={() => <Profile />}
  37. />
  38. <Route
  39. path="/messages"
  40. render={() => <Messages />}
  41. />
  42. <Route
  43. path="/users"
  44. render={() => <Users /> }
  45. />
  46. <Route
  47. path="/404"
  48. render={() => <Page404 /> }
  49. />
  50. <Route path="/news" component={News} />
  51. <Route path="/music" component={Music} />
  52. <Route path="/settings" component={Settings} />
  53. <Route path="/login" component={Login} />
  54. <Route path="/registration" component={Registration} />
  55. <Route component={fff} />
  56. </Switch>
  57. </div>
  58. </div>
  59. </div>
  60. </Router>
  61. </Provider>
  62. );
  63. }
  64. export default App;