Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up the Advantage page to mount a React app #10089

Merged
merged 1 commit into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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"));