Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jgodson/shopify-script-creator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.5.0
Choose a base ref
...
head repository: jgodson/shopify-script-creator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

There isn’t anything to compare.

0.5.0 and master are entirely different commit histories.

Showing with 56 additions and 14 deletions.
  1. +4 −4 docs/bundle.js
  2. +12 −10 src/components/InfoBanner.js
  3. +38 −0 src/components/WarningBanner.js
  4. +2 −0 src/index.js
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
@@ -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() {
@@ -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>
)
}
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
@@ -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';

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