Skip to content

Commit

Permalink
Release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
jgodson committed Aug 3, 2024
1 parent 0b60680 commit 1465df7
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/bundle.js

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions src/components/InfoBanner.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ export default class InfoBanner extends React.Component {
super();

this.state = {
dismissed: false
dismissed: localStorage.getItem('developedBannerDismissed') === 'true' || false
};

this.dismissBanner = this.dismissBanner.bind(this);
}

dismissBanner() {
this.setState({dismissed: true});
this.setState({ dismissed: true });
localStorage.setItem('developedBannerDismissed', 'true');
}

render() {
Expand All @@ -22,14 +23,15 @@ export default class InfoBanner extends React.Component {
}

return (
<div style={{marginRight: '80px'}} >
<Banner
status="info"

onDismiss={this.dismissBanner}
>
<p>Please note that this app is not developed by Shopify. Please do not contact Shopify Support for help.</p>
</Banner>
<div style={{ display: 'flex', justifyContent: 'center' }} >
<div style={{ marginRight: '80px', marginLeft: '80px', maxWidth: 'fit-content' }} >
<Banner
status="info"
onDismiss={this.dismissBanner}
>
<p>Please note that this app is not developed by Shopify. Please do not contact Shopify Support for help.</p>
</Banner>
</div>
</div>
)
}
Expand Down
38 changes: 38 additions & 0 deletions src/components/WarningBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import { Banner, Link } from '@shopify/polaris';

export default class WarningBanner extends React.Component {
constructor() {
super();

this.state = {
dismissed: localStorage.getItem('warningBannerDismissed') === 'true' || false
};

this.dismissBanner = this.dismissBanner.bind(this);
}

dismissBanner() {
this.setState({ dismissed: true });
localStorage.setItem('warningBannerDismissed', 'true');
}

render() {
if (this.state.dismissed) {
return null;
}

return (
<div style={{ display: 'flex', justifyContent: 'center' }} >
<div style={{ marginRight: '80px', marginLeft: '80px', maxWidth: 'fit-content' }} >
<Banner
status="warning"
onDismiss={this.dismissBanner}
>
<p>Shopify Scripts are deprecated and will be <Link external url='https://help.shopify.com/en/manual/checkout-settings/script-editor/migrating'>unavailable after August 28, 2025</Link>. Consider trying out the <Link external url='https://apps.shopify.com/checkout-blocks'>Checkout Blocks</Link> app.</p>
</Banner>
</div>
</div>
)
}
}
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import bugsnag from '@bugsnag/js'
import bugsnagReact from '@bugsnag/plugin-react'
import Versions from './versions';
import InfoBanner from './components/InfoBanner';
import WarningBanner from './components/WarningBanner';
import ErrorPage from './components/ErrorPage'
import App from './App';

Expand All @@ -23,6 +24,7 @@ ReactDOM.render(
<AppProvider>
<ErrorBoundary FallbackComponent={ErrorPage}>
<InfoBanner />
<WarningBanner />
<App />
</ErrorBoundary>
</AppProvider>,
Expand Down

0 comments on commit 1465df7

Please sign in to comment.