diff --git a/webapp/src/common/Nav.tsx b/webapp/src/common/Nav.tsx index 30f843f..6781598 100644 --- a/webapp/src/common/Nav.tsx +++ b/webapp/src/common/Nav.tsx @@ -71,7 +71,9 @@ const NavBar: React.FC<{}> = () => flexWrap: 'nowrap', alignItems: 'flex-start', justifyContent: 'flex-start', - width: '100%' + width: '100%', + position: 'inherit', + marginBottom: '10px' } }> diff --git a/webapp/src/common/RootLayout.scss b/webapp/src/common/RootLayout.scss new file mode 100644 index 0000000..1d3fcf3 --- /dev/null +++ b/webapp/src/common/RootLayout.scss @@ -0,0 +1,5 @@ +.flex-column { + display: flex; + flex-direction: column; + min-height: 100vh; +} \ No newline at end of file diff --git a/webapp/src/common/RouterLayout.tsx b/webapp/src/common/RouterLayout.tsx index b828ad5..84c66b1 100644 --- a/webapp/src/common/RouterLayout.tsx +++ b/webapp/src/common/RouterLayout.tsx @@ -1,13 +1,14 @@ import React from "react"; import { Outlet } from "react-router-dom"; import NavBar from "./Nav"; +import "./RootLayout.scss" /* This shows the NavBar and behind the element passed here */ export const RouterLayout: React.FC<{}> = () => { return( - <> +
- +
) }; \ No newline at end of file diff --git a/webapp/src/common/nav.scss b/webapp/src/common/nav.scss index 62f7cff..92fe925 100644 --- a/webapp/src/common/nav.scss +++ b/webapp/src/common/nav.scss @@ -8,7 +8,6 @@ .nav-appBar{ height: 65px; background: #D9D9D9; - position: fixed; } .nav-profile-picture{ diff --git a/webapp/src/components/game/multiplayer/GameMultiPlayer.tsx b/webapp/src/components/game/multiplayer/GameMultiPlayer.tsx index 4c86ed0..b7e9600 100644 --- a/webapp/src/components/game/multiplayer/GameMultiPlayer.tsx +++ b/webapp/src/components/game/multiplayer/GameMultiPlayer.tsx @@ -111,12 +111,14 @@ const GameMultiPlayer: FC = () => { }; return ( - + <> {stage === 1 && } - {stage === 2 && } - {stage === 3 && } - {stage === 4 && } - + + {stage === 2 && } + {stage === 3 && } + {stage === 4 && } + + ) } diff --git a/webapp/src/components/game/multiplayer/menu-multiplayer.scss b/webapp/src/components/game/multiplayer/menu-multiplayer.scss index c234438..f2fc405 100644 --- a/webapp/src/components/game/multiplayer/menu-multiplayer.scss +++ b/webapp/src/components/game/multiplayer/menu-multiplayer.scss @@ -1,9 +1,9 @@ .container { display: flex; + flex: 1; flex-direction: column; align-items: center; justify-content: center; - height: 100vh; } .create-party-button { diff --git a/webapp/src/components/game/singleplayer/GameSinglePlayer.tsx b/webapp/src/components/game/singleplayer/GameSinglePlayer.tsx index cbe6e73..ac5fb3a 100644 --- a/webapp/src/components/game/singleplayer/GameSinglePlayer.tsx +++ b/webapp/src/components/game/singleplayer/GameSinglePlayer.tsx @@ -78,7 +78,7 @@ const GameSinglePlayer = () => { }; return ( - + {currentStage === 1 && ()} {currentStage === 2 && ()} {currentStage === 3 && ( )} diff --git a/webapp/src/components/group/Group.scss b/webapp/src/components/group/Group.scss index 3182846..701081e 100644 --- a/webapp/src/components/group/Group.scss +++ b/webapp/src/components/group/Group.scss @@ -21,4 +21,45 @@ .group-button:hover { background-color: #0056b3; -} \ No newline at end of file +} + +.modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); /* Dark overlay with half opacity */ + display: flex; + justify-content: center; + align-items: center; + } + +.modal { + background-color: white; + padding: 20px; + border-radius: 8px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); /* Optional: Add a shadow effect */ + } + +.close-button { + background: none; + border: none; + cursor: pointer; + font-size: 16px; + color: #333; /* Example color */ +} + +.modal-header { + display: flex; + justify-content: space-between; + align-items: center; + } + +.close-button { + background: none; + border: none; + cursor: pointer; + font-size: 16px; + color: #333; /* Example color */ + } \ No newline at end of file diff --git a/webapp/src/components/group/GroupCreationModal.tsx b/webapp/src/components/group/GroupCreationModal.tsx index 6df262b..6571def 100644 --- a/webapp/src/components/group/GroupCreationModal.tsx +++ b/webapp/src/components/group/GroupCreationModal.tsx @@ -1,17 +1,19 @@ -import { useState, ChangeEvent } from 'react'; +import { useState, ChangeEvent, FC } from 'react'; import axios from 'axios'; import { Button, TextField, Grid, RadioGroup, FormControlLabel, Radio } from "@mui/material"; import { useTranslation } from 'react-i18next'; +import "./Group.scss" +import CloseModalIcon from '../util/CloseModalIcon'; const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; type ActionProps = { nowHasGroup:()=> void; setError:(error:any) => void; - closeModal:() => void; + toggleCreateModal: () => void } -export const CreationModal = (props: ActionProps) => { +export const CreationModal: FC = ({nowHasGroup, setError, toggleCreateModal}) => { const { t } = useTranslation(); const [isPublic, setPublic] = useState(true); const [groupName, setGroupName] = useState(''); @@ -22,10 +24,10 @@ export const CreationModal = (props: ActionProps) => { const createGroup = async () =>{ try{ await axios.post(`${apiEndpoint}/createGroup`, { groupName, creatorUUID, description, isPublic }).then( res => { - props.nowHasGroup(); + nowHasGroup(); }); }catch (error:any) { - props.setError(error.response.data.error); + setError(error.response.data.error); } } @@ -43,9 +45,14 @@ export const CreationModal = (props: ActionProps) => { }; return ( -
-
-

Create group

+
+
+
+

Create group

+ +

{t('create_group_group_name')}

@@ -83,8 +90,7 @@ export const CreationModal = (props: ActionProps) => { />
- - +
diff --git a/webapp/src/components/group/NoGroup.tsx b/webapp/src/components/group/NoGroup.tsx index 66d2079..a04a7bc 100644 --- a/webapp/src/components/group/NoGroup.tsx +++ b/webapp/src/components/group/NoGroup.tsx @@ -91,18 +91,35 @@ const NoGroup = (props: ActionProps) =>

{t('no_group_not_part')}

- - + +
{error && ( setError('')} message={`Error: ${error}`} data-testid="error-snackbar"/> )} {createModal && - () + () } {joinModal && (groupsCharged && ( -
-
+
+

{t('no_group_join_group')}

{groups.map((group) => ( diff --git a/webapp/src/components/util/CloseModalIcon.tsx b/webapp/src/components/util/CloseModalIcon.tsx new file mode 100644 index 0000000..28363b1 --- /dev/null +++ b/webapp/src/components/util/CloseModalIcon.tsx @@ -0,0 +1,21 @@ + +const CloseModalIcon = () => { + return ( + + + + + ); +} + +export default CloseModalIcon \ No newline at end of file diff --git a/webapp/src/pages/game/game-page.scss b/webapp/src/pages/game/game-page.scss index 2696ba2..fa3c27b 100644 --- a/webapp/src/pages/game/game-page.scss +++ b/webapp/src/pages/game/game-page.scss @@ -1,9 +1,9 @@ .game-page-container { display: flex; + flex: 1; flex-direction: column; align-items: center; justify-content: center; - height: 100vh; } .game-page-button { diff --git a/webapp/src/pages/groups/groups-page.scss b/webapp/src/pages/groups/groups-page.scss index 419a3ad..6a7404c 100644 --- a/webapp/src/pages/groups/groups-page.scss +++ b/webapp/src/pages/groups/groups-page.scss @@ -1,7 +1,7 @@ .groups-container{ display: flex; + flex: 1; flex-direction: column; align-items: center; justify-content: center; - height: 100vh; } \ No newline at end of file diff --git a/webapp/src/pages/userProfile/index.tsx b/webapp/src/pages/userProfile/index.tsx index a22c8ef..4b5dc96 100644 --- a/webapp/src/pages/userProfile/index.tsx +++ b/webapp/src/pages/userProfile/index.tsx @@ -7,6 +7,7 @@ import axios from 'axios'; const ProfilePage = () => { const { t } = useTranslation(); const apiEndpoint = process.env.REACT_APP_API_ENDPOINT || 'http://localhost:8000'; + console.log(process.env.REACT_APP_API_ENDPOINT) const uuid = localStorage.getItem('uuid'); const [profileInfo, setProfileInfo] = useState(null);