App.tsx 1.4 KB

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