1
0
Fork 0
freesewing/sites/shared/components/workbench/menus/test-design-options/option.mjs

35 lines
966 B
JavaScript
Raw Normal View History

2023-05-11 19:14:48 +02:00
import { Li, SumButton, SumDiv } from 'shared/components/workbench/menus/index.mjs'
2022-02-12 15:23:37 +01:00
export const Option = (props) => {
const active = props.sampleSettings?.type === 'option' && props.active === props.option
2022-02-12 15:23:37 +01:00
2022-09-06 17:46:51 +02:00
const setSampleSettings = () => {
props.updateGist(
['sample'],
props.sampleSettings,
true // Close navigation on mobile
)
}
2022-02-13 15:45:27 +01:00
return (
<Li>
2022-09-06 17:46:51 +02:00
<SumButton onClick={setSampleSettings}>
2022-02-13 15:45:27 +01:00
<SumDiv active={active}>
<span
className={`
2022-02-13 15:45:27 +01:00
text-3xl inline-block p-0 leading-3 px-2
${
active
? 'text-secondary sm:text-secondary-focus translate-y-1 font-bold'
: 'translate-y-3'
2022-02-13 15:45:27 +01:00
}`}
>
{active ? <span>&bull;</span> : <span>&deg;</span>}
</span>
<span className={active ? 'text-secondary font-bold' : ''}>{props.label}</span>
2022-02-13 15:45:27 +01:00
</SumDiv>
</SumButton>
</Li>
)
2022-02-12 15:23:37 +01:00
}