A full-screen extension target that renders when a `pos.order-details.action.menu-item.render` target calls for it
import React from 'react';
import {
Text,
Screen,
ScrollView,
useApi,
Navigator,
reactExtension,
} from '@shopify/ui-extensions-react/point-of-sale';
const Modal = () => {
const api = useApi<'pos.order-details.action.render'>();
return (
<Navigator>
<Screen name="OrderDetailsAction" title="Order Details Action">
<ScrollView>
<Text>{`Order ID: ${api.order.id}`}</Text>
</ScrollView>
</Screen>
</Navigator>
);
};
export default reactExtension('pos.order-details.action.render', () => (
<Modal />
));
import {
Navigator,
Screen,
ScrollView,
Text,
extension,
} from '@shopify/ui-extensions/point-of-sale';
export default extension('pos.order-details.action.render', (root, api) => {
const navigator = root.createComponent(Navigator);
const screen = root.createComponent(Screen, {
name: 'OrderDetailsAction',
title: 'Order Details Action',
});
const scrollView = root.createComponent(ScrollView);
const text = root.createComponent(Text);
text.append(`ID for current order screen: ${api.order.id}`);
scrollView.append(text);
screen.append(scrollView);
navigator.append(screen);
root.append(navigator);
});