use styled-jsx in StoreView
This commit is contained in:
parent
5c01be8b2e
commit
3651936497
@ -11,7 +11,7 @@ const StoreView: FunctionComponent<{
|
||||
pitViewModel: PitViewModel;
|
||||
gridColumn: string;
|
||||
gridRow: string;
|
||||
}> = ({ context, pitViewModel, gridColumn, gridRow }) => {
|
||||
}> = ({ context, pitViewModel, gridColumn, gridRow }) => {
|
||||
const stones = [...Util.range(pitViewModel.stoneCount)].map((i, index) => (
|
||||
<StoneView key={index} color={pitViewModel.stoneColor} />
|
||||
));
|
||||
@ -22,35 +22,37 @@ const StoreView: FunctionComponent<{
|
||||
);
|
||||
return (
|
||||
<div
|
||||
className="store"
|
||||
style={{
|
||||
gridColumn: gridColumn,
|
||||
gridRow: gridRow,
|
||||
background: pitViewModel.pitColor,
|
||||
margin: "5px",
|
||||
borderRadius: "10vw",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
alignContent: "center",
|
||||
flexWrap: "wrap",
|
||||
position: "relative",
|
||||
}}
|
||||
>
|
||||
gridColumn: gridColumn,
|
||||
gridRow: gridRow
|
||||
}}>
|
||||
{stones}
|
||||
<span
|
||||
style={{
|
||||
position: "absolute",
|
||||
bottom: "2vw",
|
||||
fontFamily: "monospace",
|
||||
fontWeight: "bold",
|
||||
fontSize: "2vw",
|
||||
color: textColor,
|
||||
}}
|
||||
>
|
||||
<span className="store-stone-count-text" style={{ color: textColor }}>
|
||||
{stones.length}
|
||||
</span>
|
||||
<style jsx>{`
|
||||
.store {
|
||||
margin: 5px;
|
||||
border-radius: 10vw;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
}
|
||||
.store-stone-count-text {
|
||||
position: absolute;
|
||||
bottom: 2vw;
|
||||
font-family: monospace;
|
||||
font-weight: bold;
|
||||
font-size: 2vw;
|
||||
}
|
||||
`}</style>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
export default StoreView;
|
||||
export default StoreView;
|
||||
Loading…
Reference in New Issue
Block a user