diff --git a/apps/web/src/config/externalRoutes.ts b/apps/web/src/config/externalRoutes.ts index 295d3db77..f0cd3468b 100644 --- a/apps/web/src/config/externalRoutes.ts +++ b/apps/web/src/config/externalRoutes.ts @@ -2,3 +2,4 @@ export const BUSTER_HOME_PAGE = 'https://buster.so'; export const BUSTER_DOCS_URL = 'https://docs.buster.so'; export const BUSTER_GETTING_STARTED_URL = 'https://www.buster.so/get-started'; export const BUSTER_DOCS_QUICKSTART = 'https://docs.buster.so/docs/getting-started/quickstart'; +export const BUSTER_SIGN_UP_URL = 'https://buster.so/sign-up'; diff --git a/apps/web/src/routeTree.gen.ts b/apps/web/src/routeTree.gen.ts index 5b2113d49..8945c90a1 100644 --- a/apps/web/src/routeTree.gen.ts +++ b/apps/web/src/routeTree.gen.ts @@ -22,6 +22,7 @@ import { Route as InfoGettingStartedRouteImport } from './routes/info/getting-st import { Route as AuthResetPasswordRouteImport } from './routes/auth.reset-password' import { Route as AuthLogoutRouteImport } from './routes/auth.logout' import { Route as AuthLoginRouteImport } from './routes/auth.login' +import { Route as AppThrow2RouteImport } from './routes/app.throw2' import { Route as AppThrowRouteImport } from './routes/app.throw' import { Route as AppSettingsRouteImport } from './routes/app/_settings' import { Route as AppAppRouteImport } from './routes/app/_app' @@ -213,6 +214,11 @@ const AuthLoginRoute = AuthLoginRouteImport.update({ path: '/login', getParentRoute: () => AuthRoute, } as any) +const AppThrow2Route = AppThrow2RouteImport.update({ + id: '/throw2', + path: '/throw2', + getParentRoute: () => AppRoute, +} as any) const AppThrowRoute = AppThrowRouteImport.update({ id: '/throw', path: '/throw', @@ -946,6 +952,7 @@ export interface FileRoutesByFullPath { '/embed': typeof EmbedRouteWithChildren '/healthcheck': typeof HealthcheckRoute '/app/throw': typeof AppThrowRoute + '/app/throw2': typeof AppThrow2Route '/auth/login': typeof AuthLoginRoute '/auth/logout': typeof AuthLogoutRoute '/auth/reset-password': typeof AuthResetPasswordRoute @@ -1056,6 +1063,7 @@ export interface FileRoutesByTo { '/healthcheck': typeof HealthcheckRoute '/app': typeof AppSettingsRestricted_layoutAdmin_onlyRouteWithChildren '/app/throw': typeof AppThrowRoute + '/app/throw2': typeof AppThrow2Route '/auth/login': typeof AuthLoginRoute '/auth/logout': typeof AuthLogoutRoute '/auth/reset-password': typeof AuthResetPasswordRoute @@ -1151,6 +1159,7 @@ export interface FileRoutesById { '/app/_app': typeof AppAppRouteWithChildren '/app/_settings': typeof AppSettingsRouteWithChildren '/app/throw': typeof AppThrowRoute + '/app/throw2': typeof AppThrow2Route '/auth/login': typeof AuthLoginRoute '/auth/logout': typeof AuthLogoutRoute '/auth/reset-password': typeof AuthResetPasswordRoute @@ -1277,6 +1286,7 @@ export interface FileRouteTypes { | '/embed' | '/healthcheck' | '/app/throw' + | '/app/throw2' | '/auth/login' | '/auth/logout' | '/auth/reset-password' @@ -1387,6 +1397,7 @@ export interface FileRouteTypes { | '/healthcheck' | '/app' | '/app/throw' + | '/app/throw2' | '/auth/login' | '/auth/logout' | '/auth/reset-password' @@ -1481,6 +1492,7 @@ export interface FileRouteTypes { | '/app/_app' | '/app/_settings' | '/app/throw' + | '/app/throw2' | '/auth/login' | '/auth/logout' | '/auth/reset-password' @@ -1701,6 +1713,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof AuthLoginRouteImport parentRoute: typeof AuthRoute } + '/app/throw2': { + id: '/app/throw2' + path: '/throw2' + fullPath: '/app/throw2' + preLoaderRoute: typeof AppThrow2RouteImport + parentRoute: typeof AppRoute + } '/app/throw': { id: '/app/throw' path: '/throw' @@ -3235,6 +3254,7 @@ interface AppRouteChildren { AppAppRoute: typeof AppAppRouteWithChildren AppSettingsRoute: typeof AppSettingsRouteWithChildren AppThrowRoute: typeof AppThrowRoute + AppThrow2Route: typeof AppThrow2Route AppIndexRoute: typeof AppIndexRoute } @@ -3242,6 +3262,7 @@ const AppRouteChildren: AppRouteChildren = { AppAppRoute: AppAppRouteWithChildren, AppSettingsRoute: AppSettingsRouteWithChildren, AppThrowRoute: AppThrowRoute, + AppThrow2Route: AppThrow2Route, AppIndexRoute: AppIndexRoute, } diff --git a/apps/web/src/routes/app.throw.tsx b/apps/web/src/routes/app.throw.tsx index 42dd2b42d..4b9a0c653 100644 --- a/apps/web/src/routes/app.throw.tsx +++ b/apps/web/src/routes/app.throw.tsx @@ -1,23 +1,42 @@ -import { createFileRoute } from '@tanstack/react-router'; -import { useState } from 'react'; +import { createFileRoute, useNavigate } from '@tanstack/react-router'; +import { z } from 'zod'; import { useMount } from '../hooks/useMount'; export const Route = createFileRoute('/app/throw')({ + validateSearch: z.object({ + iterations: z.number().optional(), + }), component: RouteComponent, + beforeLoad: ({ search }) => { + return { + iterations: search.iterations, + }; + }, + loader: async ({ context }) => { + return { + iterations: context.iterations, + }; + }, + head: ({ loaderData }) => { + return { + meta: [ + { + title: `Throw ${loaderData?.iterations}`, + }, + ], + }; + }, }); function RouteComponent() { - const [throwError, setThrowError] = useState(false); + const navigate = useNavigate(); + const { iterations } = Route.useSearch(); useMount(() => { setTimeout(() => { - setThrowError(true); + navigate({ to: '/app/throw2', replace: true, search: { iterations: (iterations ?? 0) + 1 } }); }, 1000); }); - if (throwError) { - throw new Error('Nate is testing this error'); - } - - return