From 31aa3781c9e818c779b8db98535ee876a6027dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heiner=20P=C3=B6pping?= Date: Thu, 5 Dec 2024 11:02:55 +0100 Subject: [PATCH] Replace tapp class with page provider for v5 --- .../src/components/AppWrapper.jsx | 15 ++++++++------- .../page-module/src/components/AppWrapper.jsx | 5 ++++- .../page-redux/src/components/AppWrapper.jsx | 5 ++++- templates/api-v5/page-redux/src/index.html | 2 +- .../src/components/AppWrapper.tsx | 11 ++++++----- .../page-ts-module/src/components/AppWrapper.tsx | 11 ++++++----- .../page-ts-redux/src/components/AppWrapper.tsx | 5 ++++- templates/api-v5/page-ts-redux/src/index.html | 2 +- templates/api-v5/page-ts/src/index.html | 2 +- templates/api-v5/page-ts/src/index.tsx | 3 ++- templates/api-v5/page/src/index.html | 2 +- templates/api-v5/page/src/index.jsx | 3 ++- templates/api-v5/shared/index.html | 2 +- 13 files changed, 41 insertions(+), 27 deletions(-) diff --git a/templates/api-v5/page-module-redux/src/components/AppWrapper.jsx b/templates/api-v5/page-module-redux/src/components/AppWrapper.jsx index c4cbf6c..9b6c76c 100644 --- a/templates/api-v5/page-module-redux/src/components/AppWrapper.jsx +++ b/templates/api-v5/page-module-redux/src/components/AppWrapper.jsx @@ -1,19 +1,20 @@ import React from 'react'; import { ChaynsProvider, withCompatMode } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './App'; import store from '../redux-modules'; import { Provider } from 'react-redux'; const AppWrapper = ({ ...props }) => { return ( -
- {/* eslint-disable-next-line react/jsx-props-no-spreading */} - - + /* eslint-disable-next-line react/jsx-props-no-spreading */ + + + - - -
+ + + ) } diff --git a/templates/api-v5/page-module/src/components/AppWrapper.jsx b/templates/api-v5/page-module/src/components/AppWrapper.jsx index 9c9db73..161da71 100644 --- a/templates/api-v5/page-module/src/components/AppWrapper.jsx +++ b/templates/api-v5/page-module/src/components/AppWrapper.jsx @@ -1,5 +1,6 @@ import React from 'react'; import { ChaynsProvider, withCompatMode } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './App'; const AppWrapper = ({ ...props }) => { @@ -7,7 +8,9 @@ const AppWrapper = ({ ...props }) => {
{/* eslint-disable-next-line react/jsx-props-no-spreading */} - + + +
) diff --git a/templates/api-v5/page-redux/src/components/AppWrapper.jsx b/templates/api-v5/page-redux/src/components/AppWrapper.jsx index 5ef56b3..45373c7 100644 --- a/templates/api-v5/page-redux/src/components/AppWrapper.jsx +++ b/templates/api-v5/page-redux/src/components/AppWrapper.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { ChaynsProvider } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import store from '../redux-modules'; import App from './App'; @@ -8,7 +9,9 @@ const AppWrapper = () => { return ( - + + + ) diff --git a/templates/api-v5/page-redux/src/index.html b/templates/api-v5/page-redux/src/index.html index 7269552..c0ccf02 100644 --- a/templates/api-v5/page-redux/src/index.html +++ b/templates/api-v5/page-redux/src/index.html @@ -9,6 +9,6 @@ {{ readable-package-name }} -
+
diff --git a/templates/api-v5/page-ts-module-redux/src/components/AppWrapper.tsx b/templates/api-v5/page-ts-module-redux/src/components/AppWrapper.tsx index 9c9db73..056e4cb 100644 --- a/templates/api-v5/page-ts-module-redux/src/components/AppWrapper.tsx +++ b/templates/api-v5/page-ts-module-redux/src/components/AppWrapper.tsx @@ -1,15 +1,16 @@ import React from 'react'; import { ChaynsProvider, withCompatMode } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './App'; const AppWrapper = ({ ...props }) => { return ( -
- {/* eslint-disable-next-line react/jsx-props-no-spreading */} - + /* eslint-disable-next-line react/jsx-props-no-spreading */ + + - -
+ + ) } diff --git a/templates/api-v5/page-ts-module/src/components/AppWrapper.tsx b/templates/api-v5/page-ts-module/src/components/AppWrapper.tsx index 9c9db73..056e4cb 100644 --- a/templates/api-v5/page-ts-module/src/components/AppWrapper.tsx +++ b/templates/api-v5/page-ts-module/src/components/AppWrapper.tsx @@ -1,15 +1,16 @@ import React from 'react'; import { ChaynsProvider, withCompatMode } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './App'; const AppWrapper = ({ ...props }) => { return ( -
- {/* eslint-disable-next-line react/jsx-props-no-spreading */} - + /* eslint-disable-next-line react/jsx-props-no-spreading */ + + - -
+ + ) } diff --git a/templates/api-v5/page-ts-redux/src/components/AppWrapper.tsx b/templates/api-v5/page-ts-redux/src/components/AppWrapper.tsx index c81af90..d4bc27c 100644 --- a/templates/api-v5/page-ts-redux/src/components/AppWrapper.tsx +++ b/templates/api-v5/page-ts-redux/src/components/AppWrapper.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { ChaynsProvider } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './App'; import store from '../redux-modules'; @@ -8,7 +9,9 @@ const AppWrapper = () => { return ( - + + + ) diff --git a/templates/api-v5/page-ts-redux/src/index.html b/templates/api-v5/page-ts-redux/src/index.html index 7269552..c0ccf02 100644 --- a/templates/api-v5/page-ts-redux/src/index.html +++ b/templates/api-v5/page-ts-redux/src/index.html @@ -9,6 +9,6 @@ {{ readable-package-name }} -
+
diff --git a/templates/api-v5/page-ts/src/index.html b/templates/api-v5/page-ts/src/index.html index 7269552..c0ccf02 100644 --- a/templates/api-v5/page-ts/src/index.html +++ b/templates/api-v5/page-ts/src/index.html @@ -9,6 +9,6 @@ {{ readable-package-name }} -
+
diff --git a/templates/api-v5/page-ts/src/index.tsx b/templates/api-v5/page-ts/src/index.tsx index 544eedf..65670d1 100644 --- a/templates/api-v5/page-ts/src/index.tsx +++ b/templates/api-v5/page-ts/src/index.tsx @@ -1,11 +1,12 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; import { ChaynsProvider } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './components/App'; try { const root = createRoot(document.querySelector('#root')); - root.render(); + root.render(); } catch (e) { console.error('Encountered error at `ReactDOM.render`: ', e); } diff --git a/templates/api-v5/page/src/index.html b/templates/api-v5/page/src/index.html index 7269552..c0ccf02 100644 --- a/templates/api-v5/page/src/index.html +++ b/templates/api-v5/page/src/index.html @@ -9,6 +9,6 @@ {{ readable-package-name }} -
+
diff --git a/templates/api-v5/page/src/index.jsx b/templates/api-v5/page/src/index.jsx index 3d36465..bcefbe3 100644 --- a/templates/api-v5/page/src/index.jsx +++ b/templates/api-v5/page/src/index.jsx @@ -1,12 +1,13 @@ import React from 'react'; import { createRoot } from 'react-dom/client'; import { ChaynsProvider } from 'chayns-api'; +import { PageProvider } from '@chayns-components/core'; import App from './components/App'; try { const root = createRoot(document.querySelector('#root')); - root.render(); + root.render(); } catch (e) { console.error('Encountered error at `ReactDOM.render`: ', e); } diff --git a/templates/api-v5/shared/index.html b/templates/api-v5/shared/index.html index 888f2a7..b1fe832 100644 --- a/templates/api-v5/shared/index.html +++ b/templates/api-v5/shared/index.html @@ -9,6 +9,6 @@ {{ package-name }} -
+