App.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React, { Component } from "react";
  2. import { BrowserRouter } from "react-router-dom";
  3. import PorterErrorBoundary from "shared/error_handling/PorterErrorBoundary";
  4. import styled, { ThemeProvider, createGlobalStyle } from "styled-components";
  5. import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
  6. import MainWrapper from "./main/MainWrapper";
  7. import standard from "shared/themes/standard";
  8. const queryClient = new QueryClient();
  9. export default class App extends Component {
  10. render() {
  11. return (
  12. <QueryClientProvider client={queryClient}>
  13. <ThemeProvider theme={standard}>
  14. <StyledMain>
  15. <GlobalStyle />
  16. <PorterErrorBoundary errorBoundaryLocation="globalErrorBoundary">
  17. <BrowserRouter>
  18. <MainWrapper />
  19. </BrowserRouter>
  20. </PorterErrorBoundary>
  21. </StyledMain>
  22. </ThemeProvider>
  23. </QueryClientProvider>
  24. );
  25. }
  26. }
  27. const GlobalStyle = createGlobalStyle`
  28. * {
  29. box-sizing: border-box;
  30. font-family: 'Work Sans', sans-serif;
  31. color-scheme: dark;
  32. }
  33. body {
  34. overscroll-behavior-x: none;
  35. }
  36. a {
  37. color: #949eff;
  38. text-decoration: none;
  39. }
  40. img {
  41. max-width: 100%;
  42. }
  43. `;
  44. const StyledMain = styled.div`
  45. height: 100vh;
  46. width: 100vw;
  47. position: fixed;
  48. top: 0;
  49. left: 0;
  50. color: white;
  51. `;