Skip to content

Commit 3ed6951

Browse files
iainmcampbellvividviolet
authored andcommitted
docs: everything else
1 parent c888987 commit 3ed6951

File tree

4 files changed

+122
-0
lines changed

4 files changed

+122
-0
lines changed

docs/ExtensionPoints/ReadMe.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Extensions Master List
2+
3+
- [SubscriptionManagementExtension](./SubscriptionManagementExtension.md)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Subscription Management Extension
2+
3+
This extension renders in the Product Details and Product Variants Page and is housed inside a Modal container.
4+
5+
## Allowed components
6+
7+
- [Badge](../Components/Badge.md)
8+
- [Banner](../Components/Banner.md)
9+
- [Button](../Components/Button.md)
10+
- [Checkbox](../Components/Checkbox.md)
11+
- [Clickable](../Components/Clickable.md)
12+
- [Icon](../Components/Icon.md)
13+
- [Link](../Components/Link.md)
14+
- [Radio](../Components/Radio.md)
15+
- [ResourceItem](../Components/ResourceItem.md)
16+
- [ResourceList](../Components/ResourceList.md)
17+
- [Select](../Components/Select.md)
18+
- [Spinner](../Components/Spinner.md)
19+
- [Stack](../Components/Stack.md)
20+
- [StackItem](../Components/StackItem.md)
21+
- [Text](../Components/Text.md)
22+
- [TextField](../Components/TextField.md)
23+
- [Thumbnail](../Components/Thumbnail.md)
24+
25+
## Available utilities/input
26+
27+
- [Modal Actions](../Utilities/ModalActions.md)
28+
- [Layout](../Utilities/Layout.md)
29+
- [Locale](../Utilities/Locale.md)
30+
- [Product Data](../Utilities/ProductData.md)
31+
- [Session Token](../Utilities/SessionToken.md)
32+
- [Toast](../Utilities/Toast.md)
33+
34+
## Product Data
35+
36+
TODO - Product data structure goes here

docs/ExternalAPI/ReadMe.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## Hitting an external API
2+
3+
A subset of fetch is made available in the extension’s context.
4+
You can use this to make API calls to your app’s backend service.
5+
6+
You can acquire a [session token](../Utilities/SessionToken.md) to authenticate the API call with your app’s backend service.
7+
8+
Currently, calls to Shopify APIs must be made by your app’s backend service.

docs/ReadMe.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Client Side Documentation
2+
3+
## Contents
4+
5+
- [Extension Points](./ExtensionPoints/README.md)
6+
- [Components](./Components/README.md)
7+
- [Utilities](./Utilities/README.md)
8+
- [Calling external APIs](./ExternalApi/README.md)
9+
10+
## Getting Started
11+
12+
### 1. Install the Shopify CLI
13+
14+
Follow the instructions to install the app Shopify CLI (extensions fork [here](https://github.com/Shopify/shopify-app-cli-extensions))
15+
16+
### 2. Create an extension
17+
18+
Run `shopify create extension` to get started.
19+
This command will clone an extension template, which contains a basic extension.
20+
21+
### 3. Run the local server
22+
23+
Run `shopify serve` and start coding! All the code you will write for your extension should be within the `src` folder using the index entry point generated. This ensures that the CLI will know what to bundle when pushing your extension to shopify.
24+
25+
## Render API
26+
27+
The `render` method provided by Argo lets you tell Shopify what you want to render and where you want to render it.
28+
It’s similar to `ReactDOM.render`, but works with vanilla JavaScript:
29+
30+
```js
31+
render(ExtensionPoint, renderCallback);
32+
```
33+
34+
#### Arguments
35+
36+
- `ExtensionPoint`: Where in the Shopify Admin the extension should render. Import this enum from Argo.
37+
- `renderCallback`: A method that returns Argo components to be rendered.
38+
39+
#### Vanilla Example
40+
41+
```js
42+
import {ExtensionPoint, render, Text} from '@shopify/argo-admin';
43+
44+
render(ExtensionPoint.MyExtension, (root) => {
45+
const text = root.createComponent(TextField, {
46+
style: 'strong',
47+
alignment: 'center'
48+
});
49+
50+
text.appendChild('This is the best extension.');
51+
root.appendChild(text);
52+
53+
root.mount();
54+
});
55+
```
56+
57+
#### React Example
58+
59+
```js
60+
import {ExtensionPoint, render, Text} from '@shopify/argo-admin';
61+
62+
function App() {
63+
return (
64+
<Text
65+
style="strong"
66+
alignment="center"
67+
>
68+
This is the best extension.
69+
</Text>
70+
)
71+
}
72+
73+
render(ExtensionPoint.MyExtension, () => <App />);
74+
```
75+

0 commit comments

Comments
 (0)