Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
connorch committed Mar 8, 2024
1 parent e154974 commit 424b9b1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 27 deletions.
8 changes: 5 additions & 3 deletions apps/teleporter-demo/src/components/chain-drag-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ export const ChainDragOverlay = memo(() => {

useDndMonitor({
onDragStart: ({ active }) => {
const activeChain = isEvmTeleporterDndData(active.data?.current) ? active.data.current.chain : undefined;
const activeChain =
active && isEvmTeleporterDndData(active.data?.current) ? active.data.current.chain : undefined;
activeChain && activeDrag.setActiveDragChain(activeChain);
},
onDragOver: ({ active, over }) => {
const draggedChain = isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;
const overChain = isEvmTeleporterDndData(over?.data.current) ? over.data.current.chain : undefined;
const draggedChain =
active && isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;
const overChain = over && isEvmTeleporterDndData(over?.data.current) ? over.data.current.chain : undefined;

// Not dragging a chain, so do nothing.
if (!draggedChain) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const DroppableChain = ({ chain, ...rest }: { chain: EvmTeleporterChain } & HTML
},
});

const activeChain = isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;
const activeChain = active && isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;
// Whether a chain other than this on is being dragged over this one.
const isOverByDifferentChain = isOver && activeChain?.chainId !== chain.chainId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { isEvmTeleporterDndData } from '../utils/type-guards';

export const useActivelyDraggedChain = () => {
const { active } = useDndContext();
const activeChain = isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;
const activeChain = active && isEvmTeleporterDndData(active?.data.current) ? active.data.current.chain : undefined;

return activeChain;
};
12 changes: 1 addition & 11 deletions apps/teleporter-demo/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,10 @@ import { Route as rootRoute } from './routes/__root'

// Create Virtual Routes

const MintLazyImport = createFileRoute('/mint')()
const IndexLazyImport = createFileRoute('/')()

// Create/Update Routes

const MintLazyRoute = MintLazyImport.update({
path: '/mint',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./routes/mint.lazy').then((d) => d.Route))

const IndexLazyRoute = IndexLazyImport.update({
path: '/',
getParentRoute: () => rootRoute,
Expand All @@ -39,15 +33,11 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof IndexLazyImport
parentRoute: typeof rootRoute
}
'/mint': {
preLoaderRoute: typeof MintLazyImport
parentRoute: typeof rootRoute
}
}
}

// Create and export the route tree

export const routeTree = rootRoute.addChildren([IndexLazyRoute, MintLazyRoute])
export const routeTree = rootRoute.addChildren([IndexLazyRoute])

/* prettier-ignore-end */
11 changes: 0 additions & 11 deletions apps/teleporter-demo/src/routes/mint.lazy.tsx

This file was deleted.

0 comments on commit 424b9b1

Please sign in to comment.