Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
35a9ac4
Version Packages
github-actions[bot] Oct 1, 2024
04fdb3b
update version to 2024.10.0
hheyhhay Oct 1, 2024
fddb591
Merge pull request #2396 from Shopify/changeset-release/2024-10
hheyhhay Oct 1, 2024
2cb49c7
update title to new verision
hheyhhay Oct 2, 2024
40ffe8e
Merge pull request #2401 from Shopify/hdixon/update-instructions-upda…
hheyhhay Oct 2, 2024
03fc6be
Implemented remote root render for POS and admin
js-goupil Sep 17, 2024
5e84776
Added changeset for patch
js-goupil Nov 20, 2024
40fb1a9
Merge pull request #2482 from Shopify/js-teardown-functions
js-goupil Nov 20, 2024
3319003
Version Packages
github-actions[bot] Nov 20, 2024
e6b0c85
Merge pull request #2483 from Shopify/changeset-release/2024-10
vividviolet Nov 20, 2024
23eac74
Chat docs: update from product (simon)
jffortier Nov 13, 2024
a2a5f3e
chat and docs for release
cpeddecord Dec 3, 2024
a3e38a9
fixing merge conflicts
cpeddecord Dec 4, 2024
b20189c
app bridge types
jffortier Nov 6, 2024
45f4980
adding changeset
cpeddecord Dec 4, 2024
b76aea4
Chat docs: update from product (simon)
jffortier Nov 13, 2024
95f577a
Chat: update link fo app bridge in example
jffortier Nov 13, 2024
981b38b
configuration doc change
jffortier Nov 6, 2024
a0adce2
Merge pull request #2514 from Shopify/cp/chat-release
cpeddecord Dec 4, 2024
c2ed861
changeset didn't get nixed
cpeddecord Dec 4, 2024
0b3c9d3
Merge pull request #2517 from Shopify/removing-errant-changeset
cpeddecord Dec 4, 2024
0257300
Version Packages
github-actions[bot] Dec 4, 2024
8a56070
Merge pull request #2518 from Shopify/changeset-release/2024-10
cpeddecord Dec 4, 2024
15b2d8c
2024-10: content update for Chat
jffortier Dec 11, 2024
00630c4
Changeset
jffortier Dec 11, 2024
99827ce
Chat: proper app-bridge script in example
jffortier Dec 11, 2024
da92427
Remove changeset since its just content changes in the end
jffortier Dec 12, 2024
bf7a873
Merge pull request #2525 from Shopify/jffortier/2024-10-content-updates
jffortier Dec 12, 2024
49fd3ad
update one page checkout asset to show reductions targets
ameemee Dec 17, 2024
e339e68
Merge pull request #2540 from Shopify/updating-one-page-checkout-asset
ameemee Dec 18, 2024
901c86f
Escape double quotes in config documentation
danielqiuu Jan 21, 2025
6de620d
Merge pull request #2574 from Shopify/dq/update-config-doc-2024-10
danielqiuu Jan 24, 2025
d71f060
Fix:Docs on payment options
vaibhavramchandani Jan 23, 2025
4b392ab
[Customer Account] fix broken link
sylvhama Feb 10, 2025
05931d5
Merge pull request #2629 from Shopify/2024-10-80849
sylvhama Feb 11, 2025
5c0a341
Backfill doc changes to POS Extension 2024-10 (#2966)
henryStelle Jun 10, 2025
ae501e7
Add order-api examples
NathanJolly Jun 19, 2025
26dc680
Fixes
NathanJolly Jun 19, 2025
843542f
Apply suggestions from code review
NathanJolly Jun 20, 2025
c5e8156
Merge pull request #2998 from Shopify/njo/2024-10/order-api-examples
NathanJolly Jun 20, 2025
56b13e6
Remove the unsupported section from the versions page
NathanJolly Jul 10, 2025
369a43c
Remove "Removed in POS version" from supported versions
NathanJolly Jul 10, 2025
210d76c
Merge pull request #3064 from Shopify/njo/2024-10/remove-unsupported
NathanJolly Jul 10, 2025
32728b6
Remove versions page from 2024-10, update links
NathanJolly Sep 15, 2025
2673065
update links on overview page
NathanJolly Sep 16, 2025
9c82996
Merge pull request #3304 from Shopify/njo/2024-10/remove-versions
NathanJolly Sep 16, 2025
d01ac5e
Fix polaris-web-components link
NathanJolly Oct 6, 2025
8d8ef53
Merge pull request #3468 from Shopify/njo/2024-10/fix-component-link
NathanJolly Oct 6, 2025
d720f98
Update troubleshooting doc for clarity
NathanJolly Oct 10, 2025
98f271e
Merge pull request #3494 from Shopify/njo/2024-10/reword-troubleshoot…
NathanJolly Oct 14, 2025
5f1d1ed
Remove pos static pages that are migrating
NathanJolly Oct 17, 2025
b78e631
Merge pull request #3513 from Shopify/njo/2024-10/remove-pos-build-docs
NathanJolly Oct 17, 2025
c3a0f6d
Improved API and prop descriptions for 2024-10
mcvinci Nov 13, 2025
5f317bb
Improved descriptions
mcvinci Nov 17, 2025
1ebe249
Remove 'and detail pages' from Tile component description
mcvinci Nov 18, 2025
18f1e2c
Improve example titles and descriptions
mcvinci Nov 23, 2025
1f11bb1
Fix PinPad and Stack
mcvinci Nov 23, 2025
cc0bf0a
Best practices and limitations
mcvinci Nov 24, 2025
fe07903
Re-organize subcategories
mcvinci Nov 24, 2025
beeb628
Merge pull request #3566 from Shopify/pos-ui-extensions-2024-10-api-p…
mcvinci Nov 25, 2025
acae8c7
Remove deprecated ActionItem component doc
mcvinci Nov 28, 2025
5102415
Merge pull request #3601 from Shopify/remove-deprecated-actionitem-co…
mcvinci Nov 28, 2025
099ab78
Rename ProductSearch to Product Search (#3614)
mcvinci Dec 2, 2025
8a2e03f
Remove redundant types + add missing descriptions (#3623)
mcvinci Dec 4, 2025
cc2a487
[Admin UI extensions 2024-10]: IA for Target APIs and components (#3700)
mcvinci Jan 9, 2026
2bfd045
chore: update shopify-dev asset path
majd-shopify Feb 2, 2026
ae2c896
[Target APIs]: Description improvements for version 2024-10 (#3763)
mcvinci Feb 3, 2026
fba5202
Merge pull request #3795 from Shopify/chore/update-shopify-dev-asset-…
majd-shopify Feb 3, 2026
2d25768
chore: update all paths in build-docs scripts
majd-shopify Feb 6, 2026
8621099
Merge pull request #3856 from Shopify/chore/update-all-paths-in-build…
majd-shopify Feb 6, 2026
1740a45
Migrating from old branch
SteveSill Feb 5, 2026
3d8ae0f
Merge pull request #3826 from Shopify/2024-10-admin-ui-examples
SteveSill Feb 6, 2026
951f2bc
target docs
johndcollett Jan 23, 2026
8e9865c
fix: add @private exclusion, RunnableExtension support, and Pick/Omit…
laurelthorburn Jan 30, 2026
545ab4a
Merge pull request #3775 from Shopify/2024-10-target-docs
laurelthorburn Feb 6, 2026
1a1a6e5
fix handling of action target api
laurelthorburn Feb 6, 2026
3cf6def
update `Screen.onReceiveParams` with clarifying description. (#3848)
fatbattk Feb 9, 2026
b0962d4
[2024-10] Make API headings consistent in POS UI and Admin UI (#3837)
mcvinci Feb 9, 2026
8664623
Merge pull request #3871 from Shopify/2024-10-action
laurelthorburn Feb 10, 2026
7775cb3
[POS 2024-10]: Remove component name code syntax (#3912)
mcvinci Feb 17, 2026
4f7750c
[Components]: Description improvements for version 2024-10 (#3880)
mcvinci Feb 19, 2026
e80d106
Add component examples and descriptions for 2024-10
SteveSill Feb 20, 2026
b65d6b5
Merge pull request #3934 from Shopify/2024-10-component-examples
SteveSill Feb 21, 2026
57898c6
Admin UI component defaultExample descriptions
SteveSill Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 0 additions & 5 deletions .changeset/brave-rivers-crash.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/breezy-mangos-fry.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/eight-peas-buy.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/fast-crabs-act.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fast-geckos-double.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gold-pillows-protect.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/light-dancers-pump.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lucky-beds-shout.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/many-houses-build.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/mean-trains-fly.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/new-badgers-mix.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/proud-baboons-work.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/shiny-frogs-reflect.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
'@shopify/ui-extensions': patch
'@shopify/ui-extensions-react': patch
'@shopify/ui-extensions': patch
---

Add customer-account.order.page.render target
update Screen.onReceiveParams description
5 changes: 0 additions & 5 deletions .changeset/tall-bees-scream.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/tasty-coats-shave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tasty-trainers-lick.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/violet-lamps-relate.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/warm-tigers-sin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/young-buckets-punch.md

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

- id: typescript-cache
name: Restore TypeScript cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: |
packages/*/build/ts
Expand All @@ -31,7 +31,7 @@ jobs:

- id: jest-cache
name: Restore jest cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .loom/cache/jest/
key: ${{ runner.os }}-jest-v1-${{ github.sha }}
Expand All @@ -50,7 +50,7 @@ jobs:

- id: eslint-cache
name: Restore ESLint cache
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: .loom/cache/eslint
key: ${{ runner.os }}-eslint-v1-${{ github.sha }}
Expand Down
43 changes: 43 additions & 0 deletions packages/ui-extensions-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# @shopify/ui-extensions-react

## 2024.10.2

### Patch Changes

- [#2514](https://github.com/Shopify/ui-extensions/pull/2514) [`45f4980788fe94ba58ad9c44bbfb80294bb3ad20`](https://github.com/Shopify/ui-extensions/commit/45f4980788fe94ba58ad9c44bbfb80294bb3ad20) Thanks [@cpeddecord](https://github.com/cpeddecord)! - Releasing Chat into the wild, for real this time

- Updated dependencies [[`45f4980788fe94ba58ad9c44bbfb80294bb3ad20`](https://github.com/Shopify/ui-extensions/commit/45f4980788fe94ba58ad9c44bbfb80294bb3ad20)]:
- @shopify/ui-extensions@2024.10.2

## 2024.10.1

### Patch Changes

- [#2482](https://github.com/Shopify/ui-extensions/pull/2482) [`5e847761d9e0ce2d03fb2971e132810f9696c10f`](https://github.com/Shopify/ui-extensions/commit/5e847761d9e0ce2d03fb2971e132810f9696c10f) Thanks [@js-goupil](https://github.com/js-goupil)! - Added support for Host to unmount UI Extensions

- Updated dependencies [[`5e847761d9e0ce2d03fb2971e132810f9696c10f`](https://github.com/Shopify/ui-extensions/commit/5e847761d9e0ce2d03fb2971e132810f9696c10f)]:
- @shopify/ui-extensions@2024.10.1

## 2024.10.0

### Minor Changes

- [#2371](https://github.com/Shopify/ui-extensions/pull/2371) [`28edde440ceee584c71c5ac983252ca71a7f853a`](https://github.com/Shopify/ui-extensions/commit/28edde440ceee584c71c5ac983252ca71a7f853a) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - Adds `type` property to `selectedPaymentOption`

- [#2361](https://github.com/Shopify/ui-extensions/pull/2361) [`89438897001dce9058030e6ee1655747a66ec71a`](https://github.com/Shopify/ui-extensions/commit/89438897001dce9058030e6ee1655747a66ec71a) Thanks [@oliverigor](https://github.com/oliverigor)! - Add primary and secondary actions to Modal component

- [#2297](https://github.com/Shopify/ui-extensions/pull/2297) [`7ab538090e8bcef052bfc782b31639efe89ff262`](https://github.com/Shopify/ui-extensions/commit/7ab538090e8bcef052bfc782b31639efe89ff262) Thanks [@shopify-github-actions-access](https://github.com/apps/shopify-github-actions-access)! - update generate-doc version, add attributes to Icon

- [#2220](https://github.com/Shopify/ui-extensions/pull/2220) [`9e619fca6ea4f816148c90158b46bc1db5bfbad7`](https://github.com/Shopify/ui-extensions/commit/9e619fca6ea4f816148c90158b46bc1db5bfbad7) Thanks [@LucasLacerdaUX](https://github.com/LucasLacerdaUX)! - Add QRCode component

### Patch Changes

- [#2284](https://github.com/Shopify/ui-extensions/pull/2284) [`f84592931962537d345dfd68bf2a2f2396373740`](https://github.com/Shopify/ui-extensions/commit/f84592931962537d345dfd68bf2a2f2396373740) Thanks [@brianshen1990](https://github.com/brianshen1990)! - expose Switch component to customer account unstable surface

- [#2356](https://github.com/Shopify/ui-extensions/pull/2356) [`a2d458be51a708aeac6a1879554051f98371f908`](https://github.com/Shopify/ui-extensions/commit/a2d458be51a708aeac6a1879554051f98371f908) Thanks [@brianshen1990](https://github.com/brianshen1990)! - add full page navigation api to order full page extension target

- [#2347](https://github.com/Shopify/ui-extensions/pull/2347) [`dd8a861caba591c1087e8349e8a9bbfdc2681cb8`](https://github.com/Shopify/ui-extensions/commit/dd8a861caba591c1087e8349e8a9bbfdc2681cb8) Thanks [@brianshen1990](https://github.com/brianshen1990)! - Add customer-account.order.page.render target

- [#2369](https://github.com/Shopify/ui-extensions/pull/2369) [`7ef1d9cdd37c42277e240eb660e08de54967461c`](https://github.com/Shopify/ui-extensions/commit/7ef1d9cdd37c42277e240eb660e08de54967461c) Thanks [@brianshen1990](https://github.com/brianshen1990)! - update error message for useNavigationCurrentEntry api

- Updated dependencies [[`21234eea51b50dfc53d3fc4962512728b4a19446`](https://github.com/Shopify/ui-extensions/commit/21234eea51b50dfc53d3fc4962512728b4a19446), [`28edde440ceee584c71c5ac983252ca71a7f853a`](https://github.com/Shopify/ui-extensions/commit/28edde440ceee584c71c5ac983252ca71a7f853a), [`89438897001dce9058030e6ee1655747a66ec71a`](https://github.com/Shopify/ui-extensions/commit/89438897001dce9058030e6ee1655747a66ec71a), [`f84592931962537d345dfd68bf2a2f2396373740`](https://github.com/Shopify/ui-extensions/commit/f84592931962537d345dfd68bf2a2f2396373740), [`9347443b76210c2f9f3ce45bb488c38ec08efb6f`](https://github.com/Shopify/ui-extensions/commit/9347443b76210c2f9f3ce45bb488c38ec08efb6f), [`fd4ecf2aef0414e790a4a78ae6a9fa013acbafda`](https://github.com/Shopify/ui-extensions/commit/fd4ecf2aef0414e790a4a78ae6a9fa013acbafda), [`118654e61e393c2885198ab5dafddb4cf4d62669`](https://github.com/Shopify/ui-extensions/commit/118654e61e393c2885198ab5dafddb4cf4d62669), [`4dec3851bf53f6cf289ca8c265cd13f8c123ab06`](https://github.com/Shopify/ui-extensions/commit/4dec3851bf53f6cf289ca8c265cd13f8c123ab06), [`9fe9d56d190fee5ee444ed980a5ef60106dfda12`](https://github.com/Shopify/ui-extensions/commit/9fe9d56d190fee5ee444ed980a5ef60106dfda12), [`7ab538090e8bcef052bfc782b31639efe89ff262`](https://github.com/Shopify/ui-extensions/commit/7ab538090e8bcef052bfc782b31639efe89ff262), [`a2d458be51a708aeac6a1879554051f98371f908`](https://github.com/Shopify/ui-extensions/commit/a2d458be51a708aeac6a1879554051f98371f908), [`8bca1a1710431083b7e98966ec76f3fe17720d5c`](https://github.com/Shopify/ui-extensions/commit/8bca1a1710431083b7e98966ec76f3fe17720d5c), [`a8de80b0e252ebd0c529bfe88d02d2e35e2a0461`](https://github.com/Shopify/ui-extensions/commit/a8de80b0e252ebd0c529bfe88d02d2e35e2a0461), [`dd8a861caba591c1087e8349e8a9bbfdc2681cb8`](https://github.com/Shopify/ui-extensions/commit/dd8a861caba591c1087e8349e8a9bbfdc2681cb8), [`f81712b643430dd1cbdce54b3edf0c80bc0dafe5`](https://github.com/Shopify/ui-extensions/commit/f81712b643430dd1cbdce54b3edf0c80bc0dafe5), [`7ef1d9cdd37c42277e240eb660e08de54967461c`](https://github.com/Shopify/ui-extensions/commit/7ef1d9cdd37c42277e240eb660e08de54967461c), [`37620b9d47f38586c843a9c11a6de2e0461bc0dd`](https://github.com/Shopify/ui-extensions/commit/37620b9d47f38586c843a9c11a6de2e0461bc0dd), [`9e619fca6ea4f816148c90158b46bc1db5bfbad7`](https://github.com/Shopify/ui-extensions/commit/9e619fca6ea4f816148c90158b46bc1db5bfbad7), [`9f7ee640e434bb175b90248c29bb194f321e871a`](https://github.com/Shopify/ui-extensions/commit/9f7ee640e434bb175b90248c29bb194f321e871a), [`d6ac8d4e4180eef5242719bfaffe998441be1aa9`](https://github.com/Shopify/ui-extensions/commit/d6ac8d4e4180eef5242719bfaffe998441be1aa9)]:
- @shopify/ui-extensions@2024.10.0

## 2024.4.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ui-extensions-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This package contains the public type definitions and utilities needed to create

Currently, this package only contains the extension APIs for the [`checkout` surface](./src/surfaces/checkout), but other Shopify surfaces will be added here soon.

All extensions, regardless of where they appear in Shopify, make use the same [underlying technology](../../documentation/how-extensions-work.md), and most of the same “core” components (e.g., `BlockStack`, `Button`, `TextField`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.
All extensions, regardless of where they appear in Shopify, make use of the same [underlying technology](../../documentation/how-extensions-work.md), and most of the same “core” components (e.g., `BlockStack`, `Button`, `TextField`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.

A checkout extension using React would be written as follows:

Expand Down
6 changes: 3 additions & 3 deletions packages/ui-extensions-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shopify/ui-extensions-react",
"version": "0.0.0-unstable",
"version": "2024.10.2",
"description": "React bindings for @shopify/ui-extensions",
"publishConfig": {
"access": "public",
Expand Down Expand Up @@ -66,7 +66,7 @@
"@types/react": ">=18.2.67"
},
"peerDependencies": {
"@shopify/ui-extensions": "0.0.0-unstable",
"@shopify/ui-extensions": "2024.10.2",
"react": ">=18.0.0"
},
"peerDependenciesMeta": {
Expand All @@ -80,7 +80,7 @@
"devDependencies": {
"@faker-js/faker": "^8.4.1",
"@quilted/react-testing": "^0.5.31",
"@shopify/ui-extensions": "0.0.0-unstable",
"@shopify/ui-extensions": "2024.10.2",
"react": "^18.0.0",
"react-reconciler": "0.29.0",
"react-test-renderer": "^18.2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React from 'react';
import {reactExtension, useApi, AdminAction, Button, TextField, Select, BlockStack} from '@shopify/ui-extensions-react/admin';

function App() {
const {data, close} = useApi('admin.product-details.action.render');
const productId = data.selected[0]?.id;

return (
<AdminAction
title="Assign warehouse location"
primaryAction={
<Button
onPress={async () => {
await fetch('/api/products/assign-warehouse', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({productId}),
});
close();
}}
>
Assign to warehouse
</Button>
}
secondaryAction={
<Button onPress={() => close()}>Cancel</Button>
}
>
<BlockStack gap>
<TextField label="Warehouse SKU" name="warehouseSku" required />
<Select
label="Target warehouse"
name="warehouse"
options={[
{label: 'East Coast — New York', value: 'nyc'},
{label: 'West Coast — Los Angeles', value: 'lax'},
{label: 'Central — Chicago', value: 'chi'},
]}
/>
</BlockStack>
</AdminAction>
);
}

export default reactExtension(
'admin.product-details.action.render',
() => <App />,
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, {useState, useEffect} from 'react';
import {reactExtension, useApi, AdminAction, Button, Text, ProgressIndicator, BlockStack} from '@shopify/ui-extensions-react/admin';

function App() {
const {data, close, query} = useApi('admin.product-details.action.render');
const productId = data.selected[0]?.id;
const [product, setProduct] = useState(null);
const [loading, setLoading] = useState(true);

useEffect(() => {
query(
`query Product($id: ID!) {
product(id: $id) { title status totalInventory }
}`,
{variables: {id: productId}},
).then((result) => {
setProduct(result?.data?.product);
setLoading(false);
});
}, [productId, query]);

return (
<AdminAction
title="Product details"
primaryAction={<Button onPress={() => close()}>Done</Button>}
>
<BlockStack gap>
{loading ? (
<ProgressIndicator
size="small-200"
accessibilityLabel="Loading product details"
/>
) : product ? (
<>
<Text fontWeight="bold">{product.title}</Text>
<Text>Status: {product.status}</Text>
<Text>Inventory: {product.totalInventory} units</Text>
</>
) : null}
</BlockStack>
</AdminAction>
);
}

export default reactExtension(
'admin.product-details.action.render',
() => <App />,
);
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
import React from 'react';
import {
reactExtension,
AdminAction,
Button,
Text,
} from '@shopify/ui-extensions-react/admin';
import {reactExtension, useApi, AdminAction, Button, Text, BlockStack} from '@shopify/ui-extensions-react/admin';

function App() {
const {data, close} = useApi('admin.product-details.action.render');
const productId = data.selected[0]?.id;

return (
<AdminAction
title="My App Action"
title="Sync to warehouse"
primaryAction={
<Button onPress={() => {}}>Action</Button>
<Button
onPress={async () => {
await fetch('/api/products/sync', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({productId}),
});
close();
}}
>
Sync product
</Button>
}
secondaryAction={
<Button onPress={() => {}}>
Secondary
</Button>
<Button onPress={() => close()}>Cancel</Button>
}
>
<Text>Modal content</Text>
<BlockStack gap>
<Text>
Sync product {productId} to your warehouse management system. This
will update inventory counts, pricing, and metadata.
</Text>
</BlockStack>
</AdminAction>
);
}

export default reactExtension(
'Playground',
'admin.product-details.action.render',
() => <App />,
);
Loading
Loading