@openstack_dev/gatsby-theme-marketing-oif-core 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/gatsby-browser.js CHANGED
@@ -1,5 +1,5 @@
1
- import ReduxWrapper from "./src/state/ReduxWrapper";
1
+ import { ReduxWrapperWithTheme } from "./src/state/ReduxWrapper";
2
2
 
3
- export const wrapRootElement = ReduxWrapper;
3
+ export const wrapRootElement = ReduxWrapperWithTheme;
4
4
 
5
5
  export const onClientEntry = () => {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openstack_dev/gatsby-theme-marketing-oif-core",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Base theme for Marketing Sites",
5
5
  "author": "smarcet",
6
6
  "keywords": [
@@ -1 +1 @@
1
- { "staticJsonFilesBuildTime": [], "lastBuild": 1713843468311 }
1
+ { "staticJsonFilesBuildTime": [], "lastBuild": 1713847296425 }
@@ -1,29 +1,41 @@
1
1
  import * as React from "react";
2
2
  import { Provider } from "react-redux";
3
3
  import { PersistGate } from "redux-persist/integration/react";
4
- import { store, persistor } from "./store";
5
4
  import { ThemeProvider } from "@mui/material/styles";
6
5
  import CssBaseline from "@mui/material/CssBaseline";
6
+ import { store, persistor } from "./store";
7
7
  import theme from "../theme";
8
8
 
9
9
  const onBeforeLift = () => {
10
- const params = new URLSearchParams(window.location.search);
11
- const flush = params.has("flushState");
10
+ const params = new URLSearchParams(window.location.search);
11
+ const flush = params.has("flushState");
12
12
 
13
- if (flush) {
14
- //store.dispatch({ type: RESET_STATE, payload: null });
15
- }
13
+ if (flush) {
14
+ // store.dispatch({ type: RESET_STATE, payload: null });
15
+ }
16
16
  };
17
17
 
18
- const ReduxWrapper = ({ element }) => (
18
+ function ReduxWrapper({ element }) {
19
+ return (
20
+ <Provider store={store}>
21
+ <PersistGate onBeforeLift={onBeforeLift} persistor={persistor}>
22
+ {() => element}
23
+ </PersistGate>
24
+ </Provider>
25
+ );
26
+ }
27
+
28
+ export function ReduxWrapperWithTheme({ element }) {
29
+ return (
19
30
  <Provider store={store}>
20
- <PersistGate onBeforeLift={onBeforeLift} persistor={persistor}>
21
- <ThemeProvider theme={theme}>
22
- <CssBaseline />
23
- {element}
24
- </ThemeProvider>
25
- </PersistGate>
31
+ <PersistGate onBeforeLift={onBeforeLift} persistor={persistor}>
32
+ <ThemeProvider theme={theme}>
33
+ <CssBaseline />
34
+ {() => element}
35
+ </ThemeProvider>
36
+ </PersistGate>
26
37
  </Provider>
27
- );
38
+ );
39
+ }
28
40
 
29
41
  export default ReduxWrapper;