You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

App.js 1.1KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*eslint-disable*/
  2. import React, { useState, useEffect } from "react";
  3. import { Router } from "react-router-dom";
  4. import { Helmet } from "react-helmet-async";
  5. import i18next from "i18next";
  6. import history from "./store/utils/history";
  7. import AppRoutes from "./AppRoutes";
  8. import Header from "./components/Header/Header";
  9. import { StyledEngineProvider } from "@mui/material";
  10. import GlobalStyle from "./components/Styles/globalStyles";
  11. import { ToastContainer } from "react-toastify";
  12. import "react-toastify/dist/ReactToastify.css";
  13. import { socketInit } from "./socket/socket";
  14. import { useSelector } from "react-redux";
  15. import { selectUserId } from "./store/selectors/loginSelectors";
  16. const App = () => {
  17. const userId = useSelector(selectUserId);
  18. socketInit(userId);
  19. return (
  20. <Router history={history}>
  21. <Helmet>
  22. <title>{i18next.t("app.title")}</title>
  23. </Helmet>
  24. <StyledEngineProvider injectFirst>
  25. <Header />
  26. <GlobalStyle />
  27. <ToastContainer />
  28. <AppRoutes />
  29. </StyledEngineProvider>
  30. </Router>
  31. );
  32. };
  33. export default App;