diff --git a/apps/learneth/src/App.tsx b/apps/learneth/src/App.tsx
index 8582be5a75..e61fbf7b74 100644
--- a/apps/learneth/src/App.tsx
+++ b/apps/learneth/src/App.tsx
@@ -1,15 +1,15 @@
-import React from 'react';
-import { createBrowserRouter, RouterProvider } from 'react-router-dom';
-import { ToastContainer } from 'react-toastify';
-import LoadingScreen from './components/LoadingScreen';
-import LogoPage from './pages/Logo';
-import HomePage from './pages/Home';
-import StepListPage from './pages/StepList';
-import StepDetailPage from './pages/StepDetail';
-import 'react-toastify/dist/ReactToastify.css';
-import './App.css';
+import React from 'react'
+import {createHashRouter, RouterProvider} from 'react-router-dom'
+import {ToastContainer} from 'react-toastify'
+import LoadingScreen from './components/LoadingScreen'
+import LogoPage from './pages/Logo'
+import HomePage from './pages/Home'
+import StepListPage from './pages/StepList'
+import StepDetailPage from './pages/StepDetail'
+import 'react-toastify/dist/ReactToastify.css'
+import './App.css'
-export const router = createBrowserRouter([
+export const router = createHashRouter([
{
path: '/',
element: ,
@@ -26,26 +26,16 @@ export const router = createBrowserRouter([
path: '/detail',
element: ,
},
-]);
+])
function App(): JSX.Element {
return (
<>
-
+
>
- );
+ )
}
-export default App;
+export default App
diff --git a/apps/learneth/src/components/BackButton/index.tsx b/apps/learneth/src/components/BackButton/index.tsx
index 22a2fbfff4..cb476cd826 100644
--- a/apps/learneth/src/components/BackButton/index.tsx
+++ b/apps/learneth/src/components/BackButton/index.tsx
@@ -1,5 +1,5 @@
import React, {useState} from 'react'
-import {Link, useNavigate} from 'react-router-dom'
+import {Link, useLocation, useNavigate} from 'react-router-dom'
import {Button, Modal, Tooltip, OverlayTrigger} from 'react-bootstrap'
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
import {faHome, faBars, faChevronLeft, faChevronRight} from '@fortawesome/free-solid-svg-icons'
@@ -8,6 +8,7 @@ import './index.scss'
function BackButton({entity}: any) {
const navigate = useNavigate()
+ const location = useLocation()
const [show, setShow] = useState(false)
// const theme = useAppSelector((state) => state.remixide.theme)
const isDetailPage = location.pathname === '/detail'
diff --git a/apps/learneth/src/pages/StepDetail/index.tsx b/apps/learneth/src/pages/StepDetail/index.tsx
index 38ec41cec7..2df3b9efe6 100644
--- a/apps/learneth/src/pages/StepDetail/index.tsx
+++ b/apps/learneth/src/pages/StepDetail/index.tsx
@@ -1,43 +1,44 @@
-import React, { useEffect } from 'react';
-import { useNavigate } from 'react-router-dom';
-import Markdown from 'react-markdown';
-import rehypeRaw from 'rehype-raw';
-import BackButton from '../../components/BackButton';
-import { useAppSelector, useAppDispatch } from '../../redux/hooks';
-import './index.scss';
+import React, {useEffect} from 'react'
+import {useLocation, useNavigate} from 'react-router-dom'
+import Markdown from 'react-markdown'
+import rehypeRaw from 'rehype-raw'
+import BackButton from '../../components/BackButton'
+import {useAppSelector, useAppDispatch} from '../../redux/hooks'
+import './index.scss'
function StepDetailPage() {
- const navigate = useNavigate();
- const dispatch = useAppDispatch();
- const queryParams = new URLSearchParams(location.search);
- const id = queryParams.get('id') as string;
- const stepId = Number(queryParams.get('stepId'));
+ const navigate = useNavigate()
+ const location = useLocation()
+ const dispatch = useAppDispatch()
+ const queryParams = new URLSearchParams(location.search)
+ const id = queryParams.get('id') as string
+ const stepId = Number(queryParams.get('stepId'))
const {
- workshop: { detail, selectedId },
- remixide: { errorLoadingFile, errors, success },
- } = useAppSelector((state: any) => state);
- const entity = detail[selectedId].entities[id];
- const steps = entity.steps;
- const step = steps[stepId];
- console.log(step);
+ workshop: {detail, selectedId},
+ remixide: {errorLoadingFile, errors, success},
+ } = useAppSelector((state: any) => state)
+ const entity = detail[selectedId].entities[id]
+ const steps = entity.steps
+ const step = steps[stepId]
+ console.log(step)
useEffect(() => {
dispatch({
type: 'remixide/displayFile',
payload: step,
- });
+ })
dispatch({
type: 'remixide/save',
- payload: { errors: [], success: false },
- });
- window.scrollTo(0, 0);
- }, [step]);
+ payload: {errors: [], success: false},
+ })
+ window.scrollTo(0, 0)
+ }, [step])
useEffect(() => {
if (errors.length > 0 || success) {
- window.scrollTo(0, document.documentElement.scrollHeight);
+ window.scrollTo(0, document.documentElement.scrollHeight)
}
- }, [errors, success]);
+ }, [errors, success])
return (
<>
@@ -57,7 +58,7 @@ function StepDetailPage() {
dispatch({
type: 'remixide/displayFile',
payload: step,
- });
+ })
}}
>
Load the file
@@ -71,9 +72,7 @@ function StepDetailPage() {
>
)}
-
- {step.markdown?.content}
-
+ {step.markdown?.content}
{step.test?.content ? (
<>
@@ -85,7 +84,7 @@ function StepDetailPage() {
dispatch({
type: 'remixide/displayFile',
payload: step,
- });
+ })
}}
>
Load the file
@@ -100,7 +99,7 @@ function StepDetailPage() {
dispatch({
type: 'remixide/testStep',
payload: step,
- });
+ })
}}
>
Check Answer
@@ -112,7 +111,7 @@ function StepDetailPage() {
dispatch({
type: 'remixide/showAnswer',
payload: step,
- });
+ })
}}
>
Show answer
@@ -126,11 +125,7 @@ function StepDetailPage() {