Skip to content

Instantly share code, notes, and snippets.

@zulnabil
Last active June 28, 2019 12:43
Show Gist options
  • Save zulnabil/d7a6d12d9788d8fcb09d160f6aaba85e to your computer and use it in GitHub Desktop.
Save zulnabil/d7a6d12d9788d8fcb09d160f6aaba85e to your computer and use it in GitHub Desktop.
Component PanelScoreboard
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