Skip to content

Commit

Permalink
Fix boolean segment controls
Browse files Browse the repository at this point in the history
  • Loading branch information
gbalint committed Jun 4, 2024
1 parent 14e18ee commit bea051c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app/routes/products.$handle/sections/reviews.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function Reviews({ data }) {
<Flex direction='row' justify='end'>
<Flex
direction='down'
wrap='true'
wrap
align='end'
maxHeight
maxWidth
Expand Down
45 changes: 11 additions & 34 deletions utopia/layout.utopia.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ import {
} from '@h2/new/Layout'
import { DefaultTextContents } from './text.utopia.js'

export const BooleanSegmentControl = Utopia.radioControl([
export const BooleanSegmentControlOptions = [
{
label: 'Yes',
value: 'true',
value: true,
},
{
label: 'No',
value: 'false',
value: false,
},
])
]

export const BooleanSegmentControl = Utopia.radioControl(
BooleanSegmentControlOptions,
)

const RowWithPlaceholdersVariant = {
label: 'Flex row with placeholders',
Expand Down Expand Up @@ -230,30 +234,12 @@ const annotations = {
maxHeight: {
control: 'radio',
label: 'Max Height',
options: [
{
label: 'Yes',
value: 'true',
},
{
label: 'No',
value: 'false',
},
],
options: BooleanSegmentControlOptions,
},
maxWidth: {
control: 'radio',
label: 'Max Width',
options: [
{
label: 'Yes',
value: 'true',
},
{
label: 'No',
value: 'false',
},
],
options: BooleanSegmentControlOptions,
},
},
focus: 'never',
Expand Down Expand Up @@ -394,16 +380,7 @@ const annotations = {

marginBottom: {
control: 'radio',
options: [
{
label: 'Yes',
value: 'true',
},
{
label: 'No',
value: 'false',
},
],
options: BooleanSegmentControlOptions,
label: 'Bottom margin',
folder: 'Margin',
},
Expand Down

0 comments on commit bea051c

Please sign in to comment.