App reviews, troubleshooting, and recommendations
Hi!
I am trying to add a Modal in my Shopify embedded app. Since the Modal component is deprecated (https://polaris.shopify.com/components/deprecated/modal), I have to use the App bridge modal API (https://shopify.dev/docs/api/app-bridge-library/reference/modal) as in the code bellow.
const fileUpload = !file && <DropZone.FileUpload />;
const uploadedFile = file && (
<LegacyStack>
<Thumbnail
size="small"
alt={file.name}
source={
validImageTypes.includes(file.type)
? window.URL.createObjectURL(file)
: NoteIcon
}
/>
<div>
{file.name}{' '}
<Text variant="bodySm" as="p">
{file.size} bytes
</Text>
</div>
</LegacyStack>
);
<ui-modal id="my-modal">
<Box padding="400">
<DropZone allowMultiple={false} onDrop={handleDropZoneDrop}>
{uploadedFile}
{fileUpload}
</DropZone>
</Box>
<ui-title-bar title="title">
<button variant="primary">Button 1</button>
<button>Button 2</button>
</ui-title-bar>
</ui-modal>
The drop zone is correctly rendered but I can not add file neither by clicking the button not dropping a file.
Somebody knows how to display a drop zone?
Thanks.
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025