-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
efba061
commit eb97122
Showing
31 changed files
with
1,487 additions
and
175 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import {UserService } from '../../services/UserService'; | ||
import {useNavigate} from 'react-router-dom'; | ||
|
||
import './ProfileGameList.scss'; | ||
|
||
import notAvailableIcon from '../../resources/cross.svg'; | ||
|
||
export default function ProfileGameList({ user }) { | ||
const navigate = useNavigate(); | ||
const [games, setGames] = useState([]); | ||
const [loading, setLoading] = useState(true); | ||
|
||
useEffect(() => { | ||
UserService.getGamesForPlayer(user.id).then((response) => { | ||
console.log(response); | ||
setGames(response.data.data); | ||
console.log(games); | ||
setLoading(false); | ||
}).catch((error) => { | ||
console.log(error); | ||
}); | ||
}, [user.id]); | ||
|
||
const handleGameElementClick = (gameId) => { | ||
return () => navigate(`/games/details/${gameId}`); | ||
}; | ||
|
||
return ( | ||
<div className="user-info-table"> | ||
<div className="user-info-table-content"> | ||
{loading ? ( | ||
<p>Loading...</p> | ||
) : ( | ||
<> | ||
{games.map((game, index) => ( | ||
<div className={`${(index % 2) ? 'light' : 'dark'} game-list-element-container`} | ||
key={game.id} | ||
onClick={handleGameElementClick(game.id)}> | ||
<p className="game-list-element-name"> | ||
{game.gameFileName} | ||
</p> | ||
<p className="game-list-element-date"> | ||
{game.lastModificatiosn} | ||
</p> | ||
<div className="game-list-element-availability"> | ||
{game.isAvailableForPlay || ( | ||
<img className="not-available-icon" src={notAvailableIcon} alt="Not available" /> | ||
)} | ||
</div> | ||
</div> | ||
))} | ||
</>)} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
.user-info-table { | ||
height: 100%; | ||
.user-info-table-content { | ||
overflow-y: scroll; | ||
.game-list-element-container { | ||
display: grid; | ||
grid-template-columns: max-content auto 15px; | ||
padding: 2px 5px; | ||
|
||
.game-list-element-availability { | ||
overflow: hidden; | ||
display: flex; | ||
.not-available-icon { | ||
top: 0; | ||
width: 100%; | ||
aspect-ratio: 1; | ||
} | ||
} | ||
|
||
p { | ||
font-size: 20px; | ||
transition: all 0.3s ease; | ||
} | ||
|
||
p:hover { | ||
cursor: pointer; | ||
text-shadow: #309e00 0px 0px 5px; | ||
color: #79ec48; | ||
} | ||
} | ||
|
||
.light { | ||
background-color: #222222; | ||
} | ||
|
||
.dark { | ||
background-color: #080808; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
.user-achivments-container { | ||
position: relative; | ||
margin-bottom: 10px; | ||
vertical-align: middle; | ||
} | ||
|
||
.user-achivments-container-content { | ||
position: relative; | ||
z-index: 100; | ||
height: 100%; | ||
padding: 10px; | ||
} | ||
|
||
.user-achivments-background { | ||
color:#222222; | ||
background-color: #111111; | ||
position: absolute; | ||
z-index: 10; | ||
width: 100%; | ||
top: 0; | ||
left: 0; | ||
padding: 10px; | ||
} | ||
|
||
.user-achivments-background-text { | ||
text-shadow: 0px 0px 10px #000000; | ||
float: right; | ||
user-select: none; | ||
} | ||
|
||
.user-achivments-scroll { | ||
overflow-x: scroll; | ||
overflow-y: hidden; | ||
height: 100%; | ||
user-select: none; | ||
display: flex; | ||
flex-wrap: nowrap; | ||
justify-content: flex-start; | ||
flex-shrink: 0; | ||
} | ||
|
||
|
||
.user-achivments-container-content > ::-webkit-scrollbar { | ||
background: #222222; | ||
height: 5px; | ||
} | ||
|
||
.user-achivments-container-content > ::-webkit-scrollbar-track { | ||
background: #090909; | ||
} | ||
|
||
.user-achivments-container-content > ::-webkit-scrollbar-thumb { | ||
background: #002200; | ||
border-radius: 5px; | ||
} | ||
|
||
.user-achivments-container-content > ::-webkit-scrollbar-thumb:hover { | ||
background: #006000; | ||
} | ||
|
||
.user-achivments-icon { | ||
height: 30px; | ||
width: auto; | ||
|
||
min-width: 30px; | ||
} | ||
|
||
.user-achivments-icon-container { | ||
margin: 5px; | ||
padding: 0px 10px 0px 10px; | ||
width: fit-content; | ||
border-radius: 50%; | ||
display: inline-block; | ||
transition: all 0.3s ease; | ||
} | ||
|
||
.user-achivments-icon-container:hover { | ||
cursor: pointer; | ||
background: rgb(170, 170, 170, 0.5); | ||
} |
Oops, something went wrong.