import 'react-data-grid/lib/styles.css' import 'styles/code.scss' import 'styles/contextMenu.scss' import 'styles/date-picker.scss' import 'styles/editor.scss' import 'styles/graphiql-base.scss' import 'styles/grid.scss' import 'styles/main.scss' import 'styles/markdown-preview.scss' import 'styles/monaco.scss' import 'styles/react-data-grid-logs.scss' import 'styles/reactflow.scss' import 'styles/storage.scss' import 'styles/stripe.scss' import 'styles/toast.scss' import 'styles/typography.scss' import 'styles/ui.scss' import 'ui/build/css/themes/dark.css' import 'ui/build/css/themes/light.css' import { loader } from '@monaco-editor/react' import * as Sentry from '@sentry/nextjs' import { Hydrate, QueryClientProvider } from '@tanstack/react-query' import { ReactQueryDevtools } from '@tanstack/react-query-devtools' import dayjs from 'dayjs' import customParseFormat from 'dayjs/plugin/customParseFormat' import duration from 'dayjs/plugin/duration' import relativeTime from 'dayjs/plugin/relativeTime' import timezone from 'dayjs/plugin/timezone' import utc from 'dayjs/plugin/utc' import Head from 'next/head' import { NuqsAdapter } from 'nuqs/adapters/next/pages' import { ErrorInfo } from 'react' import { ErrorBoundary } from 'react-error-boundary' import { FeatureFlagProvider, getFlags as getConfigCatFlags, TelemetryTagManager, ThemeProvider, useThemeSandbox, } from 'common' import MetaFaviconsPagesRouter from 'common/MetaFavicons/pages-router' import { RouteValidationWrapper } from 'components/interfaces/App' import { AppBannerContextProvider } from 'components/interfaces/App/AppBannerWrapperContext' import { StudioCommandMenu } from 'components/interfaces/App/CommandMenu' import { FeaturePreviewContextProvider } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import FeaturePreviewModal from 'components/interfaces/App/FeaturePreview/FeaturePreviewModal' import { MonacoThemeProvider } from 'components/interfaces/App/MonacoThemeProvider' import { GlobalErrorBoundaryState } from 'components/ui/GlobalErrorBoundaryState' import { useRootQueryClient } from 'data/query-client' import { customFont, sourceCodePro } from 'fonts' import { AuthProvider } from 'lib/auth' import { API_URL, BASE_PATH, IS_PLATFORM } from 'lib/constants' import { ProfileProvider } from 'lib/profile' import { Telemetry } from 'lib/telemetry' import { AppPropsWithLayout } from 'types' import { SonnerToaster, TooltipProvider } from 'ui' import { CommandProvider } from 'ui-patterns/CommandMenu' dayjs.extend(customParseFormat) dayjs.extend(utc) dayjs.extend(timezone) dayjs.extend(relativeTime) dayjs.extend(duration) loader.config({ // [Joshen] Attempt for offline support/bypass ISP issues is to store the assets required for monaco // locally. We're however, only storing the assets which we need (based on what the network tab loads // while using monaco). If we end up facing more effort trying to maintain this, probably to either // use cloudflare or find some way to pull all the files from a CDN via a CLI, rather than tracking individual files // The alternative was to import * as monaco from 'monaco-editor' but i couldn't get it working paths: { vs: IS_PLATFORM ? 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs' : `${BASE_PATH}/monaco-editor`, }, }) // [Joshen TODO] Once we settle on the new nav layout - we'll need a lot of clean up in terms of our layout components // a lot of them are unnecessary and introduce way too many cluttered CSS especially with the height styles that make // debugging way too difficult. Ideal scenario is we just have one AppLayout to control the height and scroll areas of // the dashboard, all other layout components should not be doing that function CustomApp({ Component, pageProps }: AppPropsWithLayout) { const queryClient = useRootQueryClient() const getLayout = Component.getLayout ?? ((page) => page) const errorBoundaryHandler = (error: Error, info: ErrorInfo) => { Sentry.withScope(function (scope) { scope.setTag('globalErrorBoundary', true) Sentry.captureException(error) }) console.error(error.stack) } useThemeSandbox() const isTestEnv = process.env.NEXT_PUBLIC_NODE_ENV === 'test' return ( Supabase {/* [Alaister]: This has to be an inline style tag here and not a separate component due to next/font */}