Skip to content

Commit e571dcb

Browse files
davejcameronlizkenyon
authored andcommitted
Update components
1 parent f119dd5 commit e571dcb

File tree

6 files changed

+17
-28
lines changed

6 files changed

+17
-28
lines changed

sample-apps/payment-customizations/app/routes/app._index.jsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,8 @@ export default function Index() {
9999
const generateProduct = () => fetcher.submit({}, { method: "POST" });
100100

101101
return (
102-
<s-page>
103-
<TitleBar title="React Router app template">
104-
<button variant="primary" onClick={generateProduct}>
105-
Generate a product
106-
</button>
107-
</TitleBar>
102+
<s-page heading="React Router app template">
103+
<s-button variant="primary" onClick={generateProduct} slot="primary-action">Generate a product</s-button>
108104
<s-section heading="Congrats on creating a new Shopify app 🎉">
109105
<s-paragraph>
110106
This embedded app template uses{" "}
@@ -245,4 +241,4 @@ export default function Index() {
245241

246242
export const headers = (headersArgs) => {
247243
return boundary.headers(headersArgs);
248-
};
244+
};

sample-apps/payment-customizations/app/routes/app.additional.jsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import { TitleBar } from "@shopify/app-bridge-react";
22

33
export default function AdditionalPage() {
44
return (
5-
<s-page>
6-
<TitleBar title="Additional page"></TitleBar>
5+
<s-page heading="Additional page">
76
<s-section heading="Multiple pages">
87
<s-paragraph>
98
The app template comes with an additional page which demonstrates how
@@ -19,7 +18,7 @@ export default function AdditionalPage() {
1918
<s-paragraph>
2019
To create your own page and have it show up in the app navigation, add
2120
a page inside <code>app/routes</code>, and a link to it in the{" "}
22-
<code>&lt;NavMenu&gt;</code> component found in{" "}
21+
<code>&lt;s-app-nav&gt;</code> component found in{" "}
2322
<code>app/routes/app.jsx</code>.
2423
</s-paragraph>
2524
</s-section>
@@ -37,4 +36,4 @@ export default function AdditionalPage() {
3736
</s-section>
3837
</s-page>
3938
);
40-
}
39+
}

sample-apps/payment-customizations/app/routes/app.jsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ export default function App() {
1616

1717
return (
1818
<AppProvider embedded apiKey={apiKey}>
19-
<NavMenu>
20-
<Link to="/app" rel="home">
21-
Home
22-
</Link>
23-
<Link to="/app/additional">Additional page</Link>
24-
</NavMenu>
19+
<s-app-nav>
20+
<s-link href="/app" rel="home">Home</s-link>
21+
<s-link href="/app/additional">Additional page</s-link>
22+
</s-app-nav>
2523
<Outlet />
2624
</AppProvider>
2725
);
@@ -34,4 +32,4 @@ export function ErrorBoundary() {
3432

3533
export const headers = (headersArgs) => {
3634
return boundary.headers(headersArgs);
37-
};
35+
};

sample-apps/payment-customizations/app/routes/app.payment-customization.$functionId.$id.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,20 +171,15 @@ export default function PaymentCustomization() {
171171

172172
return (
173173
<form data-save-bar onSubmit={handleSubmit} onReset={handleReset}>
174-
<s-page>
175-
<ui-title-bar title="Hide payment method">
176-
<button variant="breadcrumb" href="shopify:admin/settings/payments/customizations">
177-
Payment customizations
178-
</button>
179-
</ui-title-bar>
174+
<s-page heading="Hide payment method">
175+
<s-link href="shopify:admin/settings/payments/customizations" variant="breadcrumb" slot="breadcrumb-actions">Payment customizations</s-link>
180176

181177
{errorBanner}
182178

183179
<s-section>
184-
<s-grid gap="base">
180+
<s-grid gap="base" gridTemplateColumns="1fr 1fr">
185181
<s-text-field
186182
name="paymentMethodName"
187-
type="text"
188183
label="Payment method"
189184
value={paymentMethodName}
190185
onInput={(e) => setPaymentMethodName(e.target.value)}

sample-apps/payment-customizations/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
},
4141
"devDependencies": {
4242
"@shopify/api-codegen-preset": "^1.1.1",
43+
"@shopify/polaris-types": "^1.0.1",
4344
"eslint": "^8.38.0",
4445
"eslint-plugin-import": "^2.28.1",
4546
"eslint-plugin-jsx-a11y": "^6.7.1",

sample-apps/payment-customizations/tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"moduleResolution": "Bundler",
1717
"target": "ES2022",
1818
"baseUrl": ".",
19-
"types": ["@react-router/node", "vite/client"],
19+
"types": ["@react-router/node", "vite/client", "@shopify/polaris-types"],
2020
"rootDirs": [".", "./.react-router/types"]
2121
}
22-
}
22+
}

0 commit comments

Comments
 (0)