Skip to content

Commit

Permalink
Hackathon
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanclark committed Sep 24, 2024
1 parent 9117ee3 commit 0a97193
Show file tree
Hide file tree
Showing 11 changed files with 358 additions and 36 deletions.
18 changes: 18 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions web/packages/design/src/Box/Box.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import {
HeightProps,
justifySelf,
JustifySelfProps,
fontSize,
FontSizeProps,
lineHeight,
LineHeightProps,
maxHeight,
Expand Down Expand Up @@ -65,6 +67,7 @@ export interface BoxProps
TextAlignProps,
FlexProps,
AlignSelfProps,
FontSizeProps,
JustifySelfProps,
BorderProps,
BordersProps,
Expand All @@ -87,6 +90,7 @@ const Box = styled.div<BoxProps>`
${justifySelf}
${borders}
${overflow}
${fontSize}
`;

Box.displayName = 'Box';
Expand Down
1 change: 1 addition & 0 deletions web/packages/teleport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@opentelemetry/sdk-trace-base": "1.26.0",
"@opentelemetry/sdk-trace-web": "1.26.0",
"@opentelemetry/semantic-conventions": "1.27.0",
"@tanstack/react-query": "^5.56.2",
"@xterm/xterm": "^5.5.0",
"@xterm/addon-canvas": "^0.7.0",
"@xterm/addon-fit": "^0.10.0",
Expand Down
69 changes: 41 additions & 28 deletions web/packages/teleport/src/Teleport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import React, { Suspense, useEffect } from 'react';
import ThemeProvider, { updateFavicon } from 'design/ThemeProvider';

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';

import { Route, Router, Switch } from 'teleport/components/Router';
import { CatchError } from 'teleport/components/CatchError';
import Authenticated from 'teleport/components/Authenticated';
Expand Down Expand Up @@ -51,6 +53,15 @@ import { Main } from './Main';

import type { History } from 'history';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
retry: false,
},
},
});

const Teleport: React.FC<Props> = props => {
const { ctx, history } = props;
const createPublicRoutes = props.renderPublicRoutes || publicOSSRoutes;
Expand Down Expand Up @@ -81,34 +92,36 @@ const Teleport: React.FC<Props> = props => {
}, []);

return (
<CatchError>
<ThemeProvider>
<LayoutContextProvider>
<Router history={history}>
<Suspense fallback={null}>
<Switch>
{createPublicRoutes()}
<Route path={cfg.routes.root}>
<Authenticated>
<UserContextProvider>
<TeleportContextProvider ctx={ctx}>
<Switch>
<Route
path={cfg.routes.appLauncher}
component={AppLauncher}
/>
<Route>{createPrivateRoutes()}</Route>
</Switch>
</TeleportContextProvider>
</UserContextProvider>
</Authenticated>
</Route>
</Switch>
</Suspense>
</Router>
</LayoutContextProvider>
</ThemeProvider>
</CatchError>
<QueryClientProvider client={queryClient}>
<CatchError>
<ThemeProvider>
<LayoutContextProvider>
<Router history={history}>
<Suspense fallback={null}>
<Switch>
{createPublicRoutes()}
<Route path={cfg.routes.root}>
<Authenticated>
<UserContextProvider>
<TeleportContextProvider ctx={ctx}>
<Switch>
<Route
path={cfg.routes.appLauncher}
component={AppLauncher}
/>
<Route>{createPrivateRoutes()}</Route>
</Switch>
</TeleportContextProvider>
</UserContextProvider>
</Authenticated>
</Route>
</Switch>
</Suspense>
</Router>
</LayoutContextProvider>
</ThemeProvider>
</CatchError>
</QueryClientProvider>
);
};

Expand Down
Loading

0 comments on commit 0a97193

Please sign in to comment.