/** * A collection of popular layouts and patterns made with CSS (https://csslayout.io) * (c) 2019 - 2021 Nguyen Huu Phuoc */ import * as React from 'react'; import { Helmet } from 'react-helmet'; import RelatedPatterns from '../../components/RelatedPatterns'; import Pattern from '../../constants/Pattern'; import DetailsLayout from '../../layouts/DetailsLayout'; import BrowserFrame from '../../placeholders/BrowserFrame'; const Details: React.FC<{}> = () => { const [value, setValue] = React.useState(900); const decrease = () => setValue(value - 1); const increase = () => setValue(value + 1); return (
...
`} css={` .voting { border: 1px solid rgba(0, 0, 0, 0.3); border-radius: 0.25rem; display: flex; flex-direction: column; height: 8rem; } .voting__button { /* Reset */ background: none; border: none; cursor: pointer; /* Size */ height: 1rem; /* Position the triangle */ position: relative; } .voting__triangle { border-style: solid; /* Size */ height: 0; width: 0; } .voting__triangle--up { border-color: transparent transparent rgba(0, 0, 0, 0.3); border-width: 0 0.5rem 0.5rem; } .voting__triangle--down { border-color: rgba(0, 0, 0, 0.3) transparent transparent; border-width: 0.5rem 0.5rem 0px; } .voting__number { /* Take the available height */ flex: 1; /* Center the number */ align-items: center; display: flex; justify-content: center; /* Spacing */ padding: 0.25rem; } `} >
{value}
); }; export default Details;