import styled from 'styled-components'; const PlusOneStyles = styled.div` display: grid; gap: 1rem; .plusone__names { display: grid; gap: 1.2rem; } .checkbox { display: grid; grid-template-columns: min-content auto; align-items: center; align-content: center; gap: 0.5rem; font-size: 2rem; .checkbox__input { display: grid; grid-template-areas: 'checkbox'; > * { grid-area: checkbox; } } .checkbox__input input:checked + .checkbox__control svg { transform: scale(1); } .checkbox__input input:focus + .checkbox__control { box-shadow: var(--level-2-primary); } .checkbox__control { display: inline-grid; width: 1em; height: 1em; border-radius: 0.1em; border: 0.1em solid var(--lightViolet); svg { transition: transform 0.1s ease-in 25ms; transform: scale(0); transform-origin: bottom left; } } input[type='checkbox'] { opacity: 0; width: 1em; height: 1em; } } `; export default function PlusOneRSVP({ guest, inputs, handleChange }) { function onChangePlusOne(e) { handleChange({ target: { value: !inputs[`${guest.id}`].plusOne, name: `${guest.id}_plusOne`, type: 'text', }, }); } return ( {inputs[`${guest.id}`].plusOne && (
)}
); }