Skip to content

Commit

Permalink
task/wg-198-Pull-out-pages-react-refactor (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-massie authored Dec 15, 2023
1 parent fbe4f81 commit e2b7ce6
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions react/src/components/AppRouter.tsx → react/src/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
Navigate,
useLocation,
} from 'react-router-dom';
import * as ROUTES from '../constants/routes';
import MapProject from './MapProject';
import MainMenu from './MainMenu';
import Logout from './Authentication/Logout/Logout';
import Login from './Authentication/Login/Login';
import Callback from './Authentication/Callback/Callback';
import StreetviewCallback from './Authentication/StreetviewCallback/StreetviewCallback';
import { RootState } from '../redux/store';
import { isTokenValid } from '../utils/authUtils';
import * as ROUTES from './constants/routes';
import MapProject from './pages/MapProject';
import MainMenu from './pages/MainMenu';
import Logout from './pages/Logout/Logout';
import Login from './pages/Login/Login';
import Callback from './pages/Callback/Callback';
import StreetviewCallback from './pages/StreetviewCallback/StreetviewCallback';
import { RootState } from './redux/store';
import { isTokenValid } from './utils/authUtils';

interface ProtectedRouteProps {
isAuthenticated: boolean;
Expand Down
2 changes: 1 addition & 1 deletion react/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './components/AppRouter';
import App from './AppRouter';
import './index.css';
import store from './redux/store';
import { Provider } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Provider } from 'react-redux';
import { MemoryRouter } from 'react-router-dom';
import { render } from '@testing-library/react';
import store from '../../../redux/store';
import store from '../../redux/store';
import Callback from './Callback';

test('renders callback', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import { loginSuccess, logout } from '../../../redux/authSlice';
import { loginSuccess, logout } from '../../redux/authSlice';

export default function CallbackPage() {
const dispatch = useDispatch();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render, waitFor } from '@testing-library/react';
import Login from './Login';
import { Provider } from 'react-redux';
import store from '../../../redux/store';
import store from '../../redux/store';
import { MemoryRouter } from 'react-router';

test('renders login', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { useEffect } from 'react';
import { useLocation, useNavigate } from 'react-router-dom';
import { useSelector } from 'react-redux';
import { RootState } from '../../../redux/store';
import { isTokenValid } from '../../../utils/authUtils';
import { RootState } from '../../redux/store';
import { isTokenValid } from '../../utils/authUtils';

function Login() {
const location = useLocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import Logout from './Logout';
import { Provider } from 'react-redux';
import store from '../../../redux/store';
import store from '../../redux/store';
import { BrowserRouter } from 'react-router-dom';

test('renders logout', async () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import { useNavigate } from 'react-router-dom';
import { logout } from '../../../redux/authSlice';
import { logout } from '../../redux/authSlice';

function Logout() {
const dispatch = useDispatch();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import Map from '../Map';
import Map from '../../components/Map';
import { tileServerLayers } from '../../__fixtures__/tileServerLayerFixture';
import { featureCollection } from '../../__fixtures__/featuresFixture';
import { useParams } from 'react-router-dom';
Expand Down
File renamed without changes.

0 comments on commit e2b7ce6

Please sign in to comment.