Skip to content

Commit

Permalink
update repo gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
LankyMoose committed Feb 27, 2024
1 parent 0be6bf7 commit a0a3d6f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ node_modules
dist
pnpm-lock.yaml
.env
sandbox/*
!sandbox/csr
!sandbox/ssr
17 changes: 17 additions & 0 deletions sandbox/csr/src/components/ProtectedRoute.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { navigate } from "kaioken"

interface ProtectedRouteProps {
children?: JSX.Element
enabled: boolean
redirectPath: string
}

export function ProtectedRoute({
children,
enabled,
redirectPath,
}: ProtectedRouteProps) {
if (enabled && children) return children
setTimeout(() => navigate(redirectPath))
return null
}

0 comments on commit a0a3d6f

Please sign in to comment.