_app.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from "react";
  2. import type { AppProps } from "next/app";
  3. import { Toaster } from "react-hot-toast";
  4. import { ThemeProvider } from "styled-components";
  5. import * as Sentry from "@sentry/nextjs";
  6. import GlobalStyle from "src/constants/globalStyle";
  7. import { darkTheme, lightTheme } from "src/constants/theme";
  8. import { useConfig, withConfig } from "src/hocs/config";
  9. import { GoogleAnalytics } from "src/components/GoogleAnalytics";
  10. if (process.env.NODE_ENV !== "development") {
  11. Sentry.init({
  12. dsn: "https://[email protected]/6495191",
  13. tracesSampleRate: 0.5,
  14. });
  15. }
  16. function JsonVisio({ Component, pageProps }: AppProps) {
  17. const { settings } = useConfig();
  18. return (
  19. <>
  20. <GoogleAnalytics />
  21. <ThemeProvider theme={settings.lightmode ? lightTheme : darkTheme}>
  22. <GlobalStyle />
  23. <Component {...pageProps} />
  24. <Toaster
  25. position="bottom-right"
  26. toastOptions={{
  27. style: {
  28. background: "#4D4D4D",
  29. color: "#B9BBBE",
  30. },
  31. }}
  32. />
  33. </ThemeProvider>
  34. </>
  35. );
  36. }
  37. export default withConfig(JsonVisio);