Frontend: - replace the i18next stack with a small typed i18n module - hero clouds removed, llms.txt, HUD widget ARIA fixes and tests Mod: - TargetESP constellation mode; tracker and colors extracted - JumpCircles: 7 new shapes, shared animation and color pipeline - KillEffect blood mode with Burst/Fountain/Ring/Spray styles - main menu: menuLayout setting (orbs/hero) and hero screen - Simple Voice Chat soft integration: VoiceChat module and HUD panel - renderer/quick: static Draw facade with glass outline - vanilla chat: Baritone-style autocomplete popup for the % command prefix
12 lines
507 B
TypeScript
12 lines
507 B
TypeScript
import { useTranslation } from '@shared/i18n/react'
|
|
import { Navigate, Outlet, useLocation } from 'react-router'
|
|
import { useSession } from './session'
|
|
|
|
export function RequireAuth() {
|
|
const { t } = useTranslation('auth')
|
|
const { status } = useSession()
|
|
const location = useLocation()
|
|
if (status === 'loading') return <p className="text-frost">{t('checkingSession')}</p>
|
|
if (status === 'anonymous') return <Navigate to="/login" replace state={{ from: location.pathname }} />
|
|
return <Outlet />
|
|
}
|