Skip to content

Commit

Permalink
fix: clean up references to app bridge react
Browse files Browse the repository at this point in the history
  • Loading branch information
devisscher committed Apr 18, 2024
1 parent ee9c8cc commit 456cb0f
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 20 deletions.
4 changes: 0 additions & 4 deletions .storybook/preview-head.html

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ yarn add @shopify/discount-app-components

```js
import {Page, AppProvider as PolarisAppProvider} from '@shopify/polaris';
import {Provider as AppBridgeProvider} from '@shopify/app-bridge-react';
import {AppProvider as DiscountsProvider} from '@shopify/discount-app-components';
// See [Polaris AppProvider documentation](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/AppProvider/README.md#using-translations) for more details on using Polaris translations
Expand Down
13 changes: 0 additions & 13 deletions src/components/AppProvider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,12 @@

App provider is a required component that enables sharing global settings throughout the hierarchy of your application.

---

## Usage and best practices

The app provider component is required to use `@shopify/discount-app-components`. Without it the components in your application will not function correctly. You must wrap the root (the top) of your application in the app provider component.

This project uses [@shopify/polaris](https://github.com/Shopify/polaris) and [@shopify/app-bridge-react](https://github.com/Shopify/app-bridge/tree/main/packages/app-bridge-react) under the hood, so you will also need to wrap your app root in the [Polaris AppProvider](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/AppProvider/README.md) and the [AppBridge Provider](https://github.com/Shopify/app-bridge/blob/main/packages/app-bridge-react/src/components/Provider/README.md).

---

## Examples

### Usage

```js
import {Page, AppProvider as PolarisAppProvider} from '@shopify/polaris';
import {Provider as AppBridgeProvider} from '@shopify/app-bridge-react';
import {AppProvider} from '@shopify/discount-app-components';

// See [Polaris AppProvider documentation](https://github.com/Shopify/polaris/blob/main/polaris-react/src/components/AppProvider/README.md#using-translations) for more details on using Polaris translations
Expand All @@ -35,15 +24,13 @@ export default function App() {
...

return (
<AppBridgeProvider config={/* pass your app bridge config here */}>
<PolarisAppProvider i18n={enPolarisTranslations}>
<AppProvider locale="en-US" ianaTimezone="America/Los_Angeles">
<Page title="Example app">
{/* Add your discount components here */}
</Page>
</AppProvider>
</PolarisAppProvider>
</AppBridgeProvider>
);
}
```
Expand Down
2 changes: 1 addition & 1 deletion src/components/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Components

Our components are a collection of interface elements that can be reused and composed to build discounts-focused [AppBridge](https://shopify.dev/apps/tools/app-bridge) apps.
Our components are a collection of interface elements that can be reused and composed to build discounts-focused apps.

---

Expand Down
1 change: 0 additions & 1 deletion src/stories/foundation/Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import enPolarisTranslations from '@shopify/polaris/locales/en.json';
import '@shopify/polaris/build/esm/styles.css';

import {AppProvider as PolarisAppProvider} from '@shopify/polaris';
// import {Provider as AppBridgeProvider} from '@shopify/app-bridge-react';
import {AppProvider} from '../../components/AppProvider';

export function Provider({children}: {children: React.ReactNode}) {
Expand Down

0 comments on commit 456cb0f

Please sign in to comment.