Skip to content

Commit ff759a9

Browse files
authored
Standardize Customer account examples (#3465)
1 parent 4573e69 commit ff759a9

File tree

82 files changed

+143
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+143
-252
lines changed

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/analytics.doc.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,11 @@ const data: ReferenceEntityTemplateSchema = {
1717
],
1818
defaultExample: {
1919
codeblock: {
20-
title: 'Publish',
20+
title: 'Extension.jsx',
2121
tabs: [
2222
{
23-
code: '../examples/apis/analytics-publish.example.tsx',
23+
code: '../examples/apis/analytics-publish.example.jsx',
2424
language: 'jsx',
25-
title: 'Preact',
2625
},
2726
],
2827
},
@@ -37,9 +36,9 @@ const data: ReferenceEntityTemplateSchema = {
3736
title: 'Visitor',
3837
tabs: [
3938
{
40-
code: '../examples/apis/analytics-visitor.example.tsx',
39+
code: '../examples/apis/analytics-visitor.example.jsx',
4140
language: 'jsx',
42-
title: 'Preact',
41+
title: 'Extension.jsx',
4342
},
4443
],
4544
},

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/authenticated-account.doc.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ const data: ReferenceEntityTemplateSchema = {
1818
],
1919
defaultExample: {
2020
codeblock: {
21-
title: 'Show Loyalty Banner',
21+
title: 'Example',
2222
tabs: [
2323
{
24-
code: '../examples/apis/authenticated-account.example.tsx',
24+
code: '../examples/apis/authenticated-account.example.jsx',
2525
language: 'jsx',
26-
title: 'Preact',
26+
title: 'Extension.jsx',
2727
},
2828
{
2929
code: '../examples/apis/authenticated-account.locale.example.json',
@@ -43,9 +43,9 @@ const data: ReferenceEntityTemplateSchema = {
4343
title: 'Getting the company and location of the customer',
4444
tabs: [
4545
{
46-
code: '../examples/apis/authenticated-account-company-and-location.example.tsx',
46+
code: '../examples/apis/authenticated-account-company-and-location.example.jsx',
4747
language: 'jsx',
48-
title: 'Preact',
48+
title: 'Extension.jsx',
4949
},
5050
{
5151
code: '../examples/apis/authenticated-account-company-and-location.locale.example.json',

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/customer-account-api.doc.ts

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@ import type {ReferenceEntityTemplateSchema} from '@shopify/generate-docs';
22

33
const data: ReferenceEntityTemplateSchema = {
44
name: 'Customer Account API',
5-
description: `Create unique customer experiences with the Customer Account API. The API offers a full range of options making it possible for customers to view their orders, manage their profile and much more.`,
5+
description: `Create unique customer experiences with the Customer Account API. The API offers a full range of options making it possible for customers to view their orders, manage their profile and much more.
6+
7+
You can access the [Customer Account GraphQL API](/docs/api/customer) using the global \`fetch()\`.`,
68
isVisualComponent: false,
79
category: 'APIs',
810
type: 'API',
9-
examples: {
10-
description: '',
11-
examples: [
12-
{
13-
description: `
14-
You can access the [Customer Account GraphQL API](/docs/api/customer) using the global \`fetch()\`.`,
15-
codeblock: {
16-
title: 'Accessing the Customer Account API with fetch()',
17-
tabs: [
18-
{
19-
code: '../examples/apis/customer-account-api-fetch.example.tsx',
20-
language: 'jsx',
21-
title: 'Preact',
22-
},
23-
],
11+
defaultExample: {
12+
codeblock: {
13+
title: 'Extension.jsx',
14+
tabs: [
15+
{
16+
code: '../examples/apis/customer-account-api-fetch.example.jsx',
17+
language: 'jsx',
2418
},
25-
},
26-
],
19+
],
20+
},
2721
},
2822
related: [
2923
{

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/customer-privacy.doc.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ const data: ReferenceEntityTemplateSchema = {
2121
],
2222
defaultExample: {
2323
codeblock: {
24-
title: 'Read Customer Privacy',
24+
title: 'Extension.jsx',
2525
tabs: [
2626
{
27-
code: '../examples/apis/customer-privacy.example.tsx',
27+
code: '../examples/apis/customer-privacy.example.jsx',
2828
language: 'jsx',
29-
title: 'Preact',
3029
},
3130
],
3231
},
@@ -43,9 +42,9 @@ const data: ReferenceEntityTemplateSchema = {
4342
title: 'Use a Sheet to manage customer privacy consent',
4443
tabs: [
4544
{
46-
code: '../examples/apis/sheet-consent-banner-with-form.example.tsx',
47-
language: 'tsx',
48-
title: 'Preact',
45+
code: '../examples/apis/sheet-consent-banner-with-form.example.jsx',
46+
language: 'jsx',
47+
title: 'Extension.jsx',
4948
},
5049
],
5150
},

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/localization.doc.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ const data: ReferenceEntityTemplateSchema = {
2020
title: 'Translating strings',
2121
tabs: [
2222
{
23-
code: '../examples/apis/translate.example.tsx',
23+
code: '../examples/apis/translate.example.jsx',
2424
language: 'jsx',
25-
title: 'Preact',
25+
title: 'Extension.jsx',
2626
},
2727
{
2828
code: '../examples/apis/translate.locale.example.json',
@@ -42,9 +42,9 @@ const data: ReferenceEntityTemplateSchema = {
4242
title: 'Getting the country of the customer',
4343
tabs: [
4444
{
45-
code: '../examples/apis/localization-country.example.tsx',
45+
code: '../examples/apis/localization-country.example.jsx',
4646
language: 'jsx',
47-
title: 'Preact',
47+
title: 'Extension.jsx',
4848
},
4949
{
5050
code: '../examples/apis/localization-country.locale.example.json',
@@ -61,9 +61,9 @@ const data: ReferenceEntityTemplateSchema = {
6161
title: 'Translating strings with pluralization',
6262
tabs: [
6363
{
64-
code: '../examples/apis/translate-pluralization.example.tsx',
64+
code: '../examples/apis/translate-pluralization.example.jsx',
6565
language: 'jsx',
66-
title: 'Preact',
66+
title: 'Extension.jsx',
6767
},
6868
{
6969
code: '../examples/apis/translate-pluralization.locale.example.json',

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/navigation.doc.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ const data: ReferenceEntityTemplateSchema = {
1919
defaultExample: {
2020
description: '',
2121
codeblock: {
22-
title: 'Navigation example',
22+
title: 'Extension.jsx',
2323
tabs: [
2424
{
25-
code: '../examples/navigation/default-preact.example.tsx',
25+
code: '../examples/apis/navigation.example.jsx',
2626
language: 'jsx',
27-
title: 'Preact',
2827
},
2928
],
3029
},

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/order-status-api/attributes.doc.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ const data: ReferenceEntityTemplateSchema = {
1818
],
1919
defaultExample: {
2020
codeblock: {
21-
title: 'Attribute values',
21+
title: 'Extension.jsx',
2222
tabs: [
2323
{
24-
code: '../../examples/apis/attribute-values.example.tsx',
24+
code: '../../examples/apis/attribute-values.example.jsx',
2525
language: 'jsx',
26-
title: 'Preact',
2726
},
2827
],
2928
},

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/order-status-api/cart-lines.doc.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ const data: ReferenceEntityTemplateSchema = {
2121
],
2222
defaultExample: {
2323
codeblock: {
24-
title: '',
24+
title: 'Extension.jsx',
2525
tabs: [
2626
{
27-
code: '../../examples/apis/cart-line-item.example.tsx',
27+
code: '../../examples/apis/cart-line-item.example.jsx',
2828
language: 'jsx',
29-
title: 'Preact',
3029
},
3130
],
3231
},

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/order-status-api/require-login.doc.ts

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ const data: ReferenceEntityTemplateSchema = {
1616
type: 'Docs_OrderStatus_RequireLoginApi',
1717
},
1818
],
19+
defaultExample: {
20+
codeblock: {
21+
title: 'Extension.jsx',
22+
tabs: [
23+
{
24+
code: '../../examples/apis/require-login.example.jsx',
25+
language: 'jsx',
26+
},
27+
],
28+
},
29+
},
1930
related: [
2031
{
2132
name: 'Order status page',
@@ -24,24 +35,6 @@ const data: ReferenceEntityTemplateSchema = {
2435
type: 'growth',
2536
},
2637
],
27-
examples: {
28-
description: '',
29-
examples: [
30-
{
31-
description: 'Call requireLogin before triggering an action',
32-
codeblock: {
33-
title: 'Call requireLogin before triggering an action',
34-
tabs: [
35-
{
36-
code: '../../examples/apis/require-login.example.tsx',
37-
language: 'jsx',
38-
title: 'Preact',
39-
},
40-
],
41-
},
42-
},
43-
],
44-
},
4538
};
4639

4740
export default data;

packages/ui-extensions/docs/surfaces/customer-account/reference/apis/query.doc.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ const data: ReferenceEntityTemplateSchema = {
2020
You can access the [Storefront GraphQL API](/docs/api/storefront) via the \`query()\` helper function.
2121
Ensure your extension can use this API by [enabling the \`api_access\` capability](/docs/api/customer-account-ui-extensions/configuration#api-access).`,
2222
codeblock: {
23-
title: 'Access the Storefront API with query',
23+
title: 'Extension.jsx',
2424
tabs: [
2525
{
26-
code: '../examples/apis/query.example.tsx',
26+
code: '../examples/apis/query.example.jsx',
2727
language: 'jsx',
28-
title: 'Preact',
2928
},
3029
],
3130
},
@@ -41,9 +40,9 @@ const data: ReferenceEntityTemplateSchema = {
4140
title: 'Accessing the Storefront API with fetch()',
4241
tabs: [
4342
{
44-
code: '../examples/apis/query-fetch.example.tsx',
43+
code: '../examples/apis/query-fetch.example.jsx',
4544
language: 'jsx',
46-
title: 'Preact',
45+
title: 'Extension.jsx',
4746
},
4847
],
4948
},

0 commit comments

Comments
 (0)