refactor typescript wiring

This commit is contained in:
seavor 2026-04-15 15:46:17 -05:00
parent cea9ae62d8
commit c62c336a11
286 changed files with 2999 additions and 3053 deletions

View file

@ -1,15 +1,15 @@
import React from 'react';
import { Navigate } from 'react-router-dom';
import { ServerSelectors } from 'store';
import { RouteEnum } from 'types';
import { useAppSelector } from 'store/store';
import { AuthenticationService } from 'api';
import { ServerSelectors } from '@app/store';
import { App } from '@app/types';
import { useAppSelector } from '@app/store';
import { AuthenticationService } from '@app/api';
const AuthGuard = () => {
const state = useAppSelector(s => ServerSelectors.getState(s));
return !AuthenticationService.isConnected(state)
? <Navigate to={RouteEnum.LOGIN} />
? <Navigate to={App.RouteEnum.LOGIN} />
: <div></div>;
};

View file

@ -1,15 +1,15 @@
import React from 'react';
import { Navigate } from 'react-router-dom';
import { ServerSelectors } from 'store';
import { AuthenticationService } from 'api';
import { RouteEnum } from 'types';
import { useAppSelector } from 'store/store';
import { ServerSelectors } from '@app/store';
import { AuthenticationService } from '@app/api';
import { App } from '@app/types';
import { useAppSelector } from '@app/store';
const ModGuard = () => {
const user = useAppSelector(state => ServerSelectors.getUser(state));
return !AuthenticationService.isModerator(user)
? <Navigate to={RouteEnum.SERVER} />
? <Navigate to={App.RouteEnum.SERVER} />
: <></>;
};