diff --git a/src/components/App.jsx b/src/components/App.jsx
index 2231b11..05df8b6 100644
--- a/src/components/App.jsx
+++ b/src/components/App.jsx
@@ -19,10 +19,9 @@ import WindowManager from './WindowManager';
const iconContextValue = { style: { verticalAlign: 'middle' } };
-const App = () => (
-
+const App = ({ store }) => (
+
-
@@ -33,16 +32,12 @@ const App = () => (
-
+
);
function renderApp(domParent, store) {
const root = createRoot(domParent);
- root.render(
-
-
- ,
- );
+ root.render();
}
export default renderApp;
diff --git a/src/components/AppWin.jsx b/src/components/AppWin.jsx
new file mode 100644
index 0000000..7cd6f7b
--- /dev/null
+++ b/src/components/AppWin.jsx
@@ -0,0 +1,29 @@
+/**
+ * Main App
+ */
+
+import React from 'react';
+import { Provider } from 'react-redux';
+import { createRoot } from 'react-dom/client';
+import { IconContext } from 'react-icons';
+
+import Style from './Style';
+import UIWin from './UIWin';
+
+const iconContextValue = { style: { verticalAlign: 'middle' } };
+
+const AppWin = ({ store }) => (
+
+
+
+
+
+
+);
+
+function renderAppWin(domParent, store) {
+ const root = createRoot(domParent);
+ root.render();
+}
+
+export default renderAppWin;
diff --git a/src/components/UIWin.jsx b/src/components/UIWin.jsx
new file mode 100644
index 0000000..dc1c5d4
--- /dev/null
+++ b/src/components/UIWin.jsx
@@ -0,0 +1,25 @@
+/*
+ *
+ */
+
+import React from 'react';
+import { useSelector } from 'react-redux';
+
+import { selectWindowType } from '../store/selectors/win';
+import COMPONENTS from './windows';
+
+const UIWin = () => {
+ const windowType = useSelector(selectWindowType);
+
+ const [Content, name] = COMPONENTS[windowType];
+
+ return (
+ <>
+ {(windowType)
+ ?
+ : Loading
}
+ >
+ );
+};
+
+export default React.memo(UIWin);
diff --git a/src/ssr/Win.jsx b/src/ssr/Win.jsx
index 48b5e4f..18fbf5d 100644
--- a/src/ssr/Win.jsx
+++ b/src/ssr/Win.jsx
@@ -5,18 +5,42 @@
/* eslint-disable max-len */
-import { getTTag } from '../core/ttag';
+import { langCodeToCC } from '../utils/location';
+import ttags, { getTTag } from '../core/ttag';
/* this will be set by webpack */
-import { assets } from '../core/assets';
-import { ASSET_SERVER } from '../core/config';
+import { styleassets, assets } from '../core/assets';
+import { ASSET_SERVER, BACKUP_URL } from '../core/config';
/*
- * generates string with html of globe page
+ * generate language list
+ */
+const langs = Object.keys(ttags)
+ .map((l) => (l === 'default' ? 'en' : l))
+ .map((l) => [l, langCodeToCC(l)]);
+
+/*
+ * values that we pass to client scripts
+ */
+const ssv = {
+ assetserver: ASSET_SERVER,
+ availableStyles: styleassets,
+ langs,
+};
+if (BACKUP_URL) {
+ ssv.backupurl = BACKUP_URL;
+}
+
+/*
+ * generates string with html of win page
* @param lang language code
* @return html of mainpage
*/
function generateWinPage(lang) {
+ const ssvR = {
+ ...ssv,
+ lang: lang === 'default' ? 'en' : lang,
+ };
const script = (assets[`win-${lang}`])
? assets[`win-${lang}`].js
: assets.win.js;
@@ -37,8 +61,12 @@ function generateWinPage(lang) {
/>
+
+
+
+