feat: похуй 2.0

This commit is contained in:
2026-05-14 00:31:06 +03:00
parent 61878c20ba
commit 0f88a68c59
4 changed files with 7 additions and 10 deletions

View File

@@ -1,11 +1,13 @@
import { Navigate, Outlet } from 'react-router-dom'
import { Navigate, Outlet, useLocation } from 'react-router-dom'
import { useIsAuthenticated } from '@features/auth'
import { ROUTES } from '@shared/config/routes'
export function GuestRoute() {
const { isAuthenticated, isLoading } = useIsAuthenticated()
const location = useLocation()
const from = (location.state as { from?: { pathname: string } })?.from?.pathname ?? ROUTES.WALLET
if (isLoading) return null
if (isAuthenticated) return <Navigate to={ROUTES.WALLET} replace />
if (isAuthenticated) return <Navigate to={from} replace />
return <Outlet />
}

View File

@@ -1,7 +1,9 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import type { ReactNode } from 'react'
const queryClient = new QueryClient()
const queryClient = new QueryClient({
defaultOptions: { queries: { retry: false } },
})
export function QueryProvider({ children }: { children: ReactNode }) {
return <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>