diff --git a/package-lock.json b/package-lock.json index fdd7385..71ef235 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@types/react-redux": "^7.1.24", "@types/react-router": "^5.1.20", "@types/socket.io": "^3.0.2", + "axios": "^1.3.4", "framer-motion": "^7.4.0", "i18next": "^22.4.6", "i18next-browser-languagedetector": "^7.0.1", @@ -4938,6 +4939,29 @@ "node": ">=4" } }, + "node_modules/axios": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", + "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "dependencies": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios/node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -14146,6 +14170,11 @@ "node": ">= 0.10" } }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -20942,6 +20971,28 @@ "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.4.3.tgz", "integrity": "sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w==" }, + "axios": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.4.tgz", + "integrity": "sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==", + "requires": { + "follow-redirects": "^1.15.0", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + }, + "dependencies": { + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + } + } + }, "axobject-query": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-2.2.0.tgz", @@ -27447,6 +27498,11 @@ } } }, + "proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", diff --git a/package.json b/package.json index b6136de..340d6d2 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@types/react-redux": "^7.1.24", "@types/react-router": "^5.1.20", "@types/socket.io": "^3.0.2", + "axios": "^1.3.4", "framer-motion": "^7.4.0", "i18next": "^22.4.6", "i18next-browser-languagedetector": "^7.0.1", diff --git a/public/assets/locales/en/translation.json b/public/assets/locales/en/translation.json index 2e87a6a..6cc5227 100644 --- a/public/assets/locales/en/translation.json +++ b/public/assets/locales/en/translation.json @@ -20,7 +20,7 @@ "popup-control-link": "Link for connection", "popup-control-btn": "Copy", "popup-control-btn-active": "Link Copied", - "language-control-btn": "Language", + "language-control-btn": "English", "exit-control-btn": "Exit", "popup-control-exit-title": "Are you sure you want to end the demo?", "popup-control-yes": "Finish", diff --git a/public/assets/locales/ru/translation.json b/public/assets/locales/ru/translation.json index 5a969a7..11baeaa 100644 --- a/public/assets/locales/ru/translation.json +++ b/public/assets/locales/ru/translation.json @@ -20,7 +20,7 @@ "popup-control-link": "Ссылка для подключения", "popup-control-btn": "Скопировать", "popup-control-btn-active": "Ссылка скопирована", - "language-control-btn": "Язык", + "language-control-btn": "Русский язык", "exit-control-btn": "Выйти", "popup-control-exit-title": "Вы уверены, что хотите закончить демонстрацию??", "popup-control-yes": "Закончить", diff --git a/src/App.css b/src/App.css index afdf2e7..fc141e3 100644 --- a/src/App.css +++ b/src/App.css @@ -11,13 +11,9 @@ display: flex; justify-content: center; align-items: center; - position: absolute; - top: 50%; - left: 50%; border-width: 0px 2px; border-style: solid; border-color: #23242a; - transform: translate(-50%, -50%); } .popup { @@ -51,6 +47,11 @@ border-radius: 16px; } +.popup-container { + display: flex; + justify-content: center; +} + @media screen and (max-width: 1440px) { @@ -73,6 +74,12 @@ } } +@media screen and (max-width: 1024px) { + .card-container { + gap: 10px; + } +} + @media screen and (max-width: 920px) { .card-title { margin: 36px 0 32px 0; diff --git a/src/App.tsx b/src/App.tsx index 92cff59..cb3a381 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -25,12 +25,17 @@ const App: React.FC = () => { const { handleCurrentCard } = cardSlice.actions; const { handleChangeLanguage } = languageSlice.actions; const { cards, currentCard } = useAppSelector((state) => state.cardReducer); + const { currentLang } = useAppSelector((state) => state.languageReducer); + useEffect(() => { - dispatch(fetchCards()); - dispatch(handleChangeLanguage(cookies.get("i18next"))); + dispatch(fetchCards(cookies.get("i18next"))); }, []); + useEffect(() => { + dispatch(fetchCards(cookies.get("i18next"))); + }, [currentLang]) + const handleCards = (card: ICards) => { dispatch(handleCurrentCard(card)); history.push("/connect-page"); @@ -59,8 +64,10 @@ const App: React.FC = () => { {currentCard ? (
{currentLang === "ru" - ? item.description.ru - : item.description.en} +
+ {item.description}
- {item.description_second ?{currentLang === "ru" - ? item.description_second.ru - : item.description_second.en} + {item.feature_description ?
+ {item.feature_description}
: }