Skip to content

Instantly share code, notes, and snippets.

@zulnabil
Created June 28, 2019 12:54
Show Gist options
  • Select an option

  • Save zulnabil/c175bd2794f7f27ea6b658fbb50a5339 to your computer and use it in GitHub Desktop.

Select an option

Save zulnabil/c175bd2794f7f27ea6b658fbb50a5339 to your computer and use it in GitHub Desktop.
Component ScoreBoard
import React from 'react'
import styled from 'styled-components'
import PanelScoreboard from './PanelScoreboard'
import InputTeam from './InputTeam'
const PanelScore = styled.div`
display: ${props => props.ready ? 'block' : 'none'}
`
const Container = styled.div`
margin: auto;
padding: 20px;
text-align: center;
`
function ScoreBoard() {
const [teams, setTeams] = React.useState([])
const [ready, setReady] = React.useState(false)
return (
<Container>
<InputTeam ready={ready} setReady={setReady} teams={teams} setTeams={setTeams} />
<PanelScore ready={ready}>
<PanelScoreboard teams={teams} />
</PanelScore>
</Container>
)
}
export default ScoreBoard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment