Skip to content

Commit

Permalink
Merge pull request #10089 from huwshimi/ua-subs-set-up-page
Browse files Browse the repository at this point in the history
Set up the Advantage page to mount a React app
  • Loading branch information
huwshimi committed Jul 28, 2021
2 parents 60f5741 + adc7cd7 commit b2828fd
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 470 deletions.
1 change: 1 addition & 0 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ let entries = {
productSelector: "./static/js/src/advantage/subscribe/product-selector.js",
openstackChart: "./static/js/src/openstack-chart.js",
uaSubscribe: "./static/js/src/advantage/subscribe/react/app.jsx",
uaSubscriptions: "./static/js/src/advantage/react/app.tsx",
"cloud-price-slider": "./static/js/src/cloud-price-slider.js",
};

Expand Down
30 changes: 30 additions & 0 deletions static/js/src/advantage/react/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from "react";
import ReactDOM from "react-dom";
import { QueryClient, QueryClientProvider } from "react-query";
import { ReactQueryDevtools } from "react-query/devtools";

const oneHour = 1000 * 60 * 60;
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
refetchOnMount: false,
refetchOnReconnect: false,
staleTime: oneHour,
retryOnMount: false,
},
},
});

const App = () => (
<QueryClientProvider client={queryClient}>
<section className="p-strip is-shallow">
<div className="row">
<div className="col-12">Content</div>
</div>
</section>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
);

ReactDOM.render(<App />, document.getElementById("react-root"));

0 comments on commit b2828fd

Please sign in to comment.