pos. draft-order-details. block. renderTarget
Target
Renders a custom section within the native draft order details screen
Was this section helpful?
Block
import React from 'react';
import {
Text,
useApi,
reactExtension,
POSBlock,
POSBlockRow,
} from '@shopify/ui-extensions-react/point-of-sale';
const Block = () => {
const api = useApi<'pos.draft-order-details.block.render'>();
return (
<POSBlock action={{title: 'Open action', onPress: api.action.presentModal}}>
<POSBlockRow>
<Text>{'This is a block extension'}</Text>
<Text>{`Draft Order ID for this product: ${api.draftOrder.id}`}</Text>
</POSBlockRow>
</POSBlock>
);
};
export default reactExtension('pos.draft-order-details.block.render', () => (
<Block />
));