diff --git a/client/src/components/app_bar.tsx b/client/src/components/app_bar.tsx
index dffdc81..2c65a81 100644
--- a/client/src/components/app_bar.tsx
+++ b/client/src/components/app_bar.tsx
@@ -1,3 +1,6 @@
+/**
+ * @file contains the navigation bars of the app.
+ */
import * as React from 'react'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faDownload, faUpload, faEraser, faBook, faBookOpen, faGlobe, faHome,
@@ -11,7 +14,7 @@ import { useAppDispatch, useAppSelector } from '../hooks'
import { Button } from './button'
import { downloadProgress } from './popup/erase'
-/** navigation buttons to switch between welcome-pages on mobile */
+/** navigation buttons for mobile welcome page to switch between intro/tree/inventory. */
function MobileNavButtons({pageNumber, setPageNumber}:
{ pageNumber: number,
setPageNumber: any}) {
@@ -49,61 +52,16 @@ function MobileNavButtons({pageNumber, setPageNumber}:
>
}
+/** button to toggle dropdown menu. */
function MenuButton({navOpen, setNavOpen}) {
return
}
-/** the navigation bar on the welcome page */
-export function WelcomeAppBar({pageNumber, setPageNumber, gameInfo, toggleImpressum, toggleEraseMenu, toggleUploadMenu, toggleInfo} : {
- pageNumber: number,
- setPageNumber: any,
- gameInfo: GameInfo,
- toggleImpressum: any,
- toggleEraseMenu: any,
- toggleUploadMenu: any,
- toggleInfo: any
-}) {
- const gameId = React.useContext(GameIdContext)
- const gameProgress = useAppSelector(selectProgress(gameId))
- const {mobile} = React.useContext(MobileContext)
- const [navOpen, setNavOpen] = React.useState(false)
-
- return
-
-
-
-
-
- {!mobile && {gameInfo?.title}}
-
-
- {mobile && }
-
-
-
-
-
-
-
-
-
-
-}
-
+/** button to go one level futher.
+ * for the last level, this button turns into a button going back to the welcome page.
+ */
function NextButton({worldSize, difficulty, completed, setNavOpen}) {
const gameId = React.useContext(GameIdContext)
const {worldId, levelId} = React.useContext(WorldLevelIdContext)
@@ -121,6 +79,9 @@ function NextButton({worldSize, difficulty, completed, setNavOpen}) {
)
}
+/** button to go one level back.
+ * only renders if the current level id is > 0.
+ */
function PreviousButton({setNavOpen}) {
const gameId = React.useContext(GameIdContext)
const {worldId, levelId} = React.useContext(WorldLevelIdContext)
@@ -134,6 +95,7 @@ function PreviousButton({setNavOpen}) {
>)
}
+/** button to toggle between editor and typewriter */
function InputModeButton({setNavOpen, isDropdown}) {
const {levelId} = React.useContext(WorldLevelIdContext)
const {typewriterMode, setTypewriterMode, lockInputMode} = React.useContext(InputModeContext)
@@ -156,6 +118,7 @@ function InputModeButton({setNavOpen, isDropdown}) {
}
+/** button to toggle iimpressum popup */
function ImpressumButton({setNavOpen, toggleImpressum, isDropdown}) {
return
}
+/** button to go back to welcome page */
function HomeButton({isDropdown}) {
const gameId = React.useContext(GameIdContext)
return
}
-/** only displays a button if `setPageNumber` is set. */
+/** button in mobile level to toggle inventory.
+ * only displays a button if `setPageNumber` is set.
+ */
function InventoryButton({pageNumber, setPageNumber}) {
return (setPageNumber &&