Created
June 28, 2019 12:54
-
-
Save zulnabil/c175bd2794f7f27ea6b658fbb50a5339 to your computer and use it in GitHub Desktop.
Component ScoreBoard
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 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