parent
66a53765dc
commit
46b80b8e6c
@ -0,0 +1,30 @@ |
|||||||
|
import { |
||||||
|
MainScore, |
||||||
|
ScoreWrapper, |
||||||
|
PenaltyScore, |
||||||
|
} from './styled' |
||||||
|
|
||||||
|
type Props = { |
||||||
|
penaltyScore?: number | null, |
||||||
|
score?: number | null, |
||||||
|
showScore: boolean, |
||||||
|
} |
||||||
|
|
||||||
|
export const Score = ({ |
||||||
|
penaltyScore, |
||||||
|
score, |
||||||
|
showScore, |
||||||
|
}: Props) => { |
||||||
|
if (!showScore) return null |
||||||
|
|
||||||
|
return ( |
||||||
|
<ScoreWrapper> |
||||||
|
<MainScore> |
||||||
|
{score} |
||||||
|
</MainScore> |
||||||
|
<PenaltyScore> |
||||||
|
{penaltyScore} |
||||||
|
</PenaltyScore> |
||||||
|
</ScoreWrapper> |
||||||
|
) |
||||||
|
} |
||||||
@ -0,0 +1,31 @@ |
|||||||
|
import styled, { css } from 'styled-components/macro' |
||||||
|
|
||||||
|
import { isMobileDevice } from 'config/userAgent' |
||||||
|
|
||||||
|
export const MainScore = styled.div` |
||||||
|
|
||||||
|
${isMobileDevice |
||||||
|
? css` |
||||||
|
display: flex; |
||||||
|
justify-content: center; |
||||||
|
` |
||||||
|
: ''}; |
||||||
|
` |
||||||
|
|
||||||
|
export const ScoreWrapper = styled.div` |
||||||
|
display: flex; |
||||||
|
line-height: 1; |
||||||
|
` |
||||||
|
|
||||||
|
export const PenaltyScore = styled.div` |
||||||
|
font-weight: 400; |
||||||
|
font-size: .55rem; |
||||||
|
margin-left: 1px; |
||||||
|
|
||||||
|
${isMobileDevice |
||||||
|
? css` |
||||||
|
font-size: 10px; |
||||||
|
` |
||||||
|
: ''}; |
||||||
|
` |
||||||
|
|
||||||
Loading…
Reference in new issue