Last active
June 28, 2019 12:43
-
-
Save zulnabil/d7a6d12d9788d8fcb09d160f6aaba85e to your computer and use it in GitHub Desktop.
Component PanelScoreboard
This file contains hidden or 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
import React from 'react' | |
import styled from 'styled-components' | |
import Score from './Score' | |
import Timer from './Timer' | |
import Foul from './Foul' | |
const Container = styled.div` | |
width: 500px; | |
margin: auto; | |
padding: 20px; | |
text-align: center; | |
` | |
const Panel = styled.div` | |
display: flex; | |
flex-direction: row; | |
justify-content: space-around; | |
` | |
function PanelScoreboard(props) { | |
const duration = 20 // in minutes | |
const fouls = [ | |
{ | |
point: 0 | |
}, | |
{ | |
point: 0 | |
}, | |
] | |
const { teams } = props | |
return ( | |
<Container> | |
<Panel> | |
{teams.map((team) => { | |
return ( | |
<Score team={team} /> | |
) | |
})} | |
</Panel> | |
<Timer duration={duration} /> | |
<h4>FOULS</h4> | |
<Panel> | |
{fouls.map((foul) => { | |
return ( | |
<Foul point={foul.point} /> | |
) | |
})} | |
</Panel> | |
</Container> | |
) | |
} | |
export default PanelScoreboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment