feat: add front leaderboard

This commit is contained in:
RoxanneRlld
2024-02-13 07:05:10 +01:00
committed by alexis
parent 4b9a59ed12
commit 232aae14a8
3 changed files with 126 additions and 3 deletions
+2 -2
View File
@@ -22,6 +22,7 @@ import Logo from './assets/logo';
import './App.scss';
import Question from './assets/question';
import Home from './components/Home/Home';
import LeaderBoard from './components/Leaderboard/leaderboard';
// ---------------------------------------------------------------------------------------------------------------------
const App = () => {
@@ -51,9 +52,8 @@ const App = () => {
}}
/>
)} */}
<header className='App-header'>
<Home />
</header>
{/* <LeaderBoard /> */}
</div>
);
};
@@ -0,0 +1,51 @@
import React from 'react';
import './styles.scss';
const arrayBoard = [
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
{ date: '12/06/2014', time: '1.06' },
];
const LeaderBoard = () => {
return (
<div className='boardContainer'>
<p className='titleBoard'>Time Leaderboard</p>
<div className='completeBoard'>
<div className='lineInfo'>
<p className='infoDate'>Day</p>
<p className='infoScore'>Time</p>
</div>
<div className='containerLittle'>
{arrayBoard.map((item, index) => {
return (
<div
className='lineBoard'
key={index}
>
<p className='blockDate'>{item.date}</p>
<p className='blockScore'>{item.time}</p>
</div>
);
})}
;
</div>
</div>
</div>
);
};
export default LeaderBoard;
+72
View File
@@ -0,0 +1,72 @@
.boardContainer {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
}
.titleBoard {
font-size: 1.5rem;
margin-bottom: 1rem;
font-weight: bold;
}
.completeBoard {
display: flex;
flex-direction: column;
gap: 1em;
border: 2px solid #fff;
border-radius: 5px;
padding: 15px;
background-color: #fff;
width: 100%;
max-width: 400px;
}
.containerLittle {
overflow: scroll;
height: 100%;
max-height: 350px;
gap: 1em;
}
.lineInfo {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
border: 1.5px solid #fff;
border-radius: 3px;
padding: 10px;
background-color: #333;
color: #fff;
font-weight: 400;
}
.infoDate {
margin-left: 10px;
}
.infoScore {
text-align: right;
margin-right: 10px;
}
.lineBoard {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
border: 1.5px solid #fff;
margin-bottom: 10px;
border-radius: 3px;
padding: 5px;
background-color: #e1e1e1;
color: #333;
font-weight: 400;
}
.blockScore {
text-align: right;
}