From 240f28935db04d3e1ed6ebf40080ff50890b0d8f Mon Sep 17 00:00:00 2001 From: DmitriyB Date: Tue, 7 Mar 2023 15:59:17 +0500 Subject: [PATCH] ui update progress --- public/assets/locales/ru/translation.json | 2 +- src/App.css | 7 +++++ src/App.tsx | 12 +++++--- .../PopupComponent/PopupComponent.tsx | 2 +- src/components/pages/Main/Card/Card.tsx | 2 +- .../Stream/ControlButton/ControlButton.tsx | 2 +- .../pages/Stream/MicroButton/MicroButton.tsx | 2 +- .../PlayerComponent/PlayerComponent.tsx | 14 ++++++++-- .../pages/Stream/Sidebar/Sidebar.tsx | 9 +++++- .../Stream/SidebarDesktop/SidebarDesktop.tsx | 6 ++-- .../Stream/SidebarMobile/SidebarMobile.tsx | 20 +++++++++++-- src/components/pages/Stream/User/User.css | 15 ++++++++++ src/components/pages/Stream/User/User.tsx | 7 +++-- .../pages/Stream/UserList/UserList.tsx | 2 +- .../Stream/UserListMoblie/UserListMobile.tsx | 18 ++++++++++++ src/hooks/useWindowDimensions.ts | 7 +++-- src/index.css | 28 ++++++++++++++++++- src/store/reducers/ActionCreator.ts | 28 +++++++++++++++---- src/store/reducers/cardSlice.ts | 1 + src/store/reducers/sessionSlice.ts | 2 +- 20 files changed, 155 insertions(+), 31 deletions(-) create mode 100644 src/components/pages/Stream/UserListMoblie/UserListMobile.tsx diff --git a/public/assets/locales/ru/translation.json b/public/assets/locales/ru/translation.json index 11baeaa..a9bdb24 100644 --- a/public/assets/locales/ru/translation.json +++ b/public/assets/locales/ru/translation.json @@ -22,7 +22,7 @@ "popup-control-btn-active": "Ссылка скопирована", "language-control-btn": "Русский язык", "exit-control-btn": "Выйти", - "popup-control-exit-title": "Вы уверены, что хотите закончить демонстрацию??", + "popup-control-exit-title": "Вы уверены, что хотите закончить демонстрацию?", "popup-control-yes": "Закончить", "popup-control-no": "Остаться" diff --git a/src/App.css b/src/App.css index fc141e3..71b4a63 100644 --- a/src/App.css +++ b/src/App.css @@ -28,7 +28,9 @@ .card-container { display: flex; flex-direction: row; + flex-wrap: wrap; gap: 30px; + margin-bottom: 128px; } .card-title { @@ -61,12 +63,14 @@ .card-container { gap: 24px; + margin-bottom: 76px; } } @media screen and (max-width: 1152px) { .card-container { gap: 20px; + } .card-title { @@ -77,6 +81,8 @@ @media screen and (max-width: 1024px) { .card-container { gap: 10px; + margin-bottom: 10px; + } } @@ -92,6 +98,7 @@ .card-container { flex-direction: column; gap: 10px; + margin-bottom: 115px; } .content__container { diff --git a/src/App.tsx b/src/App.tsx index 7cd4180..adfbf0a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -22,9 +22,10 @@ const App: React.FC = () => { const dispatch = useAppDispatch(); const history = useHistory(); const { handleCurrentCard } = cardSlice.actions; - const { cards, currentCard } = useAppSelector((state) => state.cardReducer); + const { cards, currentCard, error } = useAppSelector((state) => state.cardReducer); + const { isLoading } = useAppSelector((state) => state.sessionReducer) const { currentLang } = useAppSelector((state) => state.languageReducer); - + console.log(error) useEffect(() => { dispatch(fetchCards(cookies.get("i18next"))); @@ -45,11 +46,13 @@ const App: React.FC = () => { const { t } = useTranslation(); + console.log(isLoading, 'LOADING') + return (
-

{t("demo-title")}

+

{error ? error : t("demo-title")}

{cards.map((i: ICards) => ( handleCards(i)} key={i._id} item={i}> @@ -60,7 +63,8 @@ const App: React.FC = () => { {currentCard ? (
-
+ {isLoading && (
+ )}
diff --git a/src/components/pages/ConnectPage/PopupComponent/PopupComponent.tsx b/src/components/pages/ConnectPage/PopupComponent/PopupComponent.tsx index 18a932a..8735451 100644 --- a/src/components/pages/ConnectPage/PopupComponent/PopupComponent.tsx +++ b/src/components/pages/ConnectPage/PopupComponent/PopupComponent.tsx @@ -53,7 +53,7 @@ export const PopupComponent: React.FC = () => { dispatch(createSession(currentCard.title))} + onConnect={() => dispatch(createSession(currentCard.app_title))} > )} diff --git a/src/components/pages/Main/Card/Card.tsx b/src/components/pages/Main/Card/Card.tsx index 708df8a..ccba53a 100644 --- a/src/components/pages/Main/Card/Card.tsx +++ b/src/components/pages/Main/Card/Card.tsx @@ -14,7 +14,7 @@ export const Card: React.FC = ({ item, onClick }) => {
лого
-

{item.app_title}

+

{item.title}

{item.location}

diff --git a/src/components/pages/Stream/ControlButton/ControlButton.tsx b/src/components/pages/Stream/ControlButton/ControlButton.tsx index f738459..0911c1e 100644 --- a/src/components/pages/Stream/ControlButton/ControlButton.tsx +++ b/src/components/pages/Stream/ControlButton/ControlButton.tsx @@ -29,7 +29,7 @@ export const ControlButton: React.FC = ({ } return ( -
+
)}