-
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
4534998
commit 04ba42f
Showing
13 changed files
with
262 additions
and
140 deletions.
There are no files selected for viewing
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,15 @@ | ||
import { NavBar } from "../NavBar"; | ||
import { ReactNode } from "react"; | ||
|
||
type ReactChildren = { | ||
children: ReactNode; | ||
} | ||
|
||
export default function AppWrapper({children}:ReactChildren){ | ||
return( | ||
<> | ||
<NavBar /> | ||
{children} | ||
</> | ||
); | ||
} |
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 |
---|---|---|
|
@@ -17,4 +17,10 @@ | |
font-size: 1.5rem; | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 800px) { | ||
.completedChallenges { | ||
margin: 2rem 0; | ||
} | ||
} |
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
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,59 @@ | ||
import styles from './styles.module.scss'; | ||
|
||
type LeaderBoard = { | ||
name: string; | ||
avatar: string; | ||
level: number; | ||
experience: number; | ||
challengesCompleted: number; | ||
} | ||
|
||
type LeaderBoardProps = { | ||
leaderboard: LeaderBoard[] | null; | ||
} | ||
|
||
|
||
export function Table({leaderboard}:LeaderBoardProps){ | ||
return( | ||
<table className={styles.leaderboardTable}> | ||
<thead> | ||
<tr> | ||
<th>Posição</th> | ||
<th>Usuário</th> | ||
<th>Desafios</th> | ||
<th>Experiência</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{leaderboard?.map((user,index)=>( | ||
<tr key={index}> | ||
|
||
<td>{index+1}</td> | ||
|
||
<td className={styles.profile}> | ||
<img src={user.avatar} alt={user.name} /> | ||
<div> | ||
<strong>{user.name}</strong> | ||
<div> | ||
<img src="icons/Up.svg" alt="Up" /> | ||
<span>Level {user.level}</span> | ||
</div> | ||
</div> | ||
</td> | ||
|
||
<td> | ||
<span>{user.challengesCompleted}</span> | ||
completados | ||
</td> | ||
|
||
<td> | ||
<span>{user.experience}</span> | ||
xp | ||
</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
); | ||
} |
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,117 @@ | ||
.leaderboardTable { | ||
width: 100%; | ||
border-collapse: collapse; | ||
font-family: 'Inter', sans-serif; | ||
font-weight: 500; | ||
|
||
td, th { | ||
padding: 0.5rem 1rem; | ||
} | ||
|
||
td { | ||
height: 4.5rem; | ||
} | ||
|
||
th { | ||
color: var(--text); | ||
text-align: left; | ||
} | ||
|
||
tbody { | ||
|
||
tr { | ||
background-color: var(--white); | ||
border-bottom: 7px solid #f2f3f5; | ||
|
||
td { | ||
|
||
&:first-child{ | ||
text-align: center; | ||
font-size: 1.5rem; | ||
color: var(--text); | ||
border-right: 7px solid #f2f3f5; | ||
width: 4rem; | ||
} | ||
|
||
&.profile { | ||
width: 20rem; | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
|
||
> img { | ||
width: 3rem; | ||
height: 3rem; | ||
border-radius: 50%; | ||
} | ||
|
||
> div { | ||
flex: 1; | ||
|
||
strong { | ||
display: block; | ||
margin-bottom: 0.3rem; | ||
color: var(--title); | ||
} | ||
|
||
> div { | ||
display: flex; | ||
|
||
span { | ||
font-size: 0.975rem; | ||
margin-left: 0.4rem; | ||
color: var(--text); | ||
font-weight: 400; | ||
} | ||
} | ||
} | ||
} | ||
|
||
> span{ | ||
color: var(--blue); | ||
margin-right: 0.4rem; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
@media screen and (max-width: 800px) { | ||
.leaderboardTable { | ||
overflow: hidden; | ||
border-radius: 5px; | ||
|
||
thead { | ||
display: none; | ||
} | ||
|
||
tbody { | ||
|
||
tr { | ||
width: 90vw; | ||
display: flex; | ||
flex-wrap: wrap; | ||
border-radius: 5px; | ||
margin-bottom: 10px; | ||
border: none; | ||
|
||
td { | ||
width: 50%; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&:first-child { | ||
border-bottom: 7px solid #f2f3f5; | ||
border-bottom-right-radius: 5px; | ||
} | ||
|
||
&.profile { | ||
width: initial; | ||
} | ||
|
||
} | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.
04ba42f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: