Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #51

Merged
merged 44 commits into from
Mar 12, 2024
Merged

Dev #51

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
196b80f
Added the SASS dependency
AlvaroIC Mar 5, 2024
501b5ab
Migrated existing css files and references to SASS
AlvaroIC Mar 5, 2024
7cdda22
SASS variables for the font stacks
AlvaroIC Mar 5, 2024
b739ec9
Files for the design tokens
AlvaroIC Mar 5, 2024
28222b1
Unified design tokens files
AlvaroIC Mar 5, 2024
e0d761a
Application colors stablished and added to design tokens
AlvaroIC Mar 5, 2024
07e07b6
Font stacks added to design tokens
AlvaroIC Mar 5, 2024
0067f5c
Added application media query breakpoints to design tokens
AlvaroIC Mar 6, 2024
400fb94
Corrected SASS syntax error at design tokens
AlvaroIC Mar 6, 2024
e5303c7
Unused declaration removed
AlvaroIC Mar 8, 2024
6524717
Merge branch 'migrate-css-to-sass' into front-end
AlvaroIC Mar 9, 2024
e4a0050
Migrating navbar from CSS to SASS
AlvaroIC Mar 9, 2024
9d91b37
Improved translation
AlvaroIC Mar 9, 2024
e37c17c
Changed application title
AlvaroIC Mar 9, 2024
6f2ed79
New favicon
AlvaroIC Mar 9, 2024
c2a31e2
Deleted useless files and updated the manifest.json file
AlvaroIC Mar 10, 2024
39aa9ae
Another change in the dictionary
AlvaroIC Mar 10, 2024
248b870
Change in entry name
AlvaroIC Mar 10, 2024
5da48b5
Changed Register page style and deleted useless entries
AlvaroIC Mar 10, 2024
5a495ca
Spacing removed
AlvaroIC Mar 10, 2024
2bd21fe
Grouped components for testing and styling and fixed issues in Regist…
AlvaroIC Mar 10, 2024
adf127f
Files for styling and testing
AlvaroIC Mar 10, 2024
2d55b28
Fixed comment style error at Router.tsx
AlvaroIC Mar 10, 2024
cb7d8ae
Deleted useless comments
AlvaroIC Mar 10, 2024
473ce84
Improved code style
AlvaroIC Mar 10, 2024
c0dc510
Spacing in the navbar
AlvaroIC Mar 11, 2024
00836ed
Futher changes in spacing and useless CSS rule
AlvaroIC Mar 11, 2024
5667a3e
Changed the navbar's height
AlvaroIC Mar 11, 2024
5e895af
Error fixed at login
AlvaroIC Mar 11, 2024
3de9c3f
Renamed class according to conventions
AlvaroIC Mar 11, 2024
92a8768
Centered buttons at init and files for styling and testing pages
AlvaroIC Mar 11, 2024
1f4b5f9
Useless import removed
AlvaroIC Mar 11, 2024
23f2a9d
Spacing in initial views
AlvaroIC Mar 11, 2024
e54ef19
Spacing in register and login views
AlvaroIC Mar 11, 2024
3266da5
Button to navigate to the profile section from the navbar
AlvaroIC Mar 11, 2024
fcab8e7
Profile page
AlvaroIC Mar 11, 2024
5af0559
Basic dynamic page title
AlvaroIC Mar 12, 2024
a824d47
Advanced dynamic title
AlvaroIC Mar 12, 2024
91af06c
Updated user model to match with dev
AlvaroIC Mar 12, 2024
e04e66b
Further updating user service to match that in dev and correcting sty…
AlvaroIC Mar 12, 2024
b06e7d8
Extended profile page
AlvaroIC Mar 12, 2024
a6e3020
Merge remote-tracking branch 'origin/dev' into front-end
AlvaroIC Mar 12, 2024
eb8ca22
small changes navbar
pelazas Mar 12, 2024
f833d3d
Merge pull request #50 from Arquisoft/front-end
pelazas Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions users/userservice/util/ValidateUUID.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

function isValidUuidV4(uuidString) {
const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
return regex.test(uuidString);
}

module.exports = isValidUuidV4;
const regex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
return regex.test(uuidString);
}
module.exports = isValidUuidV4;
24 changes: 24 additions & 0 deletions webapp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"mongodb-memory-server": "^9.1.4",
"puppeteer": "^2.1.1",
"react-i18next": "^11.6.0",
"sass": "^1.71.1",
"serve": "^14.2.1",
"start-server-and-test": "^2.0.3",
"typescript": "4.9.5"
Expand Down
Binary file modified webapp/public/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion webapp/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Conocer y Vencer</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file removed webapp/public/logo192.png
Binary file not shown.
Binary file removed webapp/public/logo512.png
Binary file not shown.
14 changes: 2 additions & 12 deletions webapp/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "Conocer y Vencer",
"name": "Conocer y Vencer: a Web-based Saber y Ganar-style game",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions webapp/src/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const AppRouter: React.FC<{}> = () => {
return (
<Routes>
<Route element={<RouterLayout />}>
/* when accessing /game or the other paths, it will be shown as the
outlet inside the RouterLayout*/
{ /* When accessing /game or the other paths, it will be shown as the
outlet inside RouterLayout*/ }
<Route path="/game" element={<GamePage />} />
<Route path="/groups" element={<GroupsPage />} />
<Route path="/scoreboard" element={<ScoreboardPage />} />
Expand Down
51 changes: 41 additions & 10 deletions webapp/src/common/Nav.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import React, { useState } from 'react';
import './nav.css';
import React, { useState, useEffect } from 'react';
import { useLocation } from 'react-router-dom';
import './nav.scss';
import { useTranslation } from 'react-i18next';
import {AppBar, Container, Toolbar, Grid, Stack, Button, Menu, MenuItem} from "@mui/material";
import { useNavigate } from "react-router-dom";

const NavBar: React.FC<{}> = () => {
const NavBar: React.FC<{}> = () =>
{
const location = useLocation();
const { t } = useTranslation();
const navigate = useNavigate();
const value :string= JSON.stringify( localStorage.getItem("isAuthenticated")).replace("\"","").replace("\"","");
Expand All @@ -23,15 +26,42 @@ const NavBar: React.FC<{}> = () => {
navigate("/");
}

useEffect(() => {
switch (location.pathname) {
case '/game':
document.title = 'Conocer y Vencer - Game';
break;
case '/groups':
document.title = 'Conocer y Vencer - Groups';
break;
case '/scoreboard':
document.title = 'Conocer y Vencer - Scoreboard';
break;
case '/profile':
document.title = 'Conocer y Vencer - Profile';
break;
default:
document.title = 'Conocer y Vencer';
}
}, [location.pathname]);

return (
<AppBar className="nav_appBar">
<AppBar className="nav-appBar" sx={
{
display: 'flex',
flexDirection: 'row',
flexWrap: 'nowrap',
alignItems: 'flex-start',
justifyContent: 'flex-start'
}
}>
<Toolbar>
<Container maxWidth="xl">
<Grid
container
direction="row"
alignItems="center"
justifyContent="space-between"
spacing={4}
>
<Grid item className="logo">
{t('app_name')}
Expand All @@ -47,20 +77,21 @@ const NavBar: React.FC<{}> = () => {
<Button variant="contained" onClick={() => navigate("/scoreboard")}>
{t('nav_scoreboard')}
</Button>
</Stack>
</Grid>
<Grid >
<Grid >
<Button variant="text"
id="menu-button"
color='inherit'
onClick={handleClick}
aria-control={open? 'menu' : undefined}
aria-controls={open? 'menu' : undefined}
aria-haspopup='true' aria-expanded={open? 'true' : undefined}>
{user}
</Button>
</Grid>
</Stack>

</Grid>

</Grid>

<Menu id="menu" open={open} MenuListProps={{'aria-labelledby':'menu-button'}}
onClose={()=>handleClose()} anchorEl={anchorEl}>
<MenuItem onClick={()=> navigate("/profile")}>My account</MenuItem>
Expand Down
30 changes: 0 additions & 30 deletions webapp/src/common/nav.css

This file was deleted.

21 changes: 21 additions & 0 deletions webapp/src/common/nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.navbar {
width:100%;
height: 50px;
display: flex;
align-items: center;
}

.nav-appBar{
height: 65px;
background: #D9D9D9;
position: fixed;
}

.logo{
font-weight: 500;
font-size: xx-large;
}

.link{
text-decoration: none;
}
25 changes: 0 additions & 25 deletions webapp/src/components/Init.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions webapp/src/components/ScoreBoard.tsx

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

import { GoogleLogin } from '@react-oauth/google';
import './GLoginButton.scss';

const GLoginButton = () => {

const GLoginButton = () =>
{
return(
<GoogleLogin
onSuccess={(credentialResponse) => {
onSuccess={(credentialResponse) =>
{
console.log(credentialResponse);
}}
onError={() => {
onError={() =>
{
console.log('Login Failed');
}}
/>)
Expand Down
Empty file.
Empty file.
1 change: 1 addition & 0 deletions webapp/src/components/g-logout-button/GLogoutButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './GLogoutButton.scss';
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { useState } from "react";
import Game from "./game/Game";
import Group from "./Group";
import Scoreboard from "./ScoreBoard";
import Game from "../game/Game";
import Group from "../group/Group";
import Scoreboard from "../scoreboard/Scoreboard";


const GameLayout = () => {

const [currentView, setCurrentView] = useState("Game");



return(


<head className="GameHead">
<nav className="GameNav">
<ul>
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import './Group.scss';


const Group=()=>{

const Group = () =>
{
return(
<div>
<h1>Group</h1>
Expand Down
Empty file.
Empty file.
34 changes: 34 additions & 0 deletions webapp/src/components/init/Init.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import {Button, Stack} from "@mui/material";
import GLoginButton from '../g-login-button/GLoginButton';
import './Init.scss';

type ActionProps = {
changeView:(arg:boolean)=> void;
}

const Init = (props:ActionProps) =>{
const { t } = useTranslation()
const [, setCurrentView] = useState<'register' | 'login'>('register');

const handleViewChange = (isLoginView: boolean) => {
setCurrentView(isLoginView ? 'login' : 'register');
props.changeView(isLoginView);
document.title = isLoginView ? t('Conocer y Vencer - Login') : t('Conocer y Vencer - Register');
};

return (
<Stack direction="column">
<Button onClick={() => handleViewChange(false)} size='large'>
{t('register')}
</Button>
<Button onClick={() => handleViewChange(true)} size='large' sx={{ marginBottom: 2 }}>
{t('login')}
</Button>
<GLoginButton />
</Stack>
);
};

export default Init;
Empty file.
Empty file.
Loading
Loading