Skip to content

Commit

Permalink
fix: add skeleton to lineItemOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomontalbano committed Aug 11, 2023
1 parent be911a5 commit ca5336f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions packages/app-elements/src/ui/resources/LineItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,13 @@ export const LineItems = withSkeletonTemplate<{
>
{hasLineItemOptions && (
<LineItemOptions
delayMs={0}
lineItemOptions={lineItem.line_item_options}
/>
)}
{hasBundle && <Bundle code={lineItem.bundle_code} />}
{hasBundle && (
<Bundle delayMs={0} code={lineItem.bundle_code} />
)}
{isEditable && <Edit item={lineItem} onChange={onChange} />}
</td>
</tr>
Expand Down Expand Up @@ -285,11 +288,9 @@ export const LineItems = withSkeletonTemplate<{

LineItems.displayName = 'LineItems'

const LineItemOptions = ({
lineItemOptions
}: {
const LineItemOptions = withSkeletonTemplate<{
lineItemOptions: LineItem['line_item_options']
}): JSX.Element | null => {
}>(({ lineItemOptions }) => {
if (lineItemOptions == null || lineItemOptions.length === 0) {
return null
}
Expand All @@ -315,7 +316,7 @@ const LineItemOptions = ({
))}
</Spacer>
)
}
})

const Bundle = withSkeletonTemplate<{ code: LineItem['bundle_code'] }>(
({ code }): JSX.Element | null => {
Expand Down

0 comments on commit ca5336f

Please sign in to comment.