Skip to content

Commit

Permalink
chore: remove useless RelationshipCheckboxWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
pfferrari committed Aug 16, 2023
1 parent b1bfd2b commit 4c6cde1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 45 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,19 @@ export function Checkbox({
const isLoading = item.value === '' // is mock
return (
<SkeletonTemplate isLoading={isLoading} delayMs={0}>
<InputCheckbox
onChange={onChange}
checked={checked}
icon={
showIcon != null && showIcon ? (
<AvatarLetter text={item.label} />
) : undefined
}
>
<Text weight='semibold'>{item.label}</Text>
</InputCheckbox>
<div className='p-3 hover:bg-gray-50 mb-[1px] last:mb-0'>
<InputCheckbox
onChange={onChange}
checked={checked}
icon={
showIcon != null && showIcon ? (
<AvatarLetter text={item.label} />
) : undefined
}
>
<Text weight='semibold'>{item.label}</Text>
</InputCheckbox>
</div>
</SkeletonTemplate>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SkeletonTemplate } from '#ui/atoms/SkeletonTemplate'
import { Spacer } from '#ui/atoms/Spacer'
import { Text } from '#ui/atoms/Text'
import { SearchBar } from '#ui/composite/SearchBar'
import { RelationshipCheckboxWrapper } from '#ui/internals/RelationshipCheckboxWrapper'
import { ResourceList } from '#ui/resources/ResourceList'
import { type ListableResourceType } from '@commercelayer/sdk/lib/cjs/api'
import { type QueryFilter } from '@commercelayer/sdk/lib/cjs/query'
Expand Down Expand Up @@ -157,16 +156,14 @@ export function FullList({
fieldForValue
})
return (
<RelationshipCheckboxWrapper>
<Checkbox
item={item}
checked={values.includes(item.value)}
onChange={() => {
toggleValue(item.value)
}}
showIcon={showCheckboxIcon}
/>
</RelationshipCheckboxWrapper>
<Checkbox
item={item}
checked={values.includes(item.value)}
onChange={() => {
toggleValue(item.value)
}}
showIcon={showCheckboxIcon}
/>
)
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Card } from '#ui/atoms/Card'
import { SkeletonTemplate } from '#ui/atoms/SkeletonTemplate'
import { Spacer } from '#ui/atoms/Spacer'
import { Text } from '#ui/atoms/Text'
import { RelationshipCheckboxWrapper } from '#ui/internals/RelationshipCheckboxWrapper'
import { type QueryParamsList } from '@commercelayer/sdk'
import type { ListableResourceType } from '@commercelayer/sdk/lib/cjs/api'
import { type QueryFilter } from '@commercelayer/sdk/lib/cjs/query'
Expand Down Expand Up @@ -108,16 +107,15 @@ export function RelationshipSelector({
<Card gap='1'>
{list.map((item, idx) => {
return (
<RelationshipCheckboxWrapper key={`${item.value}-${idx}`}>
<Checkbox
item={item}
checked={values.includes(item.value)}
onChange={() => {
toggleValue(item.value)
}}
showIcon={showCheckboxIcon}
/>
</RelationshipCheckboxWrapper>
<Checkbox
key={`${item.value}-${idx}`}
item={item}
checked={values.includes(item.value)}
onChange={() => {
toggleValue(item.value)
}}
showIcon={showCheckboxIcon}
/>
)
})}
</Card>
Expand Down

0 comments on commit 4c6cde1

Please sign in to comment.