Skip to content

Commit

Permalink
OV-44: * import corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
XCODE89 committed Aug 23, 2024
1 parent 84fbcca commit b6f8b5f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
1 change: 1 addition & 0 deletions frontend/src/bundles/common/components/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { Header } from './header/header.js';
export { Input } from './input/input.js';
export { Link } from './link/link.js';
export { Loader } from './loader/loader.js';
export { NotFound } from './not-found/not-found.js';
export { Overlay } from './overlay/overlay.js';
export { RouterProvider } from './router-provider/router-provider.js';
export { VideoModal } from './video-modal/video-modal.js';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/bundles/common/hooks/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export { useAppForm } from './use-app-form/use-app-form.hook.js';
export { useAppSelector } from './use-app-selector/use-app-selector.hook.js';
export { useField as useFormField } from 'formik';
export { useCallback, useEffect, useMemo, useState } from 'react';
export { useLocation } from 'react-router-dom';
export { Navigate, useLocation } from 'react-router-dom';
8 changes: 2 additions & 6 deletions frontend/src/router/components/protected-route.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { Navigate } from 'react-router-dom';

import { RouterOutlet } from '~/bundles/common/components/components.js';
import { AppRoute } from '~/bundles/common/enums/app-route.enum.js';
// import { useAppSelector } from '~/bundles/common/hooks/hooks.js';
import { Navigate } from '~/bundles/common/hooks/hooks.js';

const ProtectedRoute: React.FC = () => {
// const user = useAppSelector((state) => state.auth.user);

// TODO: for implementing persistence. The following line is temporary
// TODO: When persistence is implemented, the user will be taken from the store. The following line is temporary
const user = true;

if (!user) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/router/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { App } from '~/app/app.js';
import { AppRoute } from '~/bundles/common/enums/app-route.enum.js';
import { AppRoute } from '~/bundles/common/enums/enums.js';

import { protectedRoutes } from './routes/protected-routes.js';
import { publicRoutes } from './routes/public-routes.js';
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/router/routes/protected-routes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NotFound } from '~/bundles/common/components/not-found/not-found.js';
import { AppRoute } from '~/bundles/common/enums/app-route.enum.js';
import { NotFound } from '~/bundles/common/components/components.js';
import { AppRoute } from '~/bundles/common/enums/enums.js';
import { Studio } from '~/bundles/studio/pages/studio.js';

import { ProtectedRoute } from '../components/protected-route.js';
Expand All @@ -8,7 +8,6 @@ const protectedRoutes = {
path: AppRoute.ROOT,
element: <ProtectedRoute />,
children: [
//TODO Add protected routes here in element property and specify the correct path
{
path: AppRoute.STUDIO,
element: <Studio />,
Expand Down

0 comments on commit b6f8b5f

Please sign in to comment.