From 19e548359aa312bd98bfc7b7dbca14408d74db15 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Fri, 28 Jul 2023 17:58:07 +0300 Subject: [PATCH 001/153] Refactor: styling of the video consultation room and change the activity indicator when the client joins/leaves the room --- src/blocks/VideoRoom/VideoRoom.jsx | 57 ++++++---- src/blocks/VideoRoom/utils/useRoom.js | 10 +- .../VideoRoom/utils/useRoomConnection.js | 5 +- src/blocks/VideoRoom/video-room.scss | 103 +++++++++++------- src/pages/Consultation/Consultation.jsx | 28 ++++- src/pages/Consultation/consultation.scss | 5 +- 6 files changed, 136 insertions(+), 72 deletions(-) diff --git a/src/blocks/VideoRoom/VideoRoom.jsx b/src/blocks/VideoRoom/VideoRoom.jsx index c938c223..635adeab 100644 --- a/src/blocks/VideoRoom/VideoRoom.jsx +++ b/src/blocks/VideoRoom/VideoRoom.jsx @@ -1,5 +1,4 @@ -import React from "react"; -import { useEffect } from "react"; +import React, { useEffect, useMemo } from "react"; import Participant from "./Participant"; import useRoom from "./utils/useRoom"; @@ -16,7 +15,9 @@ export function VideoRoom({ handleSendMessage, hasUnreadMessages, isProviderInSession, + setIsProviderInSession, token, + hideControls, t, }) { const roomName = consultation.consultationId; @@ -30,7 +31,7 @@ export function VideoRoom({ toggleCamera, isMicrophoneOn, toggleMicrophone, - } = useRoom(joinWithVideo, joinWithMicrophone); + } = useRoom(joinWithVideo, joinWithMicrophone, setIsProviderInSession); useEffect(() => { if (!room && token && roomName) { @@ -46,7 +47,17 @@ export function VideoRoom({ } }, [connectRoom, disconnectRoom, room, roomName, token]); - const hasRemoteParticipants = remoteParticipants?.length > 0; + const hasRemoteParticipants = useMemo(() => { + return remoteParticipants?.length > 0; + }, [remoteParticipants]); + + useEffect(() => { + if (isProviderInSession && !hasRemoteParticipants) { + setIsProviderInSession(false); + } else if (!isProviderInSession && hasRemoteParticipants) { + setIsProviderInSession(true); + } + }, [isProviderInSession, hasRemoteParticipants]); const handleLeaveConsultation = () => { disconnectRoom(); @@ -55,23 +66,29 @@ export function VideoRoom({ return (
- + {!hideControls && ( + + )} -
+
{!hasRemoteParticipants ? (
diff --git a/src/blocks/VideoRoom/utils/useRoom.js b/src/blocks/VideoRoom/utils/useRoom.js index 142acd13..2024022a 100644 --- a/src/blocks/VideoRoom/utils/useRoom.js +++ b/src/blocks/VideoRoom/utils/useRoom.js @@ -3,8 +3,14 @@ import useRoomConnection from "./useRoomConnection"; import useToggleCamera from "./useToggleCamera"; import useToggleMicrophone from "./useToggleMicrophone"; -export default function useRoom(startWithVideoOn, startWithAudioOn) { - const { room, error, connectRoom, disconnectRoom } = useRoomConnection(); +export default function useRoom( + startWithVideoOn, + startWithAudioOn, + setIsProviderInSession +) { + const { room, error, connectRoom, disconnectRoom } = useRoomConnection( + setIsProviderInSession + ); const { localParticipant, remoteParticipants } = useParticipant({ room }); const { isCameraOn, toggleCamera } = useToggleCamera({ room, diff --git a/src/blocks/VideoRoom/utils/useRoomConnection.js b/src/blocks/VideoRoom/utils/useRoomConnection.js index 136bc8d3..d93f8bd3 100644 --- a/src/blocks/VideoRoom/utils/useRoomConnection.js +++ b/src/blocks/VideoRoom/utils/useRoomConnection.js @@ -6,7 +6,7 @@ const INITIAL_STATE = { error: null, }; -export default function useRoomConnection() { +export default function useRoomConnection(setIsProviderInSession) { const [roomState, setRoomState] = useState(INITIAL_STATE); const { room } = roomState; @@ -39,6 +39,9 @@ export default function useRoomConnection() { */ useEffect(() => { if (room) { + room.on("participantDisconnected", () => setIsProviderInSession(false)); + room.on("participantConnected", () => setIsProviderInSession(true)); + window.addEventListener("beforeunload", disconnectRoom); window.addEventListener("pagehide", disconnectRoom); diff --git a/src/blocks/VideoRoom/video-room.scss b/src/blocks/VideoRoom/video-room.scss index 049e28a6..e65b00fd 100644 --- a/src/blocks/VideoRoom/video-room.scss +++ b/src/blocks/VideoRoom/video-room.scss @@ -15,6 +15,12 @@ margin-right: $spacing_2_2; } + &__loading { + display: flex; + justify-content: center; + align-items: center; + } + &__participants { position: relative; min-height: 100vh; @@ -27,56 +33,73 @@ min-width: calc(100vw - 50em); min-height: 48rem; } - } - .video-off { - align-items: center; - background-color: $color_black_37; - border: 1px solid $color_primary_20809e; - display: flex; - justify-content: center; - } + & .remote-video, + & .remote-video-off.video-off { + height: 100vh; + width: 100vw; + display: flex; + justify-content: center; + align-items: center; + object-fit: cover; + transform: scaleX(-1); - & .remote-video, - & .remote-video-off.video-off { - height: 100vh; - width: 100vw; - display: flex; - justify-content: center; - align-items: center; - object-fit: cover; - transform: scaleX(-1); + @media screen and (min-width: 1024px) { + // width: calc(100vw - 50rem); + width: 100%; + border-radius: 2.5rem; + // max-height: 80vh; + max-height: calc(100vh - 15rem); + } + } - @media screen and (min-width: 1024px) { - // width: calc(100vw - 50rem); - width: 100%; + & .local-video, + & .local-video-off.video-off { + visibility: visible; + width: 13rem; + height: 13rem; + object-fit: cover; + position: absolute; + bottom: 0.5rem; + right: $spacing_1_8; + z-index: 2; + transform: scaleX(-1); border-radius: 2.5rem; - // max-height: 80vh; - max-height: calc(100vh - 15rem); + + @media screen and (min-width: 1024px) { + width: 19rem; + height: 19rem; + } } - } - & .local-video, - & .local-video-off.video-off { - width: 13rem; - height: 13rem; - object-fit: cover; - position: absolute; - bottom: 0.5rem; - right: $spacing_1_8; - z-index: 2; - transform: scaleX(-1); - border-radius: 2.5rem; + & .local-video-off.video-off, + & .remote-video-off.video-off { + transform: scaleX(1); + } - @media screen and (min-width: 1024px) { - width: 19rem; - height: 19rem; + &--shrink-video { + & .remote-video, + & .remote-video-off.video-off { + height: 50vh; + width: 50vh; + margin: 0 auto; + + @media screen and (min-width: 1024px) { + height: calc(50vh - 10rem); + } + } + & .local-video { + visibility: hidden; + } } } - & .local-video-off.video-off, - & .remote-video-off.video-off { - transform: scaleX(1); + .video-off { + align-items: center; + background-color: $color_black_37; + border: 1px solid $color_primary_20809e; + display: flex; + justify-content: center; } @media screen and (min-width: $screen-md) { diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index 60da2a78..f25b2be8 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -436,7 +436,7 @@ export const Consultation = () => { setHasUnreadMessages(false); } - if (width < 1024) { + if (width < 1366) { setIsChatShownOnMobile(!isChatShownOnMobile); } else { setIsChatShownOnTablet(!isChatShownOnTablet); @@ -444,10 +444,6 @@ export const Consultation = () => { }; const leaveConsultation = () => { - leaveConsultationMutation.mutate({ - consultationId: consultation.consultationId, - userType: "client", - }); setIsSafetyFeedbackShown(true); const leaveMessage = { time: JSON.stringify(new Date().getTime()), @@ -467,6 +463,11 @@ export const Consultation = () => { to: "provider", message: leaveMessage, }); + + leaveConsultationMutation.mutate({ + consultationId: consultation.consultationId, + userType: "client", + }); }; useEffect(() => { @@ -491,6 +492,18 @@ export const Consultation = () => { }); }; + const [hideControls, setHideControls] = useState(false); + + useEffect(() => { + if (isChatShownOnMobile) { + setTimeout(() => { + setHideControls(true); + }, 500); + } else { + setHideControls(false); + } + }, [width, isChatShownOnMobile]); + return isSafetyFeedbackShown ? ( { token={token} hasUnreadMessages={hasUnreadMessages} isProviderInSession={isProviderInSession} + setIsProviderInSession={setIsProviderInSession} + hideControls={hideControls} t={t} /> {isChatShownOnTablet && width >= 1366 && ( @@ -540,8 +555,9 @@ export const Consultation = () => {
setIsChatShownOnMobile(false)} + showAlwaysAsBackdrop // reference={width < 768 ? backdropMessagesContainerRef : null} headingComponent={ Date: Fri, 28 Jul 2023 18:02:35 +0300 Subject: [PATCH 002/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 85fba79f..0baccea9 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 85fba79fbe143a253679c5c41e9ba033b76a95e5 +Subproject commit 0baccea95072fc8f1a2dab5a88a2205f2a41bc7a From a61b1d19fcf278127f00658ddbf2968de41712d5 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 09:44:56 +0300 Subject: [PATCH 003/153] Fix: hide the chat backdrop if the screen is larger than 1366. Also move up the send message input --- src/pages/Consultation/Consultation.jsx | 4 ++-- src/pages/Consultation/consultation.scss | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index f25b2be8..583e4407 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -529,7 +529,7 @@ export const Consultation = () => { hasUnreadMessages={hasUnreadMessages} isProviderInSession={isProviderInSession} setIsProviderInSession={setIsProviderInSession} - hideControls={hideControls} + hideControls={hideControls && width < 1366} t={t} /> {isChatShownOnTablet && width >= 1366 && ( @@ -555,7 +555,7 @@ export const Consultation = () => {
setIsChatShownOnMobile(false)} showAlwaysAsBackdrop // reference={width < 768 ? backdropMessagesContainerRef : null} diff --git a/src/pages/Consultation/consultation.scss b/src/pages/Consultation/consultation.scss index 5dd7ebec..7e7244a0 100644 --- a/src/pages/Consultation/consultation.scss +++ b/src/pages/Consultation/consultation.scss @@ -129,4 +129,8 @@ width: 100%; top: 0; } + + & .send-message { + margin-bottom: $spacing_2_8; + } } From b22b59521adee8acf3e01226226cf18bbccc3c93 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 09:45:02 +0300 Subject: [PATCH 004/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 0baccea9..1bafb8d7 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 0baccea95072fc8f1a2dab5a88a2205f2a41bc7a +Subproject commit 1bafb8d7e995c06d7ea99714a4d64f0125df46c4 From cd7f010e5625f9bff095df9666ffac23a26b6790 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 13:49:05 +0300 Subject: [PATCH 005/153] Add: country's local name to the countries object while fetching them --- src/blocks/Page/Page.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blocks/Page/Page.jsx b/src/blocks/Page/Page.jsx index e410dd2c..a88b15d3 100644 --- a/src/blocks/Page/Page.jsx +++ b/src/blocks/Page/Page.jsx @@ -104,6 +104,7 @@ export const Page = ({ minAge: x["min_client_age"], maxAge: x["max_client_age"], currencySymbol: x["symbol"], + localName: x.local_name, }; if (localStorageCountry === x.alpha2) { From b95eee8bd0582b39414b9ba2cfc9d28d69cffd2f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 13:49:19 +0300 Subject: [PATCH 006/153] Add: loggedIn to the enabled variable in Root.jsx --- src/routes/Root/Root.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes/Root/Root.jsx b/src/routes/Root/Root.jsx index 8926a802..4d1e9ed9 100644 --- a/src/routes/Root/Root.jsx +++ b/src/routes/Root/Root.jsx @@ -56,11 +56,12 @@ export default function Root() { const token = localStorage.getItem("token"); const isTmpUser = userSvc.getUserID() === "tmp-user"; - const enabled = token && !isTmpUser; - useGetClientData(!!enabled); const [loggedIn, setLoggedIn] = useState(!!token); + const enabled = token && !isTmpUser && loggedIn; + useGetClientData(!!enabled); + const [activeCoupon, setActiveCoupon] = useState(); const [isRegistrationModalOpan, setIsRegistrationModalOpen] = useState(false); From 8c13ebdf8658b91ce1be344cdfc0f2336cee807e Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 13:49:25 +0300 Subject: [PATCH 007/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 1bafb8d7..f9e05827 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 1bafb8d7e995c06d7ea99714a4d64f0125df46c4 +Subproject commit f9e058273944c7a883eaa5760baeedd383d37b08 From 1b30798cc4042f1a93586c130928a43f238f49b5 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 13:51:33 +0300 Subject: [PATCH 008/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index f9e05827..6c54e495 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit f9e058273944c7a883eaa5760baeedd383d37b08 +Subproject commit 6c54e4959e372e9e89bca9e7e2e90dec513026bf From 109f8b238d07b23f75ed37ff6296f66947593ced Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 14:20:31 +0300 Subject: [PATCH 009/153] Fix: open new tabs with a 'noreferrer' --- src/modals/PaymentInformation/PaymentInformation.jsx | 2 +- src/modals/RequireDataAgreement/RequireDataAgreement.jsx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modals/PaymentInformation/PaymentInformation.jsx b/src/modals/PaymentInformation/PaymentInformation.jsx index 88b43677..e2a20725 100644 --- a/src/modals/PaymentInformation/PaymentInformation.jsx +++ b/src/modals/PaymentInformation/PaymentInformation.jsx @@ -26,7 +26,7 @@ export const PaymentInformation = ({ isOpen, onClose, data }) => { const { t } = useTranslation("payment-information"); const handleViewReceiptButtonClick = (receiptUrl) => { - window.open(receiptUrl, "_blank"); + window.open(receiptUrl, "_blank", "noreferrer"); }; const paymentTime = getTime(date); diff --git a/src/modals/RequireDataAgreement/RequireDataAgreement.jsx b/src/modals/RequireDataAgreement/RequireDataAgreement.jsx index 68b9aa8a..e130714b 100644 --- a/src/modals/RequireDataAgreement/RequireDataAgreement.jsx +++ b/src/modals/RequireDataAgreement/RequireDataAgreement.jsx @@ -77,7 +77,9 @@ export const RequireDataAgreement = ({ - window.open(`${WEBSITE_URL}/privacy-policy`, "_blank").focus() + window + .open(`${WEBSITE_URL}/privacy-policy`, "_blank", "noreferrer") + .focus() } > {t("privacy_policy")} From daf3e0a647cdb305e8dc425236f4fd0797468743 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 31 Jul 2023 14:21:32 +0300 Subject: [PATCH 010/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 6c54e495..0c8db837 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 6c54e4959e372e9e89bca9e7e2e90dec513026bf +Subproject commit 0c8db837977864e63d5c2b7ddf64417e20032cd1 From c36e30be6ecb69467398b40498c00f7fb966a6ff Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 3 Aug 2023 14:49:37 +0300 Subject: [PATCH 011/153] Refactor: disable submitting the form when the captcha is not valid --- src/blocks/RegisterEmail/RegisterEmail.jsx | 4 +++- src/pages/RegisterEmail/RegisterEmail.jsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/blocks/RegisterEmail/RegisterEmail.jsx b/src/blocks/RegisterEmail/RegisterEmail.jsx index 2404adf6..f59a19c6 100644 --- a/src/blocks/RegisterEmail/RegisterEmail.jsx +++ b/src/blocks/RegisterEmail/RegisterEmail.jsx @@ -36,6 +36,7 @@ export const RegisterEmail = ({ isMutating, handleCaptchaChange, showCaptcha, + isCaptchaValid, }) => { const { t } = useTranslation("register-email"); const navigate = useNavigate(); @@ -110,7 +111,8 @@ export const RegisterEmail = ({ data.isPrivacyAndTermsSelected && data.isAgeTermsSelected && data.email && - data.nickname; + data.nickname && + isCaptchaValid; return ( diff --git a/src/pages/RegisterEmail/RegisterEmail.jsx b/src/pages/RegisterEmail/RegisterEmail.jsx index f48908c0..fbd0d6b0 100644 --- a/src/pages/RegisterEmail/RegisterEmail.jsx +++ b/src/pages/RegisterEmail/RegisterEmail.jsx @@ -140,7 +140,7 @@ export const RegisterEmail = () => { } submitError={submitError} handleCaptchaChange={handleCaptchaChange} - isSubmitEnabled={!!isCaptchaValid} + isCaptchaValid={!!isCaptchaValid} showCaptcha={SHOW_CAPTCHA} /> Date: Fri, 4 Aug 2023 10:41:36 +0300 Subject: [PATCH 012/153] Fix: add the currency symbol to the price in PaymentInformation modal --- src/blocks/PaymentHistory/PaymentHistory.jsx | 1 + src/modals/PaymentInformation/PaymentInformation.jsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/blocks/PaymentHistory/PaymentHistory.jsx b/src/blocks/PaymentHistory/PaymentHistory.jsx index c118c763..19e50680 100644 --- a/src/blocks/PaymentHistory/PaymentHistory.jsx +++ b/src/blocks/PaymentHistory/PaymentHistory.jsx @@ -185,6 +185,7 @@ export const PaymentHistory = () => { isOpen={isPaymentInformationModalOpen} onClose={() => closePaymentModal()} data={selectedPaymentData} + currencySymbol={currencySymbol} /> )} diff --git a/src/modals/PaymentInformation/PaymentInformation.jsx b/src/modals/PaymentInformation/PaymentInformation.jsx index e2a20725..d61f6b15 100644 --- a/src/modals/PaymentInformation/PaymentInformation.jsx +++ b/src/modals/PaymentInformation/PaymentInformation.jsx @@ -13,7 +13,12 @@ import "./payment-information.scss"; * * @return {jsx} */ -export const PaymentInformation = ({ isOpen, onClose, data }) => { +export const PaymentInformation = ({ + isOpen, + onClose, + data, + currencySymbol, +}) => { const { service, paymentMethod, @@ -97,7 +102,10 @@ export const PaymentInformation = ({ isOpen, onClose, data }) => {

{t("price")} - {price} + + {price} + {currencySymbol} +

From 2ee2c9f6f44416ff466e7511432bee108f00922b Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:15:45 +0300 Subject: [PATCH 013/153] Fix: QuestionDetails styling --- src/modals/QuestionDetails/QuestionDetails.jsx | 4 ++-- src/modals/QuestionDetails/question-details.scss | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modals/QuestionDetails/QuestionDetails.jsx b/src/modals/QuestionDetails/QuestionDetails.jsx index 93f4abad..cb6c082a 100644 --- a/src/modals/QuestionDetails/QuestionDetails.jsx +++ b/src/modals/QuestionDetails/QuestionDetails.jsx @@ -97,9 +97,9 @@ export const QuestionDetails = ({ })}
) : null} -

+

         {question.answerText}
-      

+
{question.answerId && (
diff --git a/src/modals/QuestionDetails/question-details.scss b/src/modals/QuestionDetails/question-details.scss index 8b608a9c..f734ced0 100644 --- a/src/modals/QuestionDetails/question-details.scss +++ b/src/modals/QuestionDetails/question-details.scss @@ -41,6 +41,7 @@ &__answer-text { margin-top: $spacing_0_8; + font-family: $font_family; } &__bottom-container { From 83e6c126fe8ea82ff35734888dd68477544c5c9e Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:19:41 +0300 Subject: [PATCH 014/153] Refactor: data processing modal in the user details to have a privacy policy link --- src/blocks/UserDetails/UserDetails.jsx | 50 ++++++++++++++++++++++-- src/blocks/UserDetails/user-details.scss | 5 +++ 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/src/blocks/UserDetails/UserDetails.jsx b/src/blocks/UserDetails/UserDetails.jsx index 7cbc3a55..e3d3d46b 100644 --- a/src/blocks/UserDetails/UserDetails.jsx +++ b/src/blocks/UserDetails/UserDetails.jsx @@ -1,7 +1,7 @@ import React, { useState, useEffect, useCallback } from "react"; import { useNavigate } from "react-router-dom"; import { useMutation, useQueryClient } from "@tanstack/react-query"; -import { useTranslation } from "react-i18next"; +import { useTranslation, Trans } from "react-i18next"; import { toast } from "react-toastify"; import { AccessToken, @@ -26,6 +26,9 @@ import { useGetClientData, useUpdateClientData } from "#hooks"; import Joi from "joi"; import "./user-details.scss"; + +const WEBSITE_URL = import.meta.env.VITE_WEBSITE_URL; + /** * UserDetails * @@ -353,7 +356,26 @@ export const UserDetails = ({ {t("privacy")}

-

{t("consent")}

+

+ + window + .open( + `${WEBSITE_URL}/privacy-policy`, + "_blank", + "noreferrer" + ) + .focus() + } + className="user-details__modal-heading" + />, + ]} + > + {t("consent")} + +

+ window + .open( + `${WEBSITE_URL}/privacy-policy`, + "_blank", + "noreferrer" + ) + .focus() + } + />, + ]} + > + {t("data_processing_modal_heading")} + + } text={t("data_processing_modal_text")} ctaLabel={t("data_processing_modal_confirm_button")} ctaHandleClick={() => { diff --git a/src/blocks/UserDetails/user-details.scss b/src/blocks/UserDetails/user-details.scss index dbf06bef..29c8b387 100644 --- a/src/blocks/UserDetails/user-details.scss +++ b/src/blocks/UserDetails/user-details.scss @@ -80,4 +80,9 @@ padding: 0; } } + + &__modal-heading { + color: $color_primary_20809e; + cursor: pointer; + } } From 856390bcc5582715196f44977ed7561179851d9f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:20:09 +0300 Subject: [PATCH 015/153] Fix: translations --- src/blocks/Page/locales/en.json | 2 +- src/blocks/UserDetails/locales/en.json | 4 ++-- src/blocks/UserDetails/locales/kk.json | 2 +- src/blocks/UserDetails/locales/ru.json | 2 +- src/modals/RequireDataAgreement/locales/en.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/blocks/Page/locales/en.json b/src/blocks/Page/locales/en.json index 078e71b8..0e1c444b 100644 --- a/src/blocks/Page/locales/en.json +++ b/src/blocks/Page/locales/en.json @@ -8,7 +8,7 @@ "footer_2": "Consultations", "footer_3": "Information portal", "footer_4": "Your profile", - "footer_5": "Terms and Conditions", + "footer_5": "Terms of Use", "footer_6": "Privacy Policy", "footer_7": "Cookie Settings", "footer_8": "FAQ", diff --git a/src/blocks/UserDetails/locales/en.json b/src/blocks/UserDetails/locales/en.json index 327dba18..0b997b1b 100644 --- a/src/blocks/UserDetails/locales/en.json +++ b/src/blocks/UserDetails/locales/en.json @@ -18,7 +18,7 @@ "button_text": "Save changes", "button_secondary_text": "Discard changes", "privacy": "Privacy and security", - "consent": "Consent for personal data processing", + "consent": "Consent for personal data usage as defined by the <0>Privacy Policy", "change_password": "Change password", "delete_account": "Delete account", "logout": "Logout", @@ -31,7 +31,7 @@ "sex_none": "Prefer not to say", "place_of_living_urban": "Urban", "place_of_living_rural": "Rural", - "data_processing_modal_heading": "Are you sure you want to remove the permission to process your personal data?", + "data_processing_modal_heading": "Are you sure you want to remove the permission to use your personal data as defined by the <0>Privacy Policy?", "data_processing_modal_text": "You will not be able to schedule further consultations.", "data_processing_modal_confirm_button": "Remove permission", "data_processing_modal_cancel_button": "Cancel", diff --git a/src/blocks/UserDetails/locales/kk.json b/src/blocks/UserDetails/locales/kk.json index aae5c1d7..a5adca45 100644 --- a/src/blocks/UserDetails/locales/kk.json +++ b/src/blocks/UserDetails/locales/kk.json @@ -31,7 +31,7 @@ "sex_none": "Айтпауды жөн көремін", "place_of_living_urban": "Қала", "place_of_living_rural": "Ауыл", - "data_processing_modal_heading": "Дербес деректеріңізді өңдеуге берген рұқсатыңызды кері қайтарып алғыңыз келетініне сенімдісіз бе?", + "data_processing_modal_heading": "Are you sure you want to remove the permission to use your personal data as defined by the <0>Privacy Policy?KK", "data_processing_modal_text": "Сіз қосымша кеңес беруді жоспарлай алмайсыз.", "data_processing_modal_confirm_button": "Рұқсатты жою", "data_processing_modal_cancel_button": "Болдырмау", diff --git a/src/blocks/UserDetails/locales/ru.json b/src/blocks/UserDetails/locales/ru.json index 7cbb956a..a247a4c1 100644 --- a/src/blocks/UserDetails/locales/ru.json +++ b/src/blocks/UserDetails/locales/ru.json @@ -31,7 +31,7 @@ "sex_none": "Предпочитаю не говорить", "place_of_living_urban": "Город", "place_of_living_rural": "Село", - "data_processing_modal_heading": "Уверены, что хотите отозвать разрешение на обработку своих персональных данных?", + "data_processing_modal_heading": "Are you sure you want to remove the permission to use your personal data as defined by the <0>Privacy Policy?RU", "data_processing_modal_text": "Вы не сможете запланировать дальнейшие консультации.", "data_processing_modal_confirm_button": "Удалить разрешение", "data_processing_modal_cancel_button": "Отмена", diff --git a/src/modals/RequireDataAgreement/locales/en.json b/src/modals/RequireDataAgreement/locales/en.json index 4f78bed0..bcd86cc9 100644 --- a/src/modals/RequireDataAgreement/locales/en.json +++ b/src/modals/RequireDataAgreement/locales/en.json @@ -2,7 +2,7 @@ "heading": "Do you give us permission to use your data as defined by the privacy policy?", "text": "Your personal information will not be exposed, this permission will be used only for medical data and chat history to be proccesed and stored in the platform.", "text2": "If you would like to learn more about how we process personal data, please visit our ", - "terms": "Terms and conditions.", + "terms": "Terms of Use.", "privacy_policy": "Privacy policy", "give_permission": "Give permission", "cancel": "Cancel" From cb7b6e238e42696b321861e66325889490d10e9c Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:38:00 +0300 Subject: [PATCH 016/153] Fix: translations --- src/backdrops/FilterProviders/locales/en.json | 3 ++- src/backdrops/FilterProviders/locales/kk.json | 1 + src/backdrops/FilterProviders/locales/ru.json | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backdrops/FilterProviders/locales/en.json b/src/backdrops/FilterProviders/locales/en.json index a244e268..a79d3dea 100644 --- a/src/backdrops/FilterProviders/locales/en.json +++ b/src/backdrops/FilterProviders/locales/en.json @@ -8,7 +8,8 @@ "female": "Female", "unspecified": "Unspecified", "provider_type_checkbox_group_label": "Provider type", - "provider_sex_checkbox_group_label": "Gender of the provider", + "provider_sex_checkbox_group_label": "Sex of the provider", + "not_mentioned": "Prefer not to say", "max_price": "Maximum price", "max_price_placeholder": "Select a maximum price", "language": "Language", diff --git a/src/backdrops/FilterProviders/locales/kk.json b/src/backdrops/FilterProviders/locales/kk.json index 7d6e187c..0f53d01b 100644 --- a/src/backdrops/FilterProviders/locales/kk.json +++ b/src/backdrops/FilterProviders/locales/kk.json @@ -7,6 +7,7 @@ "male": "Ер", "female": "Әйел", "unspecified": "Көрсетілмеген", + "not_mentioned": "Айтпауды жөн көремін", "provider_type_checkbox_group_label": "Консультант түрі", "provider_sex_checkbox_group_label": "Консультанттын жынысы", "max_price": "Ең жоғары баға", diff --git a/src/backdrops/FilterProviders/locales/ru.json b/src/backdrops/FilterProviders/locales/ru.json index d69fd171..613a13ed 100644 --- a/src/backdrops/FilterProviders/locales/ru.json +++ b/src/backdrops/FilterProviders/locales/ru.json @@ -7,6 +7,7 @@ "male": "Мужчина", "female": "Женщина", "unspecified": "Не указан", + "not_mentioned": "Предпочитаю не говорить", "provider_type_checkbox_group_label": "Вид консультанта", "provider_sex_checkbox_group_label": "Пол консультанта", "max_price": "Максимальная цена", @@ -16,6 +17,6 @@ "providers_free_consultation_label": "Только бесплатная консультация", "button_label": "Примените фильтры", "reset_filter": "Сбросить фильтр", - "available_before": "Доступно до", + "available_before": "Доступно до", "available_after": "Доступно после" } From cd92153783363994e29592375a995a98c22897a0 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:53:45 +0300 Subject: [PATCH 017/153] Refactor: the SelectProvider to load the providers on scroll and to filter them in the server --- .../FilterProviders/FilterProviders.jsx | 102 +++++++----- src/blocks/SelectProvider/SelectProvider.jsx | 33 +++- src/hooks/useGetProvidersData.js | 94 ++++++++--- src/pages/SelectProvider/SelectProvider.jsx | 155 ++++++------------ 4 files changed, 212 insertions(+), 172 deletions(-) diff --git a/src/backdrops/FilterProviders/FilterProviders.jsx b/src/backdrops/FilterProviders/FilterProviders.jsx index c621034e..652a9942 100644 --- a/src/backdrops/FilterProviders/FilterProviders.jsx +++ b/src/backdrops/FilterProviders/FilterProviders.jsx @@ -21,45 +21,15 @@ import "./filter-providers.scss"; * * @return {jsx} */ -export const FilterProviders = ({ isOpen, onClose, sharedFilters }) => { +export const FilterProviders = ({ + isOpen, + onClose, + allFilters, + setAllFilters, +}) => { const { t } = useTranslation("filter-providers"); - const fetchLanguages = async () => { - const res = await languageSvc.getAllLanguages(); - const languages = res.data.map((x) => { - const languageObject = { - value: x["language_id"], - alpha2: x.alpha2, - label: x.name, - id: x["language_id"], - }; - return languageObject; - }); - return languages; - }; - const languagesQuery = useQuery(["all-languages"], fetchLanguages, { - retry: false, - }); - - const initialFilters = { - providerTypes: [], - providerSex: [], - maxPrice: "", - language: null, - onlyFreeConsultation: false, - availableAfter: "", - availableBefore: "", - }; - - const [data, setData] = useState(initialFilters); - - useEffect(() => { - setData((data) => ({ - ...data, - maxPrice: sharedFilters.maxPrice, - onlyFreeConsultation: sharedFilters.onlyFreeConsultation, - })); - }, [sharedFilters]); + const [data, setData] = useState({ ...allFilters }); const [providerTypes, setProviderTypes] = useState([ { @@ -87,8 +57,62 @@ export const FilterProviders = ({ isOpen, onClose, sharedFilters }) => { }, { label: t("female"), value: "female", isSelected: false }, { label: t("unspecified"), value: "unspecified", isSelected: false }, + { label: t("notMentioned"), value: "not_mentioned", isSelected: false }, ]); + useEffect(() => { + const dataCopy = JSON.stringify(data); + const allFiltersCopy = JSON.stringify(allFilters); + if (dataCopy !== allFiltersCopy) { + setData(allFilters); + } + + setProviderTypes((prev) => { + return prev.map((x) => { + return { + ...x, + isSelected: allFilters.providerTypes.includes(x.value), + }; + }); + }); + + setProviderSex((prev) => { + return prev.map((x) => { + return { + ...x, + isSelected: allFilters.providerSex.includes(x.value), + }; + }); + }); + }, [allFilters]); + + const fetchLanguages = async () => { + const res = await languageSvc.getAllLanguages(); + const languages = res.data.map((x) => { + const languageObject = { + value: x["language_id"], + alpha2: x.alpha2, + label: x.name, + id: x["language_id"], + }; + return languageObject; + }); + return languages; + }; + const languagesQuery = useQuery(["all-languages"], fetchLanguages, { + retry: false, + }); + + const initialFilters = { + providerTypes: [], + providerSex: [], + maxPrice: "", + language: null, + onlyFreeConsultation: false, + availableAfter: "", + availableBefore: "", + }; + const handleSelect = (field, value) => { const dataCopy = { ...data }; dataCopy[field] = value; @@ -105,12 +129,12 @@ export const FilterProviders = ({ isOpen, onClose, sharedFilters }) => { .filter((x) => x.isSelected) .map((x) => x.value); - setData(dataCopy); + setAllFilters(dataCopy); onClose(dataCopy); }; const handleResetFilters = () => { - setData(initialFilters); + setAllFilters(initialFilters); onClose(initialFilters); }; diff --git a/src/blocks/SelectProvider/SelectProvider.jsx b/src/blocks/SelectProvider/SelectProvider.jsx index ec5dcbaf..7b384dfc 100644 --- a/src/blocks/SelectProvider/SelectProvider.jsx +++ b/src/blocks/SelectProvider/SelectProvider.jsx @@ -1,11 +1,14 @@ import React from "react"; import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; +import InfiniteScroll from "react-infinite-scroll-component"; + import { Block, Grid, GridItem, ProviderOverview, + Loading, } from "@USupport-components-library/src"; import "./select-provider.scss"; @@ -17,14 +20,26 @@ import "./select-provider.scss"; * * @return {jsx} */ -export const SelectProvider = ({ providers, activeCoupon }) => { +export const SelectProvider = ({ + activeCoupon, + providersQuery, + isFiltering, +}) => { const { t } = useTranslation("select-provider"); const navigate = useNavigate(); const handleProviderClick = (provider) => { navigate(`/provider-overview?provider-id=${provider.providerDetailId}`); }; + + const providers = providersQuery.data?.pages.flat() || []; const renderProviders = () => { + if ((isFiltering && providersQuery.isFetching) || providersQuery.isLoading) + return ( + + + + ); if (providers?.length === 0) return ( @@ -59,9 +74,19 @@ export const SelectProvider = ({ providers, activeCoupon }) => { return ( - - {renderProviders()} - + } + initialScrollY={20} + hasChildren={true} + scrollThreshold={0} + > + + {renderProviders()} + + ); }; diff --git a/src/hooks/useGetProvidersData.js b/src/hooks/useGetProvidersData.js index c2fafa11..531acf46 100644 --- a/src/hooks/useGetProvidersData.js +++ b/src/hooks/useGetProvidersData.js @@ -1,16 +1,65 @@ -import { useQuery } from "@tanstack/react-query"; -import { useState } from "react"; +import { useInfiniteQuery } from "@tanstack/react-query"; import { providerSvc } from "@USupport-components-library/services"; +const constructFiltersQueryString = (filters) => { + const providerTypes = filters.providerTypes?.join(","); + const sex = filters.providerSex?.join(","); + const language = filters.language; + const maxPrice = filters.maxPrice; + const onlyFreeConsultation = filters.onlyFreeConsultation; + const availableAfter = new Date(filters.availableAfter).getTime() / 1000; + const availableBefore = new Date(filters.availableBefore).getTime() / 1000; + + let queryString = ""; + if (providerTypes) { + queryString += `&providerTypes=${providerTypes}`; + } + + if (sex) { + queryString += `&sex=${sex}`; + } + + if (maxPrice) { + queryString += `&maxPrice=${maxPrice}`; + } + + if (availableAfter) { + queryString += `&availableAfter=${availableAfter}`; + } + + if (availableBefore) { + queryString += `&availableBefore=${availableBefore}`; + } + + if (onlyFreeConsultation) { + queryString += `&onlyFreeConsultation=${true}`; + } + + if (language) { + queryString += `&language=${language}`; + } + + return queryString || ""; +}; + /** * Reuseable hook to get and transform the client data in a desired format */ -export default function useGetProvidersData(activeCoupon = null) { - const [providersData, setProvidersData] = useState(); - const fetchProvidersData = async () => { - const { data } = await providerSvc.getAllProviders( - activeCoupon?.campaignId - ); +export default function useGetProvidersData( + activeCoupon = null, + filters, + onSuccess = () => {} +) { + const fetchProvidersData = async ({ pageParam = 1 }) => { + const providersLimit = 15; + const filtersQueryString = constructFiltersQueryString(filters); + + const { data } = await providerSvc.getAllProviders({ + campaignId: activeCoupon?.campaignId, + limit: providersLimit, + offset: pageParam, + filtersQueryString, + }); const formattedData = []; for (let i = 0; i < data.length; i++) { const providerData = data[i]; @@ -30,34 +79,31 @@ export default function useGetProvidersData(activeCoupon = null) { workWith: providerData.work_with || [], totalConsultations: providerData.total_consultations || 0, earliestAvailableSlot: providerData.earliest_available_slot || "", + latestAvailableSlot: providerData.latest_available_slot || "", couponPrice: providerData.price_per_coupon || 0, }; formattedData.push(formattedProvider); } // Return only the providers that have available slot - return formattedData - .filter((x) => x.earliestAvailableSlot) - .sort((a, b) => { - return ( - new Date(a.earliestAvailableSlot) - new Date(b.earliestAvailableSlot) - ); - }); + return formattedData; }; - - const providersDataQuery = useQuery( - ["all-providers-data", activeCoupon], + const providersDataQuery = useInfiniteQuery( + ["all-providers-data", activeCoupon, filters], fetchProvidersData, { - onSuccess: (data) => { - const dataCopy = JSON.parse(JSON.stringify(data)); - setProvidersData([...dataCopy]); + getNextPageParam: (lastPage, pages) => { + if (lastPage.length === 0) { + return undefined; + } + return pages.length + 1; + }, + onSuccess: () => { + onSuccess(); }, - notifyOnChangeProps: ["data"], enabled: activeCoupon === null ? true : !!activeCoupon, } ); - - return [providersDataQuery, providersData, setProvidersData]; + return providersDataQuery; } export { useGetProvidersData }; diff --git a/src/pages/SelectProvider/SelectProvider.jsx b/src/pages/SelectProvider/SelectProvider.jsx index 0e977f8a..f42afba5 100644 --- a/src/pages/SelectProvider/SelectProvider.jsx +++ b/src/pages/SelectProvider/SelectProvider.jsx @@ -42,98 +42,49 @@ export const SelectProvider = () => { const [couponValue, setCouponValue] = useState(""); const [couponError, setCouponError] = useState(""); const [isLoading, setIsLoading] = useState(false); - const [sharedFilters, setSharedFilters] = useState({ + + const initialFilters = { + providerTypes: [], + providerSex: [], maxPrice: "", + language: null, onlyFreeConsultation: false, + availableAfter: "", + availableBefore: "", + }; + const [allFilters, setAllFilters] = useState({ + ...initialFilters, }); + // Set this to true when the filters have been changed and set + // it back to false when the providers data has been fetched + const [isFiltering, setIsFiltering] = useState(false); - const [providersDataQuery, providersData, setProvidersData] = - useGetProvidersData(activeCoupon); + const onSuccess = () => { + setIsFiltering(false); + }; + const providersQuery = useGetProvidersData( + activeCoupon, + allFilters, + onSuccess + ); + const [providersData, setProvidersData] = useState(); + + useEffect(() => { + if (providersQuery.data) { + setProvidersData(providersQuery.data.pages.flat()); + } + }, [providersQuery.data]); const closeFilter = () => setIsFilterOpen(false); const handleFilterClick = () => { setIsFilterOpen(true); }; - const checkProviderHasType = (provider, types) => { - return types - .map((x) => { - return provider.specializations.includes(x); - }) - .some((x) => x === true); - }; - const handleFilterSave = (data) => { - const { - providerTypes, - providerSex, - maxPrice, - language, - onlyFreeConsultation, - availableAfter, - availableBefore, - } = data; - setSharedFilters({ - maxPrice, - onlyFreeConsultation, - }); - const initialData = JSON.parse( - JSON.stringify(providersDataQuery.data || []) - ); - const filteredData = []; - for (let i = 0; i < initialData.length; i++) { - const provider = initialData[i]; - const hasType = - !providerTypes || providerTypes.length === 0 - ? true - : checkProviderHasType(provider, providerTypes); - - const isDesiredSex = - !providerSex || providerSex.length === 0 - ? true - : providerSex.includes(provider.sex); - - const isPriceMatching = - maxPrice === "" - ? true - : provider.consultationPrice <= Number(maxPrice) - ? true - : false; - - const providerLanguages = provider.languages.map((x) => x.language_id); - const providerHasLanguage = !language - ? true - : providerLanguages.includes(language); - - const providesFreeConsultation = !onlyFreeConsultation - ? true - : provider.consultationPrice === 0 || !provider.consultationPrice; + setIsFiltering(true); - const isAvailableAfter = !availableAfter - ? true - : new Date(new Date(availableAfter).setHours(0, 0, 0, 0)).getTime() <= - new Date(provider.earliestAvailableSlot).getTime(); + setAllFilters((prev) => ({ ...prev, ...data })); - const isAvailableBefore = !availableBefore - ? true - : new Date(availableBefore).getTime() >= - new Date( - new Date(provider.earliestAvailableSlot).setHours(0, 0, 0, 0) - ).getTime(); - - if ( - hasType && - isDesiredSex && - isPriceMatching && - providerHasLanguage && - providesFreeConsultation && - isAvailableAfter && - isAvailableBefore - ) { - filteredData.push(provider); - } - } - setProvidersData(filteredData); closeFilter(); }; @@ -155,6 +106,7 @@ export const SelectProvider = () => { campaignId: data.campaign_id, }); closeCouponModal(); + setCouponError(""); } } catch (err) { const { message: errorMessage } = useError(err); @@ -194,24 +146,25 @@ export const SelectProvider = () => { activeCoupon={activeCoupon} removeCoupon={removeCoupon} openCouponModal={openCouponModal} - sharedFilters={sharedFilters} + allFilters={allFilters} + setAllFilters={setAllFilters} + isFiltering={isFiltering} /> - {(providersDataQuery.isLoading && !providersData) || - providersDataQuery.isFetching ? ( - - ) : ( - - )} + + + {width < 768 && } handleFilterSave(data)} - sharedFilters={sharedFilters} + allFilters={allFilters} + setAllFilters={setAllFilters} /> { - const [data, setData] = useState({ - maxPrice: "", - onlyFreeConsultation: false, - }); - - useEffect(() => { - setData({ ...sharedFilters }); - }, [sharedFilters]); - const handleChange = (field, val) => { - const newData = { ...data }; + const newData = { ...allFilters }; newData[field] = val; - setData(newData); + setAllFilters(newData); handleSave(newData); }; @@ -267,11 +212,11 @@ const FiltersBlock = ({ type="number" label={t("max_price")} placeholder={t("max_price")} - value={data.maxPrice} + value={allFilters.maxPrice} onChange={(e) => handleChange("maxPrice", e.target.value)} /> handleChange("onlyFreeConsultation", val)} label={t("providers_free_consultation_label")} /> From aad8941d8e5467dc59baecf9eb43a0e7ae7ae94f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 14:53:53 +0300 Subject: [PATCH 018/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 0c8db837..8b5a9db2 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 0c8db837977864e63d5c2b7ddf64417e20032cd1 +Subproject commit 8b5a9db20f46f832b356f02dedd3c6750c3c15a2 From d7caf230985608593751e03f33034c45c8c64281 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Tue, 8 Aug 2023 15:10:35 +0300 Subject: [PATCH 019/153] Fix: dont show providers that have no availability --- src/hooks/useGetProvidersData.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/useGetProvidersData.js b/src/hooks/useGetProvidersData.js index 531acf46..78f4d380 100644 --- a/src/hooks/useGetProvidersData.js +++ b/src/hooks/useGetProvidersData.js @@ -85,7 +85,7 @@ export default function useGetProvidersData( formattedData.push(formattedProvider); } // Return only the providers that have available slot - return formattedData; + return formattedData.filter((x) => x.earliestAvailableSlot); }; const providersDataQuery = useInfiniteQuery( ["all-providers-data", activeCoupon, filters], From c61c8f1b807ebd490c97c269cb667f766b865eb0 Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Fri, 25 Aug 2023 00:50:04 +0300 Subject: [PATCH 020/153] Refactor: creator field in ArticleView --- src/blocks/ArticleView/ArticleView.jsx | 5 +++-- src/pages/ArticleInformation/ArticleInformation.jsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/blocks/ArticleView/ArticleView.jsx b/src/blocks/ArticleView/ArticleView.jsx index 5e1d940a..85cb72ed 100644 --- a/src/blocks/ArticleView/ArticleView.jsx +++ b/src/blocks/ArticleView/ArticleView.jsx @@ -18,7 +18,8 @@ import "./article-view.scss"; * * @return {jsx} */ -export const ArticleView = ({ articleData }) => { +export const ArticleView = ({ articleData, t }) => { + const creator = articleData.creator ? articleData.creator : null; return ( @@ -39,7 +40,7 @@ export const ArticleView = ({ articleData }) => { -

By {articleData.creator}

+ {creator &&

{t("by", { creator })}

}

{articleData.readingTime} min read

diff --git a/src/pages/ArticleInformation/ArticleInformation.jsx b/src/pages/ArticleInformation/ArticleInformation.jsx index ec0bbdbf..e86d84d5 100644 --- a/src/pages/ArticleInformation/ArticleInformation.jsx +++ b/src/pages/ArticleInformation/ArticleInformation.jsx @@ -99,7 +99,7 @@ export const ArticleInformation = () => { return ( {articleData ? ( - + ) : ( )} From 66cb8bf5524a98977611c386781fe2610ab0a027 Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Fri, 25 Aug 2023 00:50:19 +0300 Subject: [PATCH 021/153] Refactor: git submodules --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 8b5a9db2..006c5292 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 8b5a9db20f46f832b356f02dedd3c6750c3c15a2 +Subproject commit 006c529215cfd177b84a73cac4ec7f17734cdd23 From f9c340004ef7dc68a371eb4d064d6f9a598d9e6d Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Fri, 25 Aug 2023 10:43:11 +0300 Subject: [PATCH 022/153] Fix: contact-form reasons not translating when changing language --- src/blocks/ContactUs/ContactUs.jsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/blocks/ContactUs/ContactUs.jsx b/src/blocks/ContactUs/ContactUs.jsx index acf0ae92..fc8a6643 100644 --- a/src/blocks/ContactUs/ContactUs.jsx +++ b/src/blocks/ContactUs/ContactUs.jsx @@ -41,10 +41,10 @@ export const ContactUs = () => { const { isTmpUser } = useContext(RootContext); const initialIssues = [ - { value: "information", label: t("contact_reason_1") }, - { value: "services-information", label: t("contact_reason_2") }, - { value: "technical-problem", label: t("contact_reason_3") }, - { value: "other", label: t("contact_reason_4") }, + { value: "information", label: "contact_reason_1" }, + { value: "services-information", label: "contact_reason_2" }, + { value: "technical-problem", label: "contact_reason_3" }, + { value: "other", label: "contact_reason_4" }, ]; const navigate = useNavigate(); @@ -133,7 +133,7 @@ export const ContactUs = () => { const payload = { subjectValue: data.issue, subjectLabel: t("contact_form"), - title: issues.find((x) => x.value === data.issue)?.label, + title: t(issues.find((x) => x.value === data.issue)?.label), text: data.message, email: data.email, }; @@ -153,7 +153,10 @@ export const ContactUs = () => { errorMessage={errors.issue} classes="contact-us__issue-input" placeholder={t("issue_placeholder")} - options={issues} + options={issues.map((x) => ({ + ...x, + label: t(x.label), + }))} selected={data.issue} setSelected={handleIssueChange} /> From b685a16b4f3e237ae871b670a8b45dc928ce2aec Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Wed, 30 Aug 2023 18:26:28 +0300 Subject: [PATCH 023/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 006c5292..a62fba1e 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 006c529215cfd177b84a73cac4ec7f17734cdd23 +Subproject commit a62fba1e822e68be343449ef1223b91418cc0224 From 4b78bc15bb41c0aa56c45f9ebca17a905de9b09b Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 31 Aug 2023 11:55:52 +0300 Subject: [PATCH 024/153] Fix: small styling adjustment --- src/blocks/Page/page.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blocks/Page/page.scss b/src/blocks/Page/page.scss index 259baeaf..a0833b46 100644 --- a/src/blocks/Page/page.scss +++ b/src/blocks/Page/page.scss @@ -72,6 +72,7 @@ } &__subheading-text { + white-space: pre-line; text-align: left; padding-left: $spacing_2_4; From a1c663ea53ea1c7867a3cc8b8af3cd7db39ba33d Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 31 Aug 2023 11:56:09 +0300 Subject: [PATCH 025/153] Refactor: translation --- src/pages/SelectProvider/locales/en.json | 2 +- src/pages/SelectProvider/locales/kk.json | 2 +- src/pages/SelectProvider/locales/ru.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/SelectProvider/locales/en.json b/src/pages/SelectProvider/locales/en.json index 63b6814e..cf411d41 100644 --- a/src/pages/SelectProvider/locales/en.json +++ b/src/pages/SelectProvider/locales/en.json @@ -1,6 +1,6 @@ { "heading": "Select a Provider ", - "subheading": "Choose the provider you want to talk to in a video, audio or text consultation", + "subheading": "Choose the provider you want to talk to in a video, audio or text consultation.\n It can sometimes take time to find a provider that is a good fit for your needs and your preferred approach.", "button_label": "Filter", "button_coupon_label": "Use coupon", "modal_coupon_heading": "Enter your coupon to use it", diff --git a/src/pages/SelectProvider/locales/kk.json b/src/pages/SelectProvider/locales/kk.json index 385746b5..d8b943e2 100644 --- a/src/pages/SelectProvider/locales/kk.json +++ b/src/pages/SelectProvider/locales/kk.json @@ -1,6 +1,6 @@ { "heading": "Консультантты таңдау", - "subheading": "Бейне, аудио немесе мәтіндік консультация арқылы сөйлескіңіз келетін консультантты таңдаңыз", + "subheading": "Бейне, аудио немесе мәтіндік консультация арқылы сөйлескіңіз келетін консультантты таңдаңыз\n It can sometimes take time to find a provider that is a good fit for your needs and your preferred approachKK.", "button_label": "Сүзгі", "button_coupon_label": "Купонды пайдаланыңыз", "modal_coupon_heading": "Купонды пайдалану үшін оны енгізіңіз", diff --git a/src/pages/SelectProvider/locales/ru.json b/src/pages/SelectProvider/locales/ru.json index 7cf03de9..dce1e00e 100644 --- a/src/pages/SelectProvider/locales/ru.json +++ b/src/pages/SelectProvider/locales/ru.json @@ -1,6 +1,6 @@ { "heading": "Выбрать консультанта", - "subheading": "Выберите консультанта, с которым хотите поговорить на видео, аудио или текстовой консультации", + "subheading": "Выберите консультанта, с которым хотите поговорить на видео, аудио или текстовой консультации\n It can sometimes take time to find a provider that is a good fit for your needs and your preferred approach.RU", "button_label": "Фильтр", "button_coupon_label": "Используйте купон", "modal_coupon_heading": "Введите свой купон, чтобы использовать его", From 5b55792583aace4f88bda4f94dcf46084629697f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 31 Aug 2023 11:56:41 +0300 Subject: [PATCH 026/153] Fix: check if there are any joinMessages before accessing the first one --- src/pages/Consultation/Consultation.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index 583e4407..7c8a9d5b 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -123,6 +123,7 @@ export const Consultation = () => { (x) => x.content === "provider_joined" || x.content === "provider_left" ) .sort((a, b) => new Date(Number(b.time)) - new Date(Number(a.time))); + if (joinMessages.length === 0) return false; return joinMessages[0].content === "provider_joined"; }; From fe017ab81f369ab5baf6ce1a6fb965a696e601dd Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 31 Aug 2023 11:57:33 +0300 Subject: [PATCH 027/153] Fix: wrap the check for track in a try-catch block --- src/blocks/VideoRoom/VideoTrack.jsx | 12 ++++++--- .../VideoRoom/utils/useTrackSubscription.js | 26 ++++++++++++++++--- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/blocks/VideoRoom/VideoTrack.jsx b/src/blocks/VideoRoom/VideoTrack.jsx index 407dba97..bfd69cc2 100644 --- a/src/blocks/VideoRoom/VideoTrack.jsx +++ b/src/blocks/VideoRoom/VideoTrack.jsx @@ -18,10 +18,14 @@ export default function VideoTrack({ type, track }) { console.error(err); } return () => { - if (track.track) { - track.track.detach(el); - } else { - track.detach(el); + try { + if (track.track) { + track.track.detach(el); + } else { + track.detach(el); + } + } catch (err) { + console.log(err, "err in detaching"); } }; } diff --git a/src/blocks/VideoRoom/utils/useTrackSubscription.js b/src/blocks/VideoRoom/utils/useTrackSubscription.js index eedde9e6..e35f722f 100644 --- a/src/blocks/VideoRoom/utils/useTrackSubscription.js +++ b/src/blocks/VideoRoom/utils/useTrackSubscription.js @@ -13,7 +13,9 @@ export default function useTrackSubscription({ participant }) { * participant track subs */ const trackSubscribed = (track) => { - if (track.kind === "video") { + if (!track) { + setVideoTrack(null); + } else if (track.kind === "video") { setVideoTrack(track); } else if (track.kind === "audio") { setAudioTrack(track); @@ -26,11 +28,21 @@ export default function useTrackSubscription({ participant }) { } }); + const trackPublished = (track) => { + if (!track) { + setVideoTrack(null); + return; + } else if (track.kind === "video") { + setVideoTrack(track); + } else if (track.kind === "audio") { + setAudioTrack(track); + } + }; participant.on("trackPublished", (track) => { if (track.track) { - trackSubscribed(track.track); + trackPublished(track.track); } else { - trackSubscribed(track); + trackPublished(track); } }); participant.on("trackSubscribed", trackSubscribed); @@ -39,13 +51,19 @@ export default function useTrackSubscription({ participant }) { * participant track unsubs */ const trackUnsubscribed = (track) => { - if (track.kind === "video") { + if (!track) { + setVideoTrack(null); + return; + } else if (track.kind === "video") { setVideoTrack(null); } else if (track.kind === "audio") { setAudioTrack(null); } }; participant.on("trackUnsubscribed", trackUnsubscribed); + participant.on("trackUnpublished", () => { + trackUnsubscribed(); + }); return () => { participant.off("trackSubscribed", trackSubscribed); From d48f9a5e19f0d9455c025e63457a9ef036f95d70 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 31 Aug 2023 15:57:10 +0300 Subject: [PATCH 028/153] Add: linter scripts and fix errors --- .eslintrc.json | 8 ++++- package.json | 4 ++- .../CancelConsultation/CancelConsultation.jsx | 9 +----- src/backdrops/CancelConsultation/index.js | 2 +- src/backdrops/CancelConsultation/locales.js | 2 +- src/backdrops/ChangePassword/index.js | 2 +- src/backdrops/ChangePassword/locales.js | 2 +- src/backdrops/CodeVerification/index.js | 2 +- src/backdrops/CodeVerification/locales.js | 2 +- src/backdrops/ConfirmConsultation/index.js | 2 +- src/backdrops/ConfirmConsultation/locales.js | 2 +- src/backdrops/DeleteAccount/DeleteAccount.jsx | 10 ------- src/backdrops/DeleteAccount/index.js | 2 +- src/backdrops/DeleteAccount/locales.js | 2 +- src/backdrops/DeleteProfilePicture/index.js | 2 +- src/backdrops/DeleteProfilePicture/locales.js | 2 +- .../EditConsultation/EditConsultation.jsx | 4 +-- src/backdrops/EditConsultation/index.js | 2 +- src/backdrops/EditConsultation/locales.js | 2 +- src/backdrops/FilterProviders/index.js | 2 +- src/backdrops/FilterProviders/locales.js | 2 +- src/backdrops/FilterQuestions/index.js | 2 +- src/backdrops/FilterQuestions/locales.js | 2 +- src/backdrops/SafetyFeedback/index.js | 2 +- src/backdrops/SafetyFeedback/locales.js | 2 +- .../ScheduleConsultationGroup.jsx | 4 +-- .../ScheduleConsultationGroup/index.js | 2 +- src/backdrops/SelectAvatar/SelectAvatar.jsx | 29 ++++++------------- src/backdrops/SelectAvatar/index.js | 2 +- src/backdrops/SelectAvatar/locales.js | 2 +- src/backdrops/SelectConsultation/index.js | 2 +- src/backdrops/SelectConsultation/locales.js | 2 +- src/blocks/ActivityHistory/index.js | 2 +- src/blocks/ActivityHistory/locales.js | 2 +- src/blocks/ActivityLogDashboard/index.js | 2 +- src/blocks/ActivityLogDashboard/locales.js | 2 +- src/blocks/ArticleView/index.js | 2 +- src/blocks/Articles/Articles.jsx | 16 +++++----- src/blocks/Articles/index.js | 2 +- .../ArticlesDashboard/ArticlesDashboard.jsx | 7 +++-- src/blocks/ArticlesDashboard/index.js | 2 +- src/blocks/CheckoutForm/CheckoutForm.jsx | 9 ++---- src/blocks/CheckoutForm/index.js | 2 +- src/blocks/CheckoutForm/locales.js | 2 +- src/blocks/Consultations/Consultations.jsx | 2 +- src/blocks/Consultations/index.js | 2 +- src/blocks/Consultations/locales.js | 2 +- src/blocks/ConsultationsDashboard/index.js | 2 +- src/blocks/ConsultationsDashboard/locales.js | 2 +- src/blocks/ContactUs/index.js | 2 +- src/blocks/ContactUs/locales.js | 2 +- src/blocks/CookiePolicy/index.js | 2 +- src/blocks/CookiePolicy/locales.js | 2 +- src/blocks/FAQ/index.js | 2 +- src/blocks/FAQ/locales.js | 2 +- src/blocks/ForgotPassword/ForgotPassword.jsx | 1 - src/blocks/ForgotPassword/index.js | 2 +- src/blocks/ForgotPassword/locales.js | 2 +- src/blocks/GiveSuggestion/index.js | 2 +- src/blocks/GiveSuggestion/locales.js | 2 +- src/blocks/Login/index.js | 2 +- src/blocks/Login/locales.js | 2 +- .../MascotHeaderMyQA/MascotHeaderMyQA.jsx | 2 +- src/blocks/MascotWelcomeHeader/index.js | 2 +- src/blocks/MascotWelcomeHeader/locales.js | 2 +- .../MoodTrackHistory/MoodTrackHistory.jsx | 7 +---- src/blocks/MoodTrackHistory/index.js | 2 +- src/blocks/MoodTrackHistory/locales.js | 2 +- src/blocks/MoodTracker/MoodTracker.jsx | 1 - src/blocks/MoodTracker/index.js | 2 +- src/blocks/MoodTracker/locales.js | 2 +- .../MoodTrackerHistory/MoodTrackerHistory.jsx | 2 +- src/blocks/MoodTrackerHistory/index.js | 2 +- src/blocks/MoodTrackerHistory/locales.js | 2 +- src/blocks/NotificationPreferences/index.js | 2 +- src/blocks/NotificationPreferences/locales.js | 2 +- src/blocks/Notifications/index.js | 2 +- src/blocks/Notifications/locales.js | 2 +- src/blocks/Page/Page.jsx | 4 +-- src/blocks/Page/index.js | 2 +- src/blocks/Page/locales.js | 2 +- src/blocks/PaymentHistory/index.js | 2 +- src/blocks/PaymentHistory/locales.js | 2 +- src/blocks/PaymentStatus/PaymentStatus.jsx | 6 ++-- src/blocks/PaymentStatus/locales.js | 2 +- src/blocks/PlatformRating/PlatformRating.jsx | 1 + src/blocks/PlatformRating/index.js | 2 +- src/blocks/PlatformRating/locales.js | 2 +- src/blocks/PrivacyPolicy/index.js | 2 +- src/blocks/ProviderOverview/index.js | 2 +- src/blocks/ProviderOverview/locales.js | 2 +- src/blocks/RegisterAboutYou/index.js | 2 +- src/blocks/RegisterAboutYou/locales.js | 2 +- src/blocks/RegisterAnonymous/index.js | 2 +- src/blocks/RegisterAnonymous/locales.js | 2 +- src/blocks/RegisterEmail/index.js | 2 +- src/blocks/RegisterEmail/locales.js | 2 +- src/blocks/RegisterPreview/locales.js | 2 +- .../RegisterSupport/RegisterSupport.jsx | 6 +--- src/blocks/RegisterSupport/index.js | 2 +- src/blocks/RegisterSupport/locales.js | 2 +- src/blocks/ResetPassword/index.js | 2 +- src/blocks/ResetPassword/locales.js | 2 +- src/blocks/SOSCenter/index.js | 2 +- src/blocks/SOSCenter/locales.js | 2 +- src/blocks/SafetyFeedback/index.js | 2 +- src/blocks/SafetyFeedback/locales.js | 2 +- src/blocks/SelectProvider/index.js | 2 +- src/blocks/SelectProvider/locales.js | 2 +- src/blocks/SharePlatform/index.js | 2 +- src/blocks/SharePlatform/locales.js | 2 +- src/blocks/TermsOfUse/index.js | 2 +- src/blocks/TermsOfUse/locales.js | 2 +- src/blocks/UserDetails/UserDetails.jsx | 4 +-- src/blocks/UserDetails/index.js | 2 +- src/blocks/UserDetails/locales.js | 2 +- src/blocks/UserProfile/index.js | 2 +- src/blocks/UserProfile/locales.js | 2 +- src/blocks/VideoRoom/AudioTrack.jsx | 2 +- src/blocks/VideoRoom/VideoTrack.jsx | 2 +- src/blocks/VideoRoom/index.js | 2 +- src/blocks/VideoRoom/locales.js | 2 +- src/blocks/Welcome/index.js | 2 +- src/blocks/Welcome/locales.js | 2 +- src/hooks/useAcceptConsultation.js | 2 +- src/modals/CreateQuestion/index.js | 2 +- src/modals/MoodTrackMoreInformation/index.js | 2 +- .../MoodTrackMoreInformation/locales.js | 2 +- src/modals/PaymentInformation/index.js | 2 +- src/modals/PaymentInformation/locales.js | 2 +- src/modals/QuestionDetails/index.js | 2 +- .../RequireDataAgreement.jsx | 3 +- src/modals/RequireDataAgreement/index.js | 2 +- src/modals/RequireDataAgreement/locales.js | 2 +- src/modals/RequireRegistration/index.js | 2 +- src/modals/RequireRegistration/locales.js | 2 +- .../SaveAccessCodeConfirmation/index.js | 2 +- .../SaveAccessCodeConfirmation/locales.js | 2 +- src/pages/ActivityHistory/index.js | 2 +- src/pages/ActivityHistory/locales.js | 2 +- .../ArticleInformation/ArticleInformation.jsx | 2 +- src/pages/ArticleInformation/index.js | 2 +- src/pages/ArticleInformation/locales.js | 2 +- src/pages/Articles/index.js | 2 +- src/pages/Articles/locales.js | 2 +- src/pages/Checkout/Checkout.jsx | 4 +-- src/pages/Checkout/index.js | 2 +- src/pages/Checkout/locales.js | 2 +- src/pages/Consultation/Consultation.jsx | 3 -- src/pages/Consultation/index.js | 2 +- src/pages/Consultation/locales.js | 2 +- src/pages/Consultations/Consultations.jsx | 2 +- src/pages/Consultations/index.js | 2 +- src/pages/Consultations/locales.js | 2 +- src/pages/ContactUs/index.js | 2 +- src/pages/ContactUs/locales.js | 2 +- src/pages/CookiePolicy/index.js | 2 +- src/pages/CookiePolicy/locales.js | 2 +- src/pages/Dashboard/Dashboard.jsx | 4 +-- src/pages/Dashboard/index.js | 2 +- src/pages/Dashboard/locales.js | 2 +- src/pages/FAQ/index.js | 2 +- src/pages/FAQ/locales.js | 2 +- src/pages/ForgotPassword/index.js | 2 +- src/pages/ForgotPassword/locales.js | 2 +- .../InformationPortal/InformationPortal.jsx | 3 +- src/pages/InformationPortal/locales.js | 2 +- src/pages/Login/index.js | 2 +- src/pages/Login/locales.js | 2 +- src/pages/MoodTrackHistory/index.js | 2 +- src/pages/MoodTrackHistory/locales.js | 2 +- src/pages/MoodTracker/index.js | 2 +- src/pages/MoodTracker/locales.js | 2 +- src/pages/NotFound/index.js | 2 +- src/pages/NotificationPreferences/index.js | 2 +- src/pages/NotificationPreferences/locales.js | 2 +- src/pages/Notifications/Notifications.jsx | 1 + src/pages/Notifications/index.js | 2 +- src/pages/Notifications/locales.js | 2 +- src/pages/PaymentHistory/index.js | 2 +- src/pages/PaymentHistory/locales.js | 2 +- src/pages/PaymentStatus/locales.js | 2 +- src/pages/PlatformRating/index.js | 2 +- src/pages/PlatformRating/locales.js | 2 +- src/pages/PrivacyPolicy/index.js | 2 +- src/pages/PrivacyPolicy/locales.js | 2 +- .../ProviderOverview/ProviderOverview.jsx | 4 +-- src/pages/ProviderOverview/index.js | 2 +- src/pages/ProviderOverview/locales.js | 2 +- src/pages/RegisterAboutYou/index.js | 2 +- src/pages/RegisterAboutYou/locales.js | 2 +- src/pages/RegisterAnonymous/index.js | 2 +- src/pages/RegisterAnonymous/locales.js | 2 +- src/pages/RegisterEmail/index.js | 2 +- src/pages/RegisterEmail/locales.js | 2 +- src/pages/RegisterPreview/RegisterPreview.jsx | 4 +-- src/pages/RegisterPreview/locales.js | 2 +- src/pages/RegisterSupport/index.js | 2 +- src/pages/RegisterSupport/locales.js | 2 +- src/pages/ResetPassword/index.js | 2 +- src/pages/ResetPassword/locales.js | 2 +- src/pages/SOSCenter/index.js | 2 +- src/pages/SelectProvider/SelectProvider.jsx | 1 - src/pages/SelectProvider/index.js | 2 +- src/pages/SelectProvider/locales.js | 2 +- src/pages/SharePlatform/index.js | 2 +- src/pages/SharePlatform/locales.js | 2 +- src/pages/TermsOfUse/index.js | 2 +- src/pages/TermsOfUse/locales.js | 2 +- src/pages/UserDetails/index.js | 2 +- src/pages/UserDetails/locales.js | 2 +- src/pages/UserProfile/index.js | 2 +- src/pages/UserProfile/locales.js | 2 +- src/pages/Welcome/index.js | 2 +- src/pages/Welcome/locales.js | 2 +- src/routes/Root/Root.jsx | 1 - 216 files changed, 244 insertions(+), 290 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 31881df8..16f9484f 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -9,5 +9,11 @@ "sourceType": "module" }, "plugins": ["react"], - "rules": {} + "rules": { + "quotes": ["error", "double"], + "react/prop-types": "off", + "react/jsx-key": "off", + "no-case-declarations": "off", + "no-prototype-builtins": "off" + } } diff --git a/package.json b/package.json index 598bf9ed..9439906e 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,9 @@ "dev": "vite --host --port 5173", "staging": "vite build --mode staging", "build": "vite build", - "preview": "vite preview" + "preview": "vite preview", + "lint": "eslint --ext .js,.jsx src", + "lint-fix": "eslint --ext .js,.jsx src --fix" }, "dependencies": { "@react-pdf/renderer": "^3.1.11", diff --git a/src/backdrops/CancelConsultation/CancelConsultation.jsx b/src/backdrops/CancelConsultation/CancelConsultation.jsx index c1365361..368f4617 100644 --- a/src/backdrops/CancelConsultation/CancelConsultation.jsx +++ b/src/backdrops/CancelConsultation/CancelConsultation.jsx @@ -10,8 +10,6 @@ import { useCancelConsultation } from "#hooks"; import { ONE_HOUR } from "@USupport-components-library/utils"; -const AMAZON_S3_BUCKET = `${import.meta.env.VITE_AMAZON_S3_BUCKET}`; - import "./cancel-consultation.scss"; /** @@ -21,12 +19,7 @@ import "./cancel-consultation.scss"; * * @return {jsx} */ -export const CancelConsultation = ({ - isOpen, - onClose, - consultation, - provider, -}) => { +export const CancelConsultation = ({ isOpen, onClose, consultation }) => { const queryClient = useQueryClient(); const currencySymbol = localStorage.getItem("currency_symbol"); diff --git a/src/backdrops/CancelConsultation/index.js b/src/backdrops/CancelConsultation/index.js index 32e548e8..96f8c2c8 100644 --- a/src/backdrops/CancelConsultation/index.js +++ b/src/backdrops/CancelConsultation/index.js @@ -1 +1 @@ -export * from './CancelConsultation.jsx'; +export * from "./CancelConsultation.jsx"; diff --git a/src/backdrops/CancelConsultation/locales.js b/src/backdrops/CancelConsultation/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/CancelConsultation/locales.js +++ b/src/backdrops/CancelConsultation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/ChangePassword/index.js b/src/backdrops/ChangePassword/index.js index c6f14fc3..5009d340 100644 --- a/src/backdrops/ChangePassword/index.js +++ b/src/backdrops/ChangePassword/index.js @@ -1 +1 @@ -export * from './ChangePassword.jsx'; +export * from "./ChangePassword.jsx"; diff --git a/src/backdrops/ChangePassword/locales.js b/src/backdrops/ChangePassword/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/ChangePassword/locales.js +++ b/src/backdrops/ChangePassword/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/CodeVerification/index.js b/src/backdrops/CodeVerification/index.js index cfc19561..2d172b0c 100644 --- a/src/backdrops/CodeVerification/index.js +++ b/src/backdrops/CodeVerification/index.js @@ -1 +1 @@ -export * from './CodeVerification.jsx'; +export * from "./CodeVerification.jsx"; diff --git a/src/backdrops/CodeVerification/locales.js b/src/backdrops/CodeVerification/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/CodeVerification/locales.js +++ b/src/backdrops/CodeVerification/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/ConfirmConsultation/index.js b/src/backdrops/ConfirmConsultation/index.js index 2ddcd5f1..38ac1d8d 100644 --- a/src/backdrops/ConfirmConsultation/index.js +++ b/src/backdrops/ConfirmConsultation/index.js @@ -1 +1 @@ -export * from './ConfirmConsultation.jsx'; +export * from "./ConfirmConsultation.jsx"; diff --git a/src/backdrops/ConfirmConsultation/locales.js b/src/backdrops/ConfirmConsultation/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/ConfirmConsultation/locales.js +++ b/src/backdrops/ConfirmConsultation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/DeleteAccount/DeleteAccount.jsx b/src/backdrops/DeleteAccount/DeleteAccount.jsx index b6430a5b..a27dd27e 100644 --- a/src/backdrops/DeleteAccount/DeleteAccount.jsx +++ b/src/backdrops/DeleteAccount/DeleteAccount.jsx @@ -3,10 +3,8 @@ import { useNavigate } from "react-router-dom"; import { useTranslation } from "react-i18next"; import { useMutation } from "@tanstack/react-query"; import { Backdrop, InputPassword } from "@USupport-components-library/src"; -import { validateProperty } from "@USupport-components-library/utils"; import { useError } from "#hooks"; import { clientSvc, userSvc } from "@USupport-components-library/services"; -import Joi from "joi"; import "./delete-account.scss"; @@ -22,10 +20,6 @@ export const DeleteAccount = ({ isOpen, onClose }) => { const { t } = useTranslation("delete-account"); - const schema = Joi.object({ - password: Joi.string(), - }); - const [data, setData] = useState({ password: "" }); const [errors, setErrors] = useState({}); @@ -53,10 +47,6 @@ export const DeleteAccount = ({ isOpen, onClose }) => { }); }; - const handleBlur = () => { - validateProperty("password", data.password, schema, setErrors); - }; - const handleSubmit = () => { deleteAccountMutation.mutate(); }; diff --git a/src/backdrops/DeleteAccount/index.js b/src/backdrops/DeleteAccount/index.js index 64e8d77e..c20da812 100644 --- a/src/backdrops/DeleteAccount/index.js +++ b/src/backdrops/DeleteAccount/index.js @@ -1 +1 @@ -export * from './DeleteAccount.jsx'; +export * from "./DeleteAccount.jsx"; diff --git a/src/backdrops/DeleteAccount/locales.js b/src/backdrops/DeleteAccount/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/DeleteAccount/locales.js +++ b/src/backdrops/DeleteAccount/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/DeleteProfilePicture/index.js b/src/backdrops/DeleteProfilePicture/index.js index e5cc8be3..9969c0e6 100644 --- a/src/backdrops/DeleteProfilePicture/index.js +++ b/src/backdrops/DeleteProfilePicture/index.js @@ -1 +1 @@ -export * from './DeleteProfilePicture.jsx'; +export * from "./DeleteProfilePicture.jsx"; diff --git a/src/backdrops/DeleteProfilePicture/locales.js b/src/backdrops/DeleteProfilePicture/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/DeleteProfilePicture/locales.js +++ b/src/backdrops/DeleteProfilePicture/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/EditConsultation/EditConsultation.jsx b/src/backdrops/EditConsultation/EditConsultation.jsx index a6b0d8e9..ec56b03e 100644 --- a/src/backdrops/EditConsultation/EditConsultation.jsx +++ b/src/backdrops/EditConsultation/EditConsultation.jsx @@ -21,13 +21,11 @@ export const EditConsultation = ({ isOpen, onClose, consultation, - provider, openCancelConsultation, openSelectConsultation, }) => { // const consultation = { startDate: new Date(), endDate: new Date() }; - const { providerName, providerId, consultationId, timestamp, image } = - consultation; + const { providerName, timestamp, image } = consultation; const imageUrl = image || "default"; const startDate = new Date(timestamp); diff --git a/src/backdrops/EditConsultation/index.js b/src/backdrops/EditConsultation/index.js index 855c9003..fba4bf8b 100644 --- a/src/backdrops/EditConsultation/index.js +++ b/src/backdrops/EditConsultation/index.js @@ -1 +1 @@ -export * from './EditConsultation.jsx'; +export * from "./EditConsultation.jsx"; diff --git a/src/backdrops/EditConsultation/locales.js b/src/backdrops/EditConsultation/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/EditConsultation/locales.js +++ b/src/backdrops/EditConsultation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/FilterProviders/index.js b/src/backdrops/FilterProviders/index.js index 8e7e4417..6f91a017 100644 --- a/src/backdrops/FilterProviders/index.js +++ b/src/backdrops/FilterProviders/index.js @@ -1 +1 @@ -export * from './FilterProviders.jsx'; +export * from "./FilterProviders.jsx"; diff --git a/src/backdrops/FilterProviders/locales.js b/src/backdrops/FilterProviders/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/FilterProviders/locales.js +++ b/src/backdrops/FilterProviders/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/FilterQuestions/index.js b/src/backdrops/FilterQuestions/index.js index 0f15b294..fff50199 100644 --- a/src/backdrops/FilterQuestions/index.js +++ b/src/backdrops/FilterQuestions/index.js @@ -1 +1 @@ -export * from './FilterQuestions.jsx'; +export * from "./FilterQuestions.jsx"; diff --git a/src/backdrops/FilterQuestions/locales.js b/src/backdrops/FilterQuestions/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/FilterQuestions/locales.js +++ b/src/backdrops/FilterQuestions/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/SafetyFeedback/index.js b/src/backdrops/SafetyFeedback/index.js index fa625d5a..404384de 100644 --- a/src/backdrops/SafetyFeedback/index.js +++ b/src/backdrops/SafetyFeedback/index.js @@ -1 +1 @@ -export * from './SafetyFeedback.jsx'; +export * from "./SafetyFeedback.jsx"; diff --git a/src/backdrops/SafetyFeedback/locales.js b/src/backdrops/SafetyFeedback/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/SafetyFeedback/locales.js +++ b/src/backdrops/SafetyFeedback/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/ScheduleConsultationGroup/ScheduleConsultationGroup.jsx b/src/backdrops/ScheduleConsultationGroup/ScheduleConsultationGroup.jsx index 140c8e0e..16e4c43e 100644 --- a/src/backdrops/ScheduleConsultationGroup/ScheduleConsultationGroup.jsx +++ b/src/backdrops/ScheduleConsultationGroup/ScheduleConsultationGroup.jsx @@ -38,7 +38,7 @@ export const ScheduleConsultationGroup = ({ const onBlockSlotSuccess = (consultationId) => { if (consultationPrice.current && consultationPrice.current > 0) { - navigate(`/checkout`, { state: { consultationId: consultationId } }); + navigate("/checkout", { state: { consultationId: consultationId } }); } else { scheduleConsultationMutation.mutate(consultationId); } @@ -49,7 +49,7 @@ export const ScheduleConsultationGroup = ({ }; const blockSlotMutation = useBlockSlot(onBlockSlotSuccess, onBlockSlotError); - const onScheduleConsultationSuccess = (data) => { + const onScheduleConsultationSuccess = () => { setIsBlockSlotSubmitting(false); window.dispatchEvent(new Event("new-notification")); closeSelectConsultation(); diff --git a/src/backdrops/ScheduleConsultationGroup/index.js b/src/backdrops/ScheduleConsultationGroup/index.js index c5f6c938..f0a651f8 100644 --- a/src/backdrops/ScheduleConsultationGroup/index.js +++ b/src/backdrops/ScheduleConsultationGroup/index.js @@ -1 +1 @@ -export * from './ScheduleConsultationGroup.jsx'; +export * from "./ScheduleConsultationGroup.jsx"; diff --git a/src/backdrops/SelectAvatar/SelectAvatar.jsx b/src/backdrops/SelectAvatar/SelectAvatar.jsx index 0c0f6e94..46fc538b 100644 --- a/src/backdrops/SelectAvatar/SelectAvatar.jsx +++ b/src/backdrops/SelectAvatar/SelectAvatar.jsx @@ -1,15 +1,8 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; -import { - Backdrop, - Loading, - Grid, - GridItem, -} from "@USupport-components-library/src"; -import { userSvc, clientSvc } from "@USupport-components-library/services"; - -import { useError } from "#hooks"; +import { Backdrop, Grid, GridItem } from "@USupport-components-library/src"; +import { clientSvc } from "@USupport-components-library/services"; const AMAZON_S3_BUCKET = `${import.meta.env.VITE_AMAZON_S3_BUCKET}`; @@ -30,8 +23,7 @@ export const SelectAvatar = ({ isOpen, onClose }) => { const image = clientData?.image; const [selectedAvatar, setSelectedAvatar] = useState(); - const [isLoading, setIsLoading] = useState(false); - const [error, setError] = useState(); + // const [error, setError] = useState(); const changeAvatar = async () => { const res = await clientSvc.changeImage(selectedAvatar); @@ -39,17 +31,14 @@ export const SelectAvatar = ({ isOpen, onClose }) => { }; const changeAvatarMutation = useMutation(changeAvatar, { - onSuccess: (res) => { - console.log(res, "res"); - setIsLoading(false); + onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["client-data"] }); onClose(); }, - onError: (error) => { - setIsLoading(false); - const { message: errorMessage } = useError(error); - setError(errorMessage); - }, + // onError: (error) => { + // const { message: errorMessage } = useError(error); + // setError(errorMessage); + // }, }); const avatars = [ diff --git a/src/backdrops/SelectAvatar/index.js b/src/backdrops/SelectAvatar/index.js index afd4600d..76cf65a5 100644 --- a/src/backdrops/SelectAvatar/index.js +++ b/src/backdrops/SelectAvatar/index.js @@ -1 +1 @@ -export * from './SelectAvatar.jsx'; +export * from "./SelectAvatar.jsx"; diff --git a/src/backdrops/SelectAvatar/locales.js b/src/backdrops/SelectAvatar/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/SelectAvatar/locales.js +++ b/src/backdrops/SelectAvatar/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/backdrops/SelectConsultation/index.js b/src/backdrops/SelectConsultation/index.js index bd14ea55..02d32cae 100644 --- a/src/backdrops/SelectConsultation/index.js +++ b/src/backdrops/SelectConsultation/index.js @@ -1 +1 @@ -export * from './SelectConsultation.jsx'; +export * from "./SelectConsultation.jsx"; diff --git a/src/backdrops/SelectConsultation/locales.js b/src/backdrops/SelectConsultation/locales.js index b55d5173..7889df5e 100644 --- a/src/backdrops/SelectConsultation/locales.js +++ b/src/backdrops/SelectConsultation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ActivityHistory/index.js b/src/blocks/ActivityHistory/index.js index 3323a657..f2616cf4 100644 --- a/src/blocks/ActivityHistory/index.js +++ b/src/blocks/ActivityHistory/index.js @@ -1 +1 @@ -export * from './ActivityHistory.jsx'; +export * from "./ActivityHistory.jsx"; diff --git a/src/blocks/ActivityHistory/locales.js b/src/blocks/ActivityHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ActivityHistory/locales.js +++ b/src/blocks/ActivityHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ActivityLogDashboard/index.js b/src/blocks/ActivityLogDashboard/index.js index d58918f6..578c3ed9 100644 --- a/src/blocks/ActivityLogDashboard/index.js +++ b/src/blocks/ActivityLogDashboard/index.js @@ -1 +1 @@ -export * from './ActivityLogDashboard.jsx'; +export * from "./ActivityLogDashboard.jsx"; diff --git a/src/blocks/ActivityLogDashboard/locales.js b/src/blocks/ActivityLogDashboard/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ActivityLogDashboard/locales.js +++ b/src/blocks/ActivityLogDashboard/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ArticleView/index.js b/src/blocks/ArticleView/index.js index f082a2e1..227acee9 100644 --- a/src/blocks/ArticleView/index.js +++ b/src/blocks/ArticleView/index.js @@ -1 +1 @@ -export * from './ArticleView.jsx'; +export * from "./ArticleView.jsx"; diff --git a/src/blocks/Articles/Articles.jsx b/src/blocks/Articles/Articles.jsx index 3405b8c9..9e5b5ba4 100644 --- a/src/blocks/Articles/Articles.jsx +++ b/src/blocks/Articles/Articles.jsx @@ -57,7 +57,9 @@ export const Articles = ({ })); setSelectedAgeGroup(ageGroupsData[0]); return ageGroupsData; - } catch {} + } catch (err) { + console.log(err); + } }; const ageGroupsQuery = useQuery(["ageGroups", usersLanguage], getAgeGroups, { @@ -93,7 +95,7 @@ export const Articles = ({ let categoriesData = [ { label: t("all"), value: "all", isSelected: true }, ]; - res.data.map((category, index) => + res.data.map((category) => categoriesData.push({ label: category.attributes.name, value: category.attributes.name, @@ -104,7 +106,9 @@ export const Articles = ({ setSelectedCategory(categoriesData[0]); return categoriesData; - } catch {} + } catch (err) { + console.log9err; + } }; const categoriesQuery = useQuery( @@ -244,12 +248,6 @@ export const Articles = ({ ageGroupId = selectedAgeGroup.id; } - let categoryId = ""; - if (categories) { - let selectedCategory = categories.find((o) => o.isSelected === true); - categoryId = selectedCategory.id; - } - const { data } = await cmsSvc.getArticles({ startFrom: articles?.length, limit: 6, diff --git a/src/blocks/Articles/index.js b/src/blocks/Articles/index.js index 2f4fbfa9..e0583057 100644 --- a/src/blocks/Articles/index.js +++ b/src/blocks/Articles/index.js @@ -1 +1 @@ -export * from './Articles.jsx'; +export * from "./Articles.jsx"; diff --git a/src/blocks/ArticlesDashboard/ArticlesDashboard.jsx b/src/blocks/ArticlesDashboard/ArticlesDashboard.jsx index fba8d420..51e48f22 100644 --- a/src/blocks/ArticlesDashboard/ArticlesDashboard.jsx +++ b/src/blocks/ArticlesDashboard/ArticlesDashboard.jsx @@ -8,7 +8,6 @@ import { GridItem, Block, CardMedia, - Button, Loading, Tabs, } from "@USupport-components-library/src"; @@ -61,7 +60,7 @@ export const ArticlesDashboard = () => { let categoriesData = [ { label: t("all"), value: "all", isSelected: true }, ]; - res.data.map((category, index) => + res.data.map((category) => categoriesData.push({ label: category.attributes.name, value: category.attributes.name, @@ -72,7 +71,9 @@ export const ArticlesDashboard = () => { setSelectedCategory(categoriesData[0]); return categoriesData; - } catch {} + } catch (err) { + console.log(err); + } }; const categoriesQuery = useQuery( diff --git a/src/blocks/ArticlesDashboard/index.js b/src/blocks/ArticlesDashboard/index.js index c8dcc7ff..a28ebe40 100644 --- a/src/blocks/ArticlesDashboard/index.js +++ b/src/blocks/ArticlesDashboard/index.js @@ -1 +1 @@ -export * from './ArticlesDashboard.jsx'; +export * from "./ArticlesDashboard.jsx"; diff --git a/src/blocks/CheckoutForm/CheckoutForm.jsx b/src/blocks/CheckoutForm/CheckoutForm.jsx index 9741734b..6cf3c617 100644 --- a/src/blocks/CheckoutForm/CheckoutForm.jsx +++ b/src/blocks/CheckoutForm/CheckoutForm.jsx @@ -1,5 +1,5 @@ import React, { useEffect, useState } from "react"; -import { useNavigate, Navigate } from "react-router-dom"; +import { useNavigate } from "react-router-dom"; import { PaymentElement, LinkAuthenticationElement, @@ -24,10 +24,8 @@ import "./checkout-form.scss"; function msToHMS(duration) { let seconds = parseInt((duration / 1000) % 60), - minutes = parseInt((duration / (1000 * 60)) % 60), - hours = parseInt((duration / (1000 * 60 * 60)) % 24); + minutes = parseInt((duration / (1000 * 60)) % 60); - hours = hours < 10 ? "0" + hours : hours; minutes = minutes < 10 ? "0" + minutes : minutes; seconds = seconds < 10 ? "0" + seconds : seconds; @@ -65,7 +63,6 @@ export const CheckoutForm = ({ const difference = timeOfTimeout - now; const differenceInMins = msToHMS(difference); - const [email, setEmail] = useState(""); const [message, setMessage] = useState(null); const [isLoading, setIsLoading] = useState(false); const [hasTimeouted, setHasTimeouted] = useState(now > timeOfTimeout); @@ -134,7 +131,7 @@ export const CheckoutForm = ({

setEmail(e.value.email)} + // onChange={(e) => setEmail(e.value.email)} /> diff --git a/src/blocks/CheckoutForm/index.js b/src/blocks/CheckoutForm/index.js index 988f9454..0e7807c9 100644 --- a/src/blocks/CheckoutForm/index.js +++ b/src/blocks/CheckoutForm/index.js @@ -1 +1 @@ -export * from './CheckoutForm.jsx'; +export * from "./CheckoutForm.jsx"; diff --git a/src/blocks/CheckoutForm/locales.js b/src/blocks/CheckoutForm/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/CheckoutForm/locales.js +++ b/src/blocks/CheckoutForm/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/Consultations/Consultations.jsx b/src/blocks/Consultations/Consultations.jsx index 86b66b95..bb6f4254 100644 --- a/src/blocks/Consultations/Consultations.jsx +++ b/src/blocks/Consultations/Consultations.jsx @@ -1,4 +1,4 @@ -import React, { useState, useCallback, useMemo } from "react"; +import React, { useState, useCallback } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; import { toast } from "react-toastify"; diff --git a/src/blocks/Consultations/index.js b/src/blocks/Consultations/index.js index 9c3a52fc..cdfcb3d5 100644 --- a/src/blocks/Consultations/index.js +++ b/src/blocks/Consultations/index.js @@ -1 +1 @@ -export * from './Consultations.jsx'; +export * from "./Consultations.jsx"; diff --git a/src/blocks/Consultations/locales.js b/src/blocks/Consultations/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/Consultations/locales.js +++ b/src/blocks/Consultations/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ConsultationsDashboard/index.js b/src/blocks/ConsultationsDashboard/index.js index 248135eb..d79740b7 100644 --- a/src/blocks/ConsultationsDashboard/index.js +++ b/src/blocks/ConsultationsDashboard/index.js @@ -1 +1 @@ -export * from './ConsultationsDashboard.jsx'; +export * from "./ConsultationsDashboard.jsx"; diff --git a/src/blocks/ConsultationsDashboard/locales.js b/src/blocks/ConsultationsDashboard/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ConsultationsDashboard/locales.js +++ b/src/blocks/ConsultationsDashboard/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ContactUs/index.js b/src/blocks/ContactUs/index.js index a4d673f6..70994042 100644 --- a/src/blocks/ContactUs/index.js +++ b/src/blocks/ContactUs/index.js @@ -1 +1 @@ -export * from './ContactUs.jsx'; +export * from "./ContactUs.jsx"; diff --git a/src/blocks/ContactUs/locales.js b/src/blocks/ContactUs/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ContactUs/locales.js +++ b/src/blocks/ContactUs/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/CookiePolicy/index.js b/src/blocks/CookiePolicy/index.js index 6ccb5be0..299e28ea 100644 --- a/src/blocks/CookiePolicy/index.js +++ b/src/blocks/CookiePolicy/index.js @@ -1 +1 @@ -export * from './CookiePolicy.jsx'; +export * from "./CookiePolicy.jsx"; diff --git a/src/blocks/CookiePolicy/locales.js b/src/blocks/CookiePolicy/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/CookiePolicy/locales.js +++ b/src/blocks/CookiePolicy/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/FAQ/index.js b/src/blocks/FAQ/index.js index ce5a20ca..7db8be1b 100644 --- a/src/blocks/FAQ/index.js +++ b/src/blocks/FAQ/index.js @@ -1 +1 @@ -export * from './FAQ.jsx'; +export * from "./FAQ.jsx"; diff --git a/src/blocks/FAQ/locales.js b/src/blocks/FAQ/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/FAQ/locales.js +++ b/src/blocks/FAQ/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ForgotPassword/ForgotPassword.jsx b/src/blocks/ForgotPassword/ForgotPassword.jsx index 79db5a0f..a233c4c8 100644 --- a/src/blocks/ForgotPassword/ForgotPassword.jsx +++ b/src/blocks/ForgotPassword/ForgotPassword.jsx @@ -11,7 +11,6 @@ import { } from "@USupport-components-library/src"; import { validate } from "@USupport-components-library/utils"; import { userSvc } from "@USupport-components-library/services"; -import { useError } from "#hooks"; import Joi from "joi"; import "./forgot-password.scss"; diff --git a/src/blocks/ForgotPassword/index.js b/src/blocks/ForgotPassword/index.js index bdcbc088..f3686b75 100644 --- a/src/blocks/ForgotPassword/index.js +++ b/src/blocks/ForgotPassword/index.js @@ -1 +1 @@ -export * from './ForgotPassword.jsx'; +export * from "./ForgotPassword.jsx"; diff --git a/src/blocks/ForgotPassword/locales.js b/src/blocks/ForgotPassword/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ForgotPassword/locales.js +++ b/src/blocks/ForgotPassword/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/GiveSuggestion/index.js b/src/blocks/GiveSuggestion/index.js index 027b643b..e2e62e33 100644 --- a/src/blocks/GiveSuggestion/index.js +++ b/src/blocks/GiveSuggestion/index.js @@ -1 +1 @@ -export * from './GiveSuggestion.jsx'; +export * from "./GiveSuggestion.jsx"; diff --git a/src/blocks/GiveSuggestion/locales.js b/src/blocks/GiveSuggestion/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/GiveSuggestion/locales.js +++ b/src/blocks/GiveSuggestion/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/Login/index.js b/src/blocks/Login/index.js index a03e429f..09afc090 100644 --- a/src/blocks/Login/index.js +++ b/src/blocks/Login/index.js @@ -1 +1 @@ -export * from './Login.jsx'; +export * from "./Login.jsx"; diff --git a/src/blocks/Login/locales.js b/src/blocks/Login/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/Login/locales.js +++ b/src/blocks/Login/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/MascotHeaderMyQA/MascotHeaderMyQA.jsx b/src/blocks/MascotHeaderMyQA/MascotHeaderMyQA.jsx index d7f6dd01..1115de43 100644 --- a/src/blocks/MascotHeaderMyQA/MascotHeaderMyQA.jsx +++ b/src/blocks/MascotHeaderMyQA/MascotHeaderMyQA.jsx @@ -1,4 +1,4 @@ -import React, { useContext } from "react"; +import React from "react"; import { useTranslation } from "react-i18next"; import classNames from "classnames"; diff --git a/src/blocks/MascotWelcomeHeader/index.js b/src/blocks/MascotWelcomeHeader/index.js index dc51567e..d8980cc0 100644 --- a/src/blocks/MascotWelcomeHeader/index.js +++ b/src/blocks/MascotWelcomeHeader/index.js @@ -1 +1 @@ -export * from './MascotWelcomeHeader.jsx'; +export * from "./MascotWelcomeHeader.jsx"; diff --git a/src/blocks/MascotWelcomeHeader/locales.js b/src/blocks/MascotWelcomeHeader/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/MascotWelcomeHeader/locales.js +++ b/src/blocks/MascotWelcomeHeader/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/MoodTrackHistory/MoodTrackHistory.jsx b/src/blocks/MoodTrackHistory/MoodTrackHistory.jsx index 1e95f961..5980b175 100644 --- a/src/blocks/MoodTrackHistory/MoodTrackHistory.jsx +++ b/src/blocks/MoodTrackHistory/MoodTrackHistory.jsx @@ -63,12 +63,7 @@ export const MoodTrackHistory = () => { return !loadedPages.includes(pageNum); }, [loadedPages, pageNum]); - const moodTrackEntriesQuery = useGetMoodTrackEntries( - limitToLoad, - pageNum, - onSuccess, - enabled - ); + useGetMoodTrackEntries(limitToLoad, pageNum, onSuccess, enabled); const emoticons = [ { name: "happy", label: "Happy", value: 4 }, diff --git a/src/blocks/MoodTrackHistory/index.js b/src/blocks/MoodTrackHistory/index.js index db331e05..d78bae83 100644 --- a/src/blocks/MoodTrackHistory/index.js +++ b/src/blocks/MoodTrackHistory/index.js @@ -1 +1 @@ -export * from './MoodTrackHistory.jsx'; +export * from "./MoodTrackHistory.jsx"; diff --git a/src/blocks/MoodTrackHistory/locales.js b/src/blocks/MoodTrackHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/MoodTrackHistory/locales.js +++ b/src/blocks/MoodTrackHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/MoodTracker/MoodTracker.jsx b/src/blocks/MoodTracker/MoodTracker.jsx index 5739a30d..362ea0db 100644 --- a/src/blocks/MoodTracker/MoodTracker.jsx +++ b/src/blocks/MoodTracker/MoodTracker.jsx @@ -7,7 +7,6 @@ import { Block, Button, Emoticon, - Loading, Textarea, } from "@USupport-components-library/src"; import { useAddMoodTrack } from "#hooks"; diff --git a/src/blocks/MoodTracker/index.js b/src/blocks/MoodTracker/index.js index 11eac5f1..fdd8dcb4 100644 --- a/src/blocks/MoodTracker/index.js +++ b/src/blocks/MoodTracker/index.js @@ -1 +1 @@ -export * from './MoodTracker.jsx'; +export * from "./MoodTracker.jsx"; diff --git a/src/blocks/MoodTracker/locales.js b/src/blocks/MoodTracker/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/MoodTracker/locales.js +++ b/src/blocks/MoodTracker/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/MoodTrackerHistory/MoodTrackerHistory.jsx b/src/blocks/MoodTrackerHistory/MoodTrackerHistory.jsx index fc91c5bc..91016cfd 100644 --- a/src/blocks/MoodTrackerHistory/MoodTrackerHistory.jsx +++ b/src/blocks/MoodTrackerHistory/MoodTrackerHistory.jsx @@ -20,7 +20,7 @@ export const MoodTrackerHistory = () => { const { t } = useTranslation("mood-tracker-history"); //TODO - get the Data from the API - const [emoticons, setEmoticons] = useState([ + const [emoticons] = useState([ { name: "happy", label: t("perfect"), isSelected: false, counter: 6 }, { name: "good", label: t("happy"), isSelected: false, counter: 2 }, { name: "not-good", label: t("sad"), isSelected: true, counter: 10 }, diff --git a/src/blocks/MoodTrackerHistory/index.js b/src/blocks/MoodTrackerHistory/index.js index a2220b46..05a7ea3d 100644 --- a/src/blocks/MoodTrackerHistory/index.js +++ b/src/blocks/MoodTrackerHistory/index.js @@ -1 +1 @@ -export * from './MoodTrackerHistory.jsx'; +export * from "./MoodTrackerHistory.jsx"; diff --git a/src/blocks/MoodTrackerHistory/locales.js b/src/blocks/MoodTrackerHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/MoodTrackerHistory/locales.js +++ b/src/blocks/MoodTrackerHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/NotificationPreferences/index.js b/src/blocks/NotificationPreferences/index.js index 0304f1a8..2f1a415e 100644 --- a/src/blocks/NotificationPreferences/index.js +++ b/src/blocks/NotificationPreferences/index.js @@ -1 +1 @@ -export * from './NotificationPreferences.jsx'; +export * from "./NotificationPreferences.jsx"; diff --git a/src/blocks/NotificationPreferences/locales.js b/src/blocks/NotificationPreferences/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/NotificationPreferences/locales.js +++ b/src/blocks/NotificationPreferences/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/Notifications/index.js b/src/blocks/Notifications/index.js index c658d5a2..4dc775eb 100644 --- a/src/blocks/Notifications/index.js +++ b/src/blocks/Notifications/index.js @@ -1 +1 @@ -export * from './Notifications.jsx'; +export * from "./Notifications.jsx"; diff --git a/src/blocks/Notifications/locales.js b/src/blocks/Notifications/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/Notifications/locales.js +++ b/src/blocks/Notifications/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/Page/Page.jsx b/src/blocks/Page/Page.jsx index a88b15d3..5ed8bff6 100644 --- a/src/blocks/Page/Page.jsx +++ b/src/blocks/Page/Page.jsx @@ -4,7 +4,6 @@ import classNames from "classnames"; import { useQueryClient, useQuery } from "@tanstack/react-query"; import { useNavigate, Link, NavLink } from "react-router-dom"; import { useTranslation } from "react-i18next"; -import jwtDecode from "jwt-decode"; import { Navbar, @@ -78,7 +77,6 @@ export const Page = ({ const isTmpUser = userSvc.getUserID() === "tmp-user"; const token = localStorage.getItem("token"); - const decoded = token ? jwtDecode(token) : null; const unreadNotificationsQuery = useCheckHasUnreadNotifications(!!token); @@ -210,7 +208,7 @@ export const Page = ({ list3: [ { value: "+7 717 232 28 78", iconName: "call-filled", onClick: "phone" }, { - value: `Beibitshilik St 10а, Astana 010000, Kazakhstan`, + value: "Beibitshilik St 10а, Astana 010000, Kazakhstan", iconName: "pin", }, { diff --git a/src/blocks/Page/index.js b/src/blocks/Page/index.js index 2ab6a272..7f2e04aa 100644 --- a/src/blocks/Page/index.js +++ b/src/blocks/Page/index.js @@ -1 +1 @@ -export * from './Page.jsx'; +export * from "./Page.jsx"; diff --git a/src/blocks/Page/locales.js b/src/blocks/Page/locales.js index ed94532f..10c9c3c5 100644 --- a/src/blocks/Page/locales.js +++ b/src/blocks/Page/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json' +export * as en from "./locales/en.json" export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/PaymentHistory/index.js b/src/blocks/PaymentHistory/index.js index 3d9700d6..ec27af14 100644 --- a/src/blocks/PaymentHistory/index.js +++ b/src/blocks/PaymentHistory/index.js @@ -1 +1 @@ -export * from './PaymentHistory.jsx'; +export * from "./PaymentHistory.jsx"; diff --git a/src/blocks/PaymentHistory/locales.js b/src/blocks/PaymentHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/PaymentHistory/locales.js +++ b/src/blocks/PaymentHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/PaymentStatus/PaymentStatus.jsx b/src/blocks/PaymentStatus/PaymentStatus.jsx index 612f328d..9cbdfb91 100644 --- a/src/blocks/PaymentStatus/PaymentStatus.jsx +++ b/src/blocks/PaymentStatus/PaymentStatus.jsx @@ -8,7 +8,7 @@ import { import { useQuery } from "@tanstack/react-query"; import { useStripe } from "@stripe/react-stripe-js"; import { useTranslation } from "react-i18next"; -import { useNavigate, Navigate, useParams } from "react-router-dom"; +import { useNavigate, useParams } from "react-router-dom"; import { getDateView, getTime } from "@USupport-components-library/utils"; import "./payment-status.scss"; @@ -42,7 +42,7 @@ export const PaymentStatus = () => { return res?.data; }; - const consultationQuerry = useQuery(["consultation"], getConsultation, { + useQuery(["consultation"], getConsultation, { onSuccess: (data) => { setConsultationDate(getDateView(data.time)); setConsultaitonTime(getTime(data.time)); @@ -57,7 +57,7 @@ export const PaymentStatus = () => { ); if (!clientSecret) { - navigate(`/not-found`); + navigate("/not-found"); } else { stripe.retrievePaymentIntent(clientSecret).then(({ paymentIntent }) => { let newStatusData = {}; diff --git a/src/blocks/PaymentStatus/locales.js b/src/blocks/PaymentStatus/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/PaymentStatus/locales.js +++ b/src/blocks/PaymentStatus/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/PlatformRating/PlatformRating.jsx b/src/blocks/PlatformRating/PlatformRating.jsx index e6eb7958..53e07cde 100644 --- a/src/blocks/PlatformRating/PlatformRating.jsx +++ b/src/blocks/PlatformRating/PlatformRating.jsx @@ -9,6 +9,7 @@ import { Rating, Textarea, Button, + Error, } from "@USupport-components-library/src"; import { useAddPlatformRating } from "#hooks"; diff --git a/src/blocks/PlatformRating/index.js b/src/blocks/PlatformRating/index.js index 3b2ec96a..c2fb7a18 100644 --- a/src/blocks/PlatformRating/index.js +++ b/src/blocks/PlatformRating/index.js @@ -1 +1 @@ -export * from './PlatformRating.jsx'; +export * from "./PlatformRating.jsx"; diff --git a/src/blocks/PlatformRating/locales.js b/src/blocks/PlatformRating/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/PlatformRating/locales.js +++ b/src/blocks/PlatformRating/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/PrivacyPolicy/index.js b/src/blocks/PrivacyPolicy/index.js index 548c7906..b587790d 100644 --- a/src/blocks/PrivacyPolicy/index.js +++ b/src/blocks/PrivacyPolicy/index.js @@ -1 +1 @@ -export * from './PrivacyPolicy.jsx'; +export * from "./PrivacyPolicy.jsx"; diff --git a/src/blocks/ProviderOverview/index.js b/src/blocks/ProviderOverview/index.js index 47c6aeef..f6ec98f9 100644 --- a/src/blocks/ProviderOverview/index.js +++ b/src/blocks/ProviderOverview/index.js @@ -1 +1 @@ -export * from './ProviderOverview.jsx'; +export * from "./ProviderOverview.jsx"; diff --git a/src/blocks/ProviderOverview/locales.js b/src/blocks/ProviderOverview/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ProviderOverview/locales.js +++ b/src/blocks/ProviderOverview/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/RegisterAboutYou/index.js b/src/blocks/RegisterAboutYou/index.js index de627ecb..2b26510b 100644 --- a/src/blocks/RegisterAboutYou/index.js +++ b/src/blocks/RegisterAboutYou/index.js @@ -1 +1 @@ -export * from './RegisterAboutYou.jsx'; +export * from "./RegisterAboutYou.jsx"; diff --git a/src/blocks/RegisterAboutYou/locales.js b/src/blocks/RegisterAboutYou/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/RegisterAboutYou/locales.js +++ b/src/blocks/RegisterAboutYou/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/RegisterAnonymous/index.js b/src/blocks/RegisterAnonymous/index.js index d17c1df1..dbf229c1 100644 --- a/src/blocks/RegisterAnonymous/index.js +++ b/src/blocks/RegisterAnonymous/index.js @@ -1 +1 @@ -export * from './RegisterAnonymous.jsx'; +export * from "./RegisterAnonymous.jsx"; diff --git a/src/blocks/RegisterAnonymous/locales.js b/src/blocks/RegisterAnonymous/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/RegisterAnonymous/locales.js +++ b/src/blocks/RegisterAnonymous/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/RegisterEmail/index.js b/src/blocks/RegisterEmail/index.js index 394e3532..26e5a4c5 100644 --- a/src/blocks/RegisterEmail/index.js +++ b/src/blocks/RegisterEmail/index.js @@ -1 +1 @@ -export * from './RegisterEmail.jsx'; +export * from "./RegisterEmail.jsx"; diff --git a/src/blocks/RegisterEmail/locales.js b/src/blocks/RegisterEmail/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/RegisterEmail/locales.js +++ b/src/blocks/RegisterEmail/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/RegisterPreview/locales.js b/src/blocks/RegisterPreview/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/RegisterPreview/locales.js +++ b/src/blocks/RegisterPreview/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/RegisterSupport/RegisterSupport.jsx b/src/blocks/RegisterSupport/RegisterSupport.jsx index 99f40f38..4364bdbc 100644 --- a/src/blocks/RegisterSupport/RegisterSupport.jsx +++ b/src/blocks/RegisterSupport/RegisterSupport.jsx @@ -36,7 +36,6 @@ export const RegisterSupport = () => { const [data, setData] = useState(""); const [isModalOpen, setIsModalOpen] = useState(false); const [showError, setShowError] = useState(false); - const [submitError, setSubmitError] = useState(); const hasGivenPermission = useRef(); @@ -66,15 +65,12 @@ export const RegisterSupport = () => { }; const updateDataProcessingMutation = useMutation(updateDataProcessing, { onSuccess: () => { - setSubmitError(null); setShowError(false); queryClient.invalidateQueries({ queryKey: ["client-data"] }); setIsModalOpen(false); }, - onError: (error) => { + onError: () => { hasGivenPermission.current = false; - const { message: errorMessage } = useError(error); - setSubmitError(errorMessage); }, }); diff --git a/src/blocks/RegisterSupport/index.js b/src/blocks/RegisterSupport/index.js index 94279007..92dc9979 100644 --- a/src/blocks/RegisterSupport/index.js +++ b/src/blocks/RegisterSupport/index.js @@ -1 +1 @@ -export * from './RegisterSupport.jsx'; +export * from "./RegisterSupport.jsx"; diff --git a/src/blocks/RegisterSupport/locales.js b/src/blocks/RegisterSupport/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/RegisterSupport/locales.js +++ b/src/blocks/RegisterSupport/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/ResetPassword/index.js b/src/blocks/ResetPassword/index.js index 4becdb41..28100a91 100644 --- a/src/blocks/ResetPassword/index.js +++ b/src/blocks/ResetPassword/index.js @@ -1 +1 @@ -export * from './ResetPassword.jsx'; +export * from "./ResetPassword.jsx"; diff --git a/src/blocks/ResetPassword/locales.js b/src/blocks/ResetPassword/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/ResetPassword/locales.js +++ b/src/blocks/ResetPassword/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/SOSCenter/index.js b/src/blocks/SOSCenter/index.js index bbd1d51c..537e3fbb 100644 --- a/src/blocks/SOSCenter/index.js +++ b/src/blocks/SOSCenter/index.js @@ -1 +1 @@ -export * from './SOSCenter.jsx'; +export * from "./SOSCenter.jsx"; diff --git a/src/blocks/SOSCenter/locales.js b/src/blocks/SOSCenter/locales.js index ed94532f..10c9c3c5 100644 --- a/src/blocks/SOSCenter/locales.js +++ b/src/blocks/SOSCenter/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json' +export * as en from "./locales/en.json" export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/SafetyFeedback/index.js b/src/blocks/SafetyFeedback/index.js index fa625d5a..404384de 100644 --- a/src/blocks/SafetyFeedback/index.js +++ b/src/blocks/SafetyFeedback/index.js @@ -1 +1 @@ -export * from './SafetyFeedback.jsx'; +export * from "./SafetyFeedback.jsx"; diff --git a/src/blocks/SafetyFeedback/locales.js b/src/blocks/SafetyFeedback/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/SafetyFeedback/locales.js +++ b/src/blocks/SafetyFeedback/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/SelectProvider/index.js b/src/blocks/SelectProvider/index.js index 45db2fe5..a66d1978 100644 --- a/src/blocks/SelectProvider/index.js +++ b/src/blocks/SelectProvider/index.js @@ -1 +1 @@ -export * from './SelectProvider.jsx'; +export * from "./SelectProvider.jsx"; diff --git a/src/blocks/SelectProvider/locales.js b/src/blocks/SelectProvider/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/SelectProvider/locales.js +++ b/src/blocks/SelectProvider/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/SharePlatform/index.js b/src/blocks/SharePlatform/index.js index f3e430fa..6f74d1cc 100644 --- a/src/blocks/SharePlatform/index.js +++ b/src/blocks/SharePlatform/index.js @@ -1 +1 @@ -export * from './SharePlatform.jsx'; +export * from "./SharePlatform.jsx"; diff --git a/src/blocks/SharePlatform/locales.js b/src/blocks/SharePlatform/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/SharePlatform/locales.js +++ b/src/blocks/SharePlatform/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/TermsOfUse/index.js b/src/blocks/TermsOfUse/index.js index cdc1e25a..01f873e8 100644 --- a/src/blocks/TermsOfUse/index.js +++ b/src/blocks/TermsOfUse/index.js @@ -1 +1 @@ -export * from './TermsOfUse.jsx'; +export * from "./TermsOfUse.jsx"; diff --git a/src/blocks/TermsOfUse/locales.js b/src/blocks/TermsOfUse/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/TermsOfUse/locales.js +++ b/src/blocks/TermsOfUse/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/UserDetails/UserDetails.jsx b/src/blocks/UserDetails/UserDetails.jsx index e3d3d46b..914eedab 100644 --- a/src/blocks/UserDetails/UserDetails.jsx +++ b/src/blocks/UserDetails/UserDetails.jsx @@ -12,7 +12,6 @@ import { Error as ErrorMessage, Grid, GridItem, - Icon, Input, Loading, Modal, @@ -224,7 +223,7 @@ export const UserDetails = ({ closeDataProcessingModal(); queryClient.invalidateQueries({ queryKey: ["client-data"] }); }, - onError: (error) => { + onError: () => { setDataProcessing((prev) => !prev); // Revert the optimistic update }, }); @@ -423,7 +422,6 @@ export const UserDetails = ({ components={[ window .open( diff --git a/src/blocks/UserDetails/index.js b/src/blocks/UserDetails/index.js index 131cccc7..b87d5bb3 100644 --- a/src/blocks/UserDetails/index.js +++ b/src/blocks/UserDetails/index.js @@ -1 +1 @@ -export * from './UserDetails.jsx'; +export * from "./UserDetails.jsx"; diff --git a/src/blocks/UserDetails/locales.js b/src/blocks/UserDetails/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/UserDetails/locales.js +++ b/src/blocks/UserDetails/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/UserProfile/index.js b/src/blocks/UserProfile/index.js index 370a0d88..8bb78603 100644 --- a/src/blocks/UserProfile/index.js +++ b/src/blocks/UserProfile/index.js @@ -1 +1 @@ -export * from './UserProfile.jsx'; +export * from "./UserProfile.jsx"; diff --git a/src/blocks/UserProfile/locales.js b/src/blocks/UserProfile/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/UserProfile/locales.js +++ b/src/blocks/UserProfile/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/blocks/VideoRoom/AudioTrack.jsx b/src/blocks/VideoRoom/AudioTrack.jsx index 2090d55c..3e9a6c37 100644 --- a/src/blocks/VideoRoom/AudioTrack.jsx +++ b/src/blocks/VideoRoom/AudioTrack.jsx @@ -1,5 +1,5 @@ // AudioTrack.js -import { useEffect, useRef } from "react"; +import React, { useEffect, useRef } from "react"; export default function AudioTrack({ track }) { const ref = useRef(); diff --git a/src/blocks/VideoRoom/VideoTrack.jsx b/src/blocks/VideoRoom/VideoTrack.jsx index bfd69cc2..8350bcb7 100644 --- a/src/blocks/VideoRoom/VideoTrack.jsx +++ b/src/blocks/VideoRoom/VideoTrack.jsx @@ -1,5 +1,5 @@ // VideoTrack.js -import { useEffect, useRef } from "react"; +import React, { useEffect, useRef } from "react"; export default function VideoTrack({ type, track }) { const ref = useRef(); diff --git a/src/blocks/VideoRoom/index.js b/src/blocks/VideoRoom/index.js index 96b666ba..1948293b 100644 --- a/src/blocks/VideoRoom/index.js +++ b/src/blocks/VideoRoom/index.js @@ -1 +1 @@ -export * from './VideoRoom.jsx'; +export * from "./VideoRoom.jsx"; diff --git a/src/blocks/VideoRoom/locales.js b/src/blocks/VideoRoom/locales.js index d9866170..56fc6f55 100644 --- a/src/blocks/VideoRoom/locales.js +++ b/src/blocks/VideoRoom/locales.js @@ -1 +1 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; diff --git a/src/blocks/Welcome/index.js b/src/blocks/Welcome/index.js index 9273e270..0819b699 100644 --- a/src/blocks/Welcome/index.js +++ b/src/blocks/Welcome/index.js @@ -1 +1 @@ -export * from './Welcome.jsx'; +export * from "./Welcome.jsx"; diff --git a/src/blocks/Welcome/locales.js b/src/blocks/Welcome/locales.js index b55d5173..7889df5e 100644 --- a/src/blocks/Welcome/locales.js +++ b/src/blocks/Welcome/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/hooks/useAcceptConsultation.js b/src/hooks/useAcceptConsultation.js index 2549ab38..9665a6d0 100644 --- a/src/hooks/useAcceptConsultation.js +++ b/src/hooks/useAcceptConsultation.js @@ -9,7 +9,7 @@ export default function useAcceptConsultation(onSuccess, onError) { const acceptConsultation = async ({ consultationId, price }) => { if (price && price > 0) { - navigate(`/checkout`, { + navigate("/checkout", { state: { consultationId: consultationId, entryTime: new Date() }, }); return false; diff --git a/src/modals/CreateQuestion/index.js b/src/modals/CreateQuestion/index.js index b24a743e..76d2a44d 100644 --- a/src/modals/CreateQuestion/index.js +++ b/src/modals/CreateQuestion/index.js @@ -1 +1 @@ -export * from './CreateQuestion.jsx'; +export * from "./CreateQuestion.jsx"; diff --git a/src/modals/MoodTrackMoreInformation/index.js b/src/modals/MoodTrackMoreInformation/index.js index ed5e111a..b20602fe 100644 --- a/src/modals/MoodTrackMoreInformation/index.js +++ b/src/modals/MoodTrackMoreInformation/index.js @@ -1 +1 @@ -export * from './MoodTrackMoreInformation.jsx'; +export * from "./MoodTrackMoreInformation.jsx"; diff --git a/src/modals/MoodTrackMoreInformation/locales.js b/src/modals/MoodTrackMoreInformation/locales.js index b55d5173..7889df5e 100644 --- a/src/modals/MoodTrackMoreInformation/locales.js +++ b/src/modals/MoodTrackMoreInformation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/modals/PaymentInformation/index.js b/src/modals/PaymentInformation/index.js index 7a2afdf4..07479b4e 100644 --- a/src/modals/PaymentInformation/index.js +++ b/src/modals/PaymentInformation/index.js @@ -1 +1 @@ -export * from './PaymentInformation.jsx'; +export * from "./PaymentInformation.jsx"; diff --git a/src/modals/PaymentInformation/locales.js b/src/modals/PaymentInformation/locales.js index b55d5173..7889df5e 100644 --- a/src/modals/PaymentInformation/locales.js +++ b/src/modals/PaymentInformation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/modals/QuestionDetails/index.js b/src/modals/QuestionDetails/index.js index 12acdab3..90c40761 100644 --- a/src/modals/QuestionDetails/index.js +++ b/src/modals/QuestionDetails/index.js @@ -1 +1 @@ -export * from './QuestionDetails.jsx'; +export * from "./QuestionDetails.jsx"; diff --git a/src/modals/RequireDataAgreement/RequireDataAgreement.jsx b/src/modals/RequireDataAgreement/RequireDataAgreement.jsx index e130714b..a1804adf 100644 --- a/src/modals/RequireDataAgreement/RequireDataAgreement.jsx +++ b/src/modals/RequireDataAgreement/RequireDataAgreement.jsx @@ -5,9 +5,10 @@ import { toast } from "react-toastify"; import { Modal } from "@USupport-components-library/src"; import { clientSvc } from "@USupport-components-library/services"; - import { mascotHappyBlue } from "@USupport-components-library/assets"; +import { useError } from "#hooks"; + import "./require-data-agreement.scss"; const WEBSITE_URL = import.meta.env.VITE_WEBSITE_URL; diff --git a/src/modals/RequireDataAgreement/index.js b/src/modals/RequireDataAgreement/index.js index d3733505..d7055e0c 100644 --- a/src/modals/RequireDataAgreement/index.js +++ b/src/modals/RequireDataAgreement/index.js @@ -1 +1 @@ -export * from './RequireDataAgreement.jsx'; +export * from "./RequireDataAgreement.jsx"; diff --git a/src/modals/RequireDataAgreement/locales.js b/src/modals/RequireDataAgreement/locales.js index b55d5173..7889df5e 100644 --- a/src/modals/RequireDataAgreement/locales.js +++ b/src/modals/RequireDataAgreement/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/modals/RequireRegistration/index.js b/src/modals/RequireRegistration/index.js index ab2903ae..fa6e3fa5 100644 --- a/src/modals/RequireRegistration/index.js +++ b/src/modals/RequireRegistration/index.js @@ -1 +1 @@ -export * from './RequireRegistration.jsx'; +export * from "./RequireRegistration.jsx"; diff --git a/src/modals/RequireRegistration/locales.js b/src/modals/RequireRegistration/locales.js index b55d5173..7889df5e 100644 --- a/src/modals/RequireRegistration/locales.js +++ b/src/modals/RequireRegistration/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/modals/SaveAccessCodeConfirmation/index.js b/src/modals/SaveAccessCodeConfirmation/index.js index 76ce04ed..ef0238c4 100644 --- a/src/modals/SaveAccessCodeConfirmation/index.js +++ b/src/modals/SaveAccessCodeConfirmation/index.js @@ -1 +1 @@ -export * from './SaveAccessCodeConfirmation.jsx'; +export * from "./SaveAccessCodeConfirmation.jsx"; diff --git a/src/modals/SaveAccessCodeConfirmation/locales.js b/src/modals/SaveAccessCodeConfirmation/locales.js index b55d5173..7889df5e 100644 --- a/src/modals/SaveAccessCodeConfirmation/locales.js +++ b/src/modals/SaveAccessCodeConfirmation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ActivityHistory/index.js b/src/pages/ActivityHistory/index.js index 3323a657..f2616cf4 100644 --- a/src/pages/ActivityHistory/index.js +++ b/src/pages/ActivityHistory/index.js @@ -1 +1 @@ -export * from './ActivityHistory.jsx'; +export * from "./ActivityHistory.jsx"; diff --git a/src/pages/ActivityHistory/locales.js b/src/pages/ActivityHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ActivityHistory/locales.js +++ b/src/pages/ActivityHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ArticleInformation/ArticleInformation.jsx b/src/pages/ArticleInformation/ArticleInformation.jsx index e86d84d5..0d1d7fe1 100644 --- a/src/pages/ArticleInformation/ArticleInformation.jsx +++ b/src/pages/ArticleInformation/ArticleInformation.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React from "react"; import { useParams } from "react-router-dom"; import { useQuery } from "@tanstack/react-query"; import { useNavigate } from "react-router-dom"; diff --git a/src/pages/ArticleInformation/index.js b/src/pages/ArticleInformation/index.js index ba60c499..57221b18 100644 --- a/src/pages/ArticleInformation/index.js +++ b/src/pages/ArticleInformation/index.js @@ -1 +1 @@ -export * from './ArticleInformation.jsx'; +export * from "./ArticleInformation.jsx"; diff --git a/src/pages/ArticleInformation/locales.js b/src/pages/ArticleInformation/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ArticleInformation/locales.js +++ b/src/pages/ArticleInformation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Articles/index.js b/src/pages/Articles/index.js index 2f4fbfa9..e0583057 100644 --- a/src/pages/Articles/index.js +++ b/src/pages/Articles/index.js @@ -1 +1 @@ -export * from './Articles.jsx'; +export * from "./Articles.jsx"; diff --git a/src/pages/Articles/locales.js b/src/pages/Articles/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Articles/locales.js +++ b/src/pages/Articles/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Checkout/Checkout.jsx b/src/pages/Checkout/Checkout.jsx index 702f4d68..7dfeb5a0 100644 --- a/src/pages/Checkout/Checkout.jsx +++ b/src/pages/Checkout/Checkout.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import React, { useState } from "react"; import { useQueryClient } from "@tanstack/react-query"; import { useLocation, Navigate, useNavigate } from "react-router-dom"; import { loadStripe } from "@stripe/stripe-js"; @@ -49,7 +49,7 @@ export const Checkout = () => { return res?.data; }; - const paymentIntent = useQuery(["paymentIntent"], fetchPaymentIntent, { + useQuery(["paymentIntent"], fetchPaymentIntent, { onSuccess: ({ currency, price, diff --git a/src/pages/Checkout/index.js b/src/pages/Checkout/index.js index 2b4ecdfa..2a927ccf 100644 --- a/src/pages/Checkout/index.js +++ b/src/pages/Checkout/index.js @@ -1 +1 @@ -export * from './Checkout.jsx'; +export * from "./Checkout.jsx"; diff --git a/src/pages/Checkout/locales.js b/src/pages/Checkout/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Checkout/locales.js +++ b/src/pages/Checkout/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index 7c8a9d5b..adfa5f13 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -250,7 +250,6 @@ export const Consultation = () => { } window.removeEventListener("beforeunload", handleBeforeUnload); }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); useEffect(() => { @@ -611,7 +610,6 @@ const MessageList = ({ showAllMessages, setShowAllMessages, onTextareaFocus, - debouncedSearch, renderAllMessages, emitTyping, t, @@ -630,7 +628,6 @@ const MessageList = ({ }; }, []); - const belowMessagesRef = useRef(null); const [isHidden, setIsHidden] = useState(true); useEffect(() => { diff --git a/src/pages/Consultation/index.js b/src/pages/Consultation/index.js index 36dad70b..6329de3f 100644 --- a/src/pages/Consultation/index.js +++ b/src/pages/Consultation/index.js @@ -1 +1 @@ -export * from './Consultation.jsx'; +export * from "./Consultation.jsx"; diff --git a/src/pages/Consultation/locales.js b/src/pages/Consultation/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Consultation/locales.js +++ b/src/pages/Consultation/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Consultations/Consultations.jsx b/src/pages/Consultations/Consultations.jsx index 5f87e422..6cb8fa92 100644 --- a/src/pages/Consultations/Consultations.jsx +++ b/src/pages/Consultations/Consultations.jsx @@ -113,7 +113,7 @@ export const Consultations = () => { setIsSelectConsultationBackdropOpen(false); // Schedule consultation logic - const onRescheduleConsultationSuccess = (data) => { + const onRescheduleConsultationSuccess = () => { setIsBlockSlotSubmitting(false); setConsultationId(consultationId); closeSelectConsultationBackdrop(); diff --git a/src/pages/Consultations/index.js b/src/pages/Consultations/index.js index 9c3a52fc..cdfcb3d5 100644 --- a/src/pages/Consultations/index.js +++ b/src/pages/Consultations/index.js @@ -1 +1 @@ -export * from './Consultations.jsx'; +export * from "./Consultations.jsx"; diff --git a/src/pages/Consultations/locales.js b/src/pages/Consultations/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Consultations/locales.js +++ b/src/pages/Consultations/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ContactUs/index.js b/src/pages/ContactUs/index.js index a4d673f6..70994042 100644 --- a/src/pages/ContactUs/index.js +++ b/src/pages/ContactUs/index.js @@ -1 +1 @@ -export * from './ContactUs.jsx'; +export * from "./ContactUs.jsx"; diff --git a/src/pages/ContactUs/locales.js b/src/pages/ContactUs/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ContactUs/locales.js +++ b/src/pages/ContactUs/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/CookiePolicy/index.js b/src/pages/CookiePolicy/index.js index 6ccb5be0..299e28ea 100644 --- a/src/pages/CookiePolicy/index.js +++ b/src/pages/CookiePolicy/index.js @@ -1 +1 @@ -export * from './CookiePolicy.jsx'; +export * from "./CookiePolicy.jsx"; diff --git a/src/pages/CookiePolicy/locales.js b/src/pages/CookiePolicy/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/CookiePolicy/locales.js +++ b/src/pages/CookiePolicy/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Dashboard/Dashboard.jsx b/src/pages/Dashboard/Dashboard.jsx index faff21cf..07eaf73f 100644 --- a/src/pages/Dashboard/Dashboard.jsx +++ b/src/pages/Dashboard/Dashboard.jsx @@ -118,7 +118,7 @@ export const Dashboard = () => { }; const closeJoinConsultation = () => setIsJoinConsultationOpen(false); - const [isEditingConsultation, setIsEditingConsultation] = useState(true); + const [isEditingConsultation] = useState(true); const [isBlockSlotSubmitting, setIsBlockSlotSubmitting] = useState(false); const [blockSlotError, setBlockSlotError] = useState(); const [consultationId, setConsultationId] = useState(); @@ -201,7 +201,7 @@ export const Dashboard = () => { }); } else { if (consultationPrice.current && consultationPrice.current > 0) { - navigate(`/checkout`, { state: { consultationId: consultationId } }); + navigate("/checkout", { state: { consultationId: consultationId } }); } else { scheduleConsultationMutation.mutate(selectedConsultationId); } diff --git a/src/pages/Dashboard/index.js b/src/pages/Dashboard/index.js index 4c2d2a95..1e6e9db2 100644 --- a/src/pages/Dashboard/index.js +++ b/src/pages/Dashboard/index.js @@ -1 +1 @@ -export * from './Dashboard.jsx'; +export * from "./Dashboard.jsx"; diff --git a/src/pages/Dashboard/locales.js b/src/pages/Dashboard/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Dashboard/locales.js +++ b/src/pages/Dashboard/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/FAQ/index.js b/src/pages/FAQ/index.js index ce5a20ca..7db8be1b 100644 --- a/src/pages/FAQ/index.js +++ b/src/pages/FAQ/index.js @@ -1 +1 @@ -export * from './FAQ.jsx'; +export * from "./FAQ.jsx"; diff --git a/src/pages/FAQ/locales.js b/src/pages/FAQ/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/FAQ/locales.js +++ b/src/pages/FAQ/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ForgotPassword/index.js b/src/pages/ForgotPassword/index.js index bdcbc088..f3686b75 100644 --- a/src/pages/ForgotPassword/index.js +++ b/src/pages/ForgotPassword/index.js @@ -1 +1 @@ -export * from './ForgotPassword.jsx'; +export * from "./ForgotPassword.jsx"; diff --git a/src/pages/ForgotPassword/locales.js b/src/pages/ForgotPassword/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ForgotPassword/locales.js +++ b/src/pages/ForgotPassword/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/InformationPortal/InformationPortal.jsx b/src/pages/InformationPortal/InformationPortal.jsx index ea4b17a0..ba547cf6 100644 --- a/src/pages/InformationPortal/InformationPortal.jsx +++ b/src/pages/InformationPortal/InformationPortal.jsx @@ -6,12 +6,11 @@ import { GridItem, Block, CardMedia, - Button, Loading, } from "@USupport-components-library/src"; import { destructureArticleData } from "@USupport-components-library/utils"; -import { Page, Articles, GiveSuggestion } from "#blocks"; +import { Page, GiveSuggestion } from "#blocks"; import { cmsSvc, adminSvc } from "@USupport-components-library/services"; import { useEventListener } from "#hooks"; import { useTranslation } from "react-i18next"; diff --git a/src/pages/InformationPortal/locales.js b/src/pages/InformationPortal/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/InformationPortal/locales.js +++ b/src/pages/InformationPortal/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Login/index.js b/src/pages/Login/index.js index a03e429f..09afc090 100644 --- a/src/pages/Login/index.js +++ b/src/pages/Login/index.js @@ -1 +1 @@ -export * from './Login.jsx'; +export * from "./Login.jsx"; diff --git a/src/pages/Login/locales.js b/src/pages/Login/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Login/locales.js +++ b/src/pages/Login/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/MoodTrackHistory/index.js b/src/pages/MoodTrackHistory/index.js index db331e05..d78bae83 100644 --- a/src/pages/MoodTrackHistory/index.js +++ b/src/pages/MoodTrackHistory/index.js @@ -1 +1 @@ -export * from './MoodTrackHistory.jsx'; +export * from "./MoodTrackHistory.jsx"; diff --git a/src/pages/MoodTrackHistory/locales.js b/src/pages/MoodTrackHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/MoodTrackHistory/locales.js +++ b/src/pages/MoodTrackHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/MoodTracker/index.js b/src/pages/MoodTracker/index.js index 11eac5f1..fdd8dcb4 100644 --- a/src/pages/MoodTracker/index.js +++ b/src/pages/MoodTracker/index.js @@ -1 +1 @@ -export * from './MoodTracker.jsx'; +export * from "./MoodTracker.jsx"; diff --git a/src/pages/MoodTracker/locales.js b/src/pages/MoodTracker/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/MoodTracker/locales.js +++ b/src/pages/MoodTracker/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/NotFound/index.js b/src/pages/NotFound/index.js index e04596dd..b75b41b6 100644 --- a/src/pages/NotFound/index.js +++ b/src/pages/NotFound/index.js @@ -1 +1 @@ -export * from './NotFound.jsx'; +export * from "./NotFound.jsx"; diff --git a/src/pages/NotificationPreferences/index.js b/src/pages/NotificationPreferences/index.js index 0304f1a8..2f1a415e 100644 --- a/src/pages/NotificationPreferences/index.js +++ b/src/pages/NotificationPreferences/index.js @@ -1 +1 @@ -export * from './NotificationPreferences.jsx'; +export * from "./NotificationPreferences.jsx"; diff --git a/src/pages/NotificationPreferences/locales.js b/src/pages/NotificationPreferences/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/NotificationPreferences/locales.js +++ b/src/pages/NotificationPreferences/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Notifications/Notifications.jsx b/src/pages/Notifications/Notifications.jsx index 4cb11a0a..72fb3ee0 100644 --- a/src/pages/Notifications/Notifications.jsx +++ b/src/pages/Notifications/Notifications.jsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useInfiniteQuery } from "@tanstack/react-query"; +import { toast } from "react-toastify"; import { Page, Notifications as NotificationsBlock } from "#blocks"; import { JoinConsultation } from "#backdrops"; diff --git a/src/pages/Notifications/index.js b/src/pages/Notifications/index.js index c658d5a2..4dc775eb 100644 --- a/src/pages/Notifications/index.js +++ b/src/pages/Notifications/index.js @@ -1 +1 @@ -export * from './Notifications.jsx'; +export * from "./Notifications.jsx"; diff --git a/src/pages/Notifications/locales.js b/src/pages/Notifications/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/Notifications/locales.js +++ b/src/pages/Notifications/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/PaymentHistory/index.js b/src/pages/PaymentHistory/index.js index 3d9700d6..ec27af14 100644 --- a/src/pages/PaymentHistory/index.js +++ b/src/pages/PaymentHistory/index.js @@ -1 +1 @@ -export * from './PaymentHistory.jsx'; +export * from "./PaymentHistory.jsx"; diff --git a/src/pages/PaymentHistory/locales.js b/src/pages/PaymentHistory/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/PaymentHistory/locales.js +++ b/src/pages/PaymentHistory/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/PaymentStatus/locales.js b/src/pages/PaymentStatus/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/PaymentStatus/locales.js +++ b/src/pages/PaymentStatus/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/PlatformRating/index.js b/src/pages/PlatformRating/index.js index 3b2ec96a..c2fb7a18 100644 --- a/src/pages/PlatformRating/index.js +++ b/src/pages/PlatformRating/index.js @@ -1 +1 @@ -export * from './PlatformRating.jsx'; +export * from "./PlatformRating.jsx"; diff --git a/src/pages/PlatformRating/locales.js b/src/pages/PlatformRating/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/PlatformRating/locales.js +++ b/src/pages/PlatformRating/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/PrivacyPolicy/index.js b/src/pages/PrivacyPolicy/index.js index 548c7906..b587790d 100644 --- a/src/pages/PrivacyPolicy/index.js +++ b/src/pages/PrivacyPolicy/index.js @@ -1 +1 @@ -export * from './PrivacyPolicy.jsx'; +export * from "./PrivacyPolicy.jsx"; diff --git a/src/pages/PrivacyPolicy/locales.js b/src/pages/PrivacyPolicy/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/PrivacyPolicy/locales.js +++ b/src/pages/PrivacyPolicy/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ProviderOverview/ProviderOverview.jsx b/src/pages/ProviderOverview/ProviderOverview.jsx index c46fb336..f14471ca 100644 --- a/src/pages/ProviderOverview/ProviderOverview.jsx +++ b/src/pages/ProviderOverview/ProviderOverview.jsx @@ -71,7 +71,7 @@ export const ProviderOverview = () => { consultationPrice.current > 0 && !selectedSlot.current?.campaign_id ) { - navigate(`/checkout`, { + navigate("/checkout", { state: { consultationId: consultationId, campaignId: selectedSlot.current?.campaign_id, @@ -87,7 +87,7 @@ export const ProviderOverview = () => { }; const blockSlotMutation = useBlockSlot(onBlockSlotSuccess, onBlockSlotError); - const onScheduleConsultationSuccess = (data) => { + const onScheduleConsultationSuccess = () => { setIsBlockSlotSubmitting(false); setConsultationId(consultationId); closeScheduleBackdrop(); diff --git a/src/pages/ProviderOverview/index.js b/src/pages/ProviderOverview/index.js index 47c6aeef..f6ec98f9 100644 --- a/src/pages/ProviderOverview/index.js +++ b/src/pages/ProviderOverview/index.js @@ -1 +1 @@ -export * from './ProviderOverview.jsx'; +export * from "./ProviderOverview.jsx"; diff --git a/src/pages/ProviderOverview/locales.js b/src/pages/ProviderOverview/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ProviderOverview/locales.js +++ b/src/pages/ProviderOverview/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/RegisterAboutYou/index.js b/src/pages/RegisterAboutYou/index.js index de627ecb..2b26510b 100644 --- a/src/pages/RegisterAboutYou/index.js +++ b/src/pages/RegisterAboutYou/index.js @@ -1 +1 @@ -export * from './RegisterAboutYou.jsx'; +export * from "./RegisterAboutYou.jsx"; diff --git a/src/pages/RegisterAboutYou/locales.js b/src/pages/RegisterAboutYou/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/RegisterAboutYou/locales.js +++ b/src/pages/RegisterAboutYou/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/RegisterAnonymous/index.js b/src/pages/RegisterAnonymous/index.js index d17c1df1..dbf229c1 100644 --- a/src/pages/RegisterAnonymous/index.js +++ b/src/pages/RegisterAnonymous/index.js @@ -1 +1 @@ -export * from './RegisterAnonymous.jsx'; +export * from "./RegisterAnonymous.jsx"; diff --git a/src/pages/RegisterAnonymous/locales.js b/src/pages/RegisterAnonymous/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/RegisterAnonymous/locales.js +++ b/src/pages/RegisterAnonymous/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/RegisterEmail/index.js b/src/pages/RegisterEmail/index.js index 394e3532..26e5a4c5 100644 --- a/src/pages/RegisterEmail/index.js +++ b/src/pages/RegisterEmail/index.js @@ -1 +1 @@ -export * from './RegisterEmail.jsx'; +export * from "./RegisterEmail.jsx"; diff --git a/src/pages/RegisterEmail/locales.js b/src/pages/RegisterEmail/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/RegisterEmail/locales.js +++ b/src/pages/RegisterEmail/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/RegisterPreview/RegisterPreview.jsx b/src/pages/RegisterPreview/RegisterPreview.jsx index 974738c0..ebcd37c9 100644 --- a/src/pages/RegisterPreview/RegisterPreview.jsx +++ b/src/pages/RegisterPreview/RegisterPreview.jsx @@ -1,8 +1,7 @@ import React from "react"; -import { useTranslation } from "react-i18next"; import { useNavigate, Navigate } from "react-router-dom"; import { Page, RegisterPreview as RegisterPreviewBlock } from "#blocks"; -import { Button, Loading } from "@USupport-components-library/src"; +import { Loading } from "@USupport-components-library/src"; import { useIsLoggedIn } from "#hooks"; import "./register-preview.scss"; @@ -15,7 +14,6 @@ import "./register-preview.scss"; * @returns {JSX.Element} */ export const RegisterPreview = () => { - const { t } = useTranslation("register-preview-page"); const navigate = useNavigate(); const isLoggedIn = useIsLoggedIn(); diff --git a/src/pages/RegisterPreview/locales.js b/src/pages/RegisterPreview/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/RegisterPreview/locales.js +++ b/src/pages/RegisterPreview/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/RegisterSupport/index.js b/src/pages/RegisterSupport/index.js index 94279007..92dc9979 100644 --- a/src/pages/RegisterSupport/index.js +++ b/src/pages/RegisterSupport/index.js @@ -1 +1 @@ -export * from './RegisterSupport.jsx'; +export * from "./RegisterSupport.jsx"; diff --git a/src/pages/RegisterSupport/locales.js b/src/pages/RegisterSupport/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/RegisterSupport/locales.js +++ b/src/pages/RegisterSupport/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/ResetPassword/index.js b/src/pages/ResetPassword/index.js index 4becdb41..28100a91 100644 --- a/src/pages/ResetPassword/index.js +++ b/src/pages/ResetPassword/index.js @@ -1 +1 @@ -export * from './ResetPassword.jsx'; +export * from "./ResetPassword.jsx"; diff --git a/src/pages/ResetPassword/locales.js b/src/pages/ResetPassword/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/ResetPassword/locales.js +++ b/src/pages/ResetPassword/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/SOSCenter/index.js b/src/pages/SOSCenter/index.js index bbd1d51c..537e3fbb 100644 --- a/src/pages/SOSCenter/index.js +++ b/src/pages/SOSCenter/index.js @@ -1 +1 @@ -export * from './SOSCenter.jsx'; +export * from "./SOSCenter.jsx"; diff --git a/src/pages/SelectProvider/SelectProvider.jsx b/src/pages/SelectProvider/SelectProvider.jsx index f42afba5..79a04521 100644 --- a/src/pages/SelectProvider/SelectProvider.jsx +++ b/src/pages/SelectProvider/SelectProvider.jsx @@ -6,7 +6,6 @@ import { useWindowDimensions } from "@USupport-components-library/utils"; import { RadialCircle, ButtonWithIcon, - Loading, Button, Modal, Input, diff --git a/src/pages/SelectProvider/index.js b/src/pages/SelectProvider/index.js index 45db2fe5..a66d1978 100644 --- a/src/pages/SelectProvider/index.js +++ b/src/pages/SelectProvider/index.js @@ -1 +1 @@ -export * from './SelectProvider.jsx'; +export * from "./SelectProvider.jsx"; diff --git a/src/pages/SelectProvider/locales.js b/src/pages/SelectProvider/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/SelectProvider/locales.js +++ b/src/pages/SelectProvider/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/SharePlatform/index.js b/src/pages/SharePlatform/index.js index f3e430fa..6f74d1cc 100644 --- a/src/pages/SharePlatform/index.js +++ b/src/pages/SharePlatform/index.js @@ -1 +1 @@ -export * from './SharePlatform.jsx'; +export * from "./SharePlatform.jsx"; diff --git a/src/pages/SharePlatform/locales.js b/src/pages/SharePlatform/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/SharePlatform/locales.js +++ b/src/pages/SharePlatform/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/TermsOfUse/index.js b/src/pages/TermsOfUse/index.js index cdc1e25a..01f873e8 100644 --- a/src/pages/TermsOfUse/index.js +++ b/src/pages/TermsOfUse/index.js @@ -1 +1 @@ -export * from './TermsOfUse.jsx'; +export * from "./TermsOfUse.jsx"; diff --git a/src/pages/TermsOfUse/locales.js b/src/pages/TermsOfUse/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/TermsOfUse/locales.js +++ b/src/pages/TermsOfUse/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/UserDetails/index.js b/src/pages/UserDetails/index.js index 131cccc7..b87d5bb3 100644 --- a/src/pages/UserDetails/index.js +++ b/src/pages/UserDetails/index.js @@ -1 +1 @@ -export * from './UserDetails.jsx'; +export * from "./UserDetails.jsx"; diff --git a/src/pages/UserDetails/locales.js b/src/pages/UserDetails/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/UserDetails/locales.js +++ b/src/pages/UserDetails/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/UserProfile/index.js b/src/pages/UserProfile/index.js index 370a0d88..8bb78603 100644 --- a/src/pages/UserProfile/index.js +++ b/src/pages/UserProfile/index.js @@ -1 +1 @@ -export * from './UserProfile.jsx'; +export * from "./UserProfile.jsx"; diff --git a/src/pages/UserProfile/locales.js b/src/pages/UserProfile/locales.js index b55d5173..7889df5e 100644 --- a/src/pages/UserProfile/locales.js +++ b/src/pages/UserProfile/locales.js @@ -1,3 +1,3 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; export * as ru from "./locales/ru.json" export * as kk from "./locales/kk.json" diff --git a/src/pages/Welcome/index.js b/src/pages/Welcome/index.js index 9273e270..0819b699 100644 --- a/src/pages/Welcome/index.js +++ b/src/pages/Welcome/index.js @@ -1 +1 @@ -export * from './Welcome.jsx'; +export * from "./Welcome.jsx"; diff --git a/src/pages/Welcome/locales.js b/src/pages/Welcome/locales.js index d9866170..56fc6f55 100644 --- a/src/pages/Welcome/locales.js +++ b/src/pages/Welcome/locales.js @@ -1 +1 @@ -export * as en from './locales/en.json'; +export * as en from "./locales/en.json"; diff --git a/src/routes/Root/Root.jsx b/src/routes/Root/Root.jsx index 4d1e9ed9..d958d803 100644 --- a/src/routes/Root/Root.jsx +++ b/src/routes/Root/Root.jsx @@ -33,7 +33,6 @@ import { RegisterSupport, ResetPassword, SelectProvider, - SharePlatform, SOSCenter, TermsOfUse, UserDetails, From aea85d4d598a58d46d1810d7a1158b58c0ed5333 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 4 Sep 2023 14:05:09 +0300 Subject: [PATCH 029/153] Fix: availableBefore/After filters not working after inital select, and refactor translations --- .../FilterProviders/FilterProviders.jsx | 40 +++++++++---------- src/backdrops/FilterProviders/locales/en.json | 2 +- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/src/backdrops/FilterProviders/FilterProviders.jsx b/src/backdrops/FilterProviders/FilterProviders.jsx index 652a9942..dd1c3382 100644 --- a/src/backdrops/FilterProviders/FilterProviders.jsx +++ b/src/backdrops/FilterProviders/FilterProviders.jsx @@ -33,17 +33,17 @@ export const FilterProviders = ({ const [providerTypes, setProviderTypes] = useState([ { - label: t("provider_psychologist"), + label: "provider_psychologist", value: "psychologist", isSelected: false, }, { - label: t("provider_psychotherapist"), + label: "provider_psychotherapist", value: "psychotherapist", isSelected: false, }, { - label: t("provider_psychiatrist"), + label: "provider_psychiatrist", value: "psychiatrist", isSelected: false, }, @@ -51,13 +51,13 @@ export const FilterProviders = ({ const [providerSex, setProviderSex] = useState([ { - label: t("male"), + label: "male", value: "male", isSelected: false, }, - { label: t("female"), value: "female", isSelected: false }, - { label: t("unspecified"), value: "unspecified", isSelected: false }, - { label: t("notMentioned"), value: "not_mentioned", isSelected: false }, + { label: "female", value: "female", isSelected: false }, + { label: "unspecified", value: "unspecified", isSelected: false }, + { label: "not_mentioned", value: "not_mentioned", isSelected: false }, ]); useEffect(() => { @@ -156,13 +156,19 @@ export const FilterProviders = ({ ({ + ...x, + label: t(x.label), + }))} setOptions={setProviderTypes} /> ({ + ...x, + label: t(x.label), + }))} setOptions={setProviderSex} />
@@ -178,24 +184,16 @@ export const FilterProviders = ({
- setData((prev) => ({ - ...prev, - availableAfter: e?.currentTarget?.value, - })) - } + onChange={(e) => { + handleSelect("availableAfter", e.target.value); + }} value={data.availableAfter || ""} placeholder="DD.MM.YYY" classes={["client-ratings__backdrop__date-picker"]} /> - setData((prev) => ({ - ...prev, - availableBefore: e?.currentTarget?.value, - })) - } + onChange={(e) => handleSelect("availableBefore", e.target.value)} value={data.availableBefore || ""} placeholder="DD.MM.YYY" classes={["client-ratings__backdrop__date-picker"]} diff --git a/src/backdrops/FilterProviders/locales/en.json b/src/backdrops/FilterProviders/locales/en.json index a79d3dea..5b3b4206 100644 --- a/src/backdrops/FilterProviders/locales/en.json +++ b/src/backdrops/FilterProviders/locales/en.json @@ -7,9 +7,9 @@ "male": "Male", "female": "Female", "unspecified": "Unspecified", + "not_mentioned": "Prefer not to say", "provider_type_checkbox_group_label": "Provider type", "provider_sex_checkbox_group_label": "Sex of the provider", - "not_mentioned": "Prefer not to say", "max_price": "Maximum price", "max_price_placeholder": "Select a maximum price", "language": "Language", From fa24e8b63f1ec36ff2f79dc51f204c6dccf13e9f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 4 Sep 2023 17:09:32 +0300 Subject: [PATCH 030/153] Fix: translation --- src/blocks/ConsultationsDashboard/locales/ru.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/ConsultationsDashboard/locales/ru.json b/src/blocks/ConsultationsDashboard/locales/ru.json index f4dc9996..16592ab7 100644 --- a/src/blocks/ConsultationsDashboard/locales/ru.json +++ b/src/blocks/ConsultationsDashboard/locales/ru.json @@ -5,7 +5,7 @@ "live_text": "Сейчас", "accept_button_label": "Принять консультацию", "join_button_label": "Присоединиться", - "change_button_label": "Изменить пароль", + "change_button_label": "Изменить дату", "ordinal_st": "-ый", "ordinal_nd": "-ой", "ordinal_rd": "-ий", From 81621b9145b84c16d8884b41835f317d080da254 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 4 Sep 2023 17:20:57 +0300 Subject: [PATCH 031/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index a62fba1e..17aba265 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit a62fba1e822e68be343449ef1223b91418cc0224 +Subproject commit 17aba2653ff2f17dfb1460a13d586c184e96da42 From 463469f20076378520af7e664d591620b1d5d436 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Mon, 4 Sep 2023 21:30:51 +0300 Subject: [PATCH 032/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 17aba265..baf8adc2 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 17aba2653ff2f17dfb1460a13d586c184e96da42 +Subproject commit baf8adc2b6b9ae4ef1ca17b1d14b29a19f6e30b3 From 8c1010f43bb134ca66deac3a70760cce2c31466f Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Tue, 5 Sep 2023 11:21:33 +0300 Subject: [PATCH 033/153] Add: missing translation in ConfirmConsultation backdrop --- .../ConfirmConsultation/ConfirmConsultation.jsx | 6 +++++- src/backdrops/ConfirmConsultation/locales/en.json | 14 +++++++++++++- src/backdrops/ConfirmConsultation/locales/kk.json | 14 +++++++++++++- src/backdrops/ConfirmConsultation/locales/ru.json | 14 +++++++++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/backdrops/ConfirmConsultation/ConfirmConsultation.jsx b/src/backdrops/ConfirmConsultation/ConfirmConsultation.jsx index f3f2c507..b148c8fc 100644 --- a/src/backdrops/ConfirmConsultation/ConfirmConsultation.jsx +++ b/src/backdrops/ConfirmConsultation/ConfirmConsultation.jsx @@ -27,6 +27,10 @@ export const ConfirmConsultation = ({ isOpen, onClose, consultation }) => { }; const { startDate, endDate } = consultation; + const getMonthNameString = (date) => { + let monthName = t(getMonthName(date).toLowerCase()); + return monthName; + }; return ( {

{t("text", { startDate: startDate.getDate(), - month: getMonthName(startDate), + month: getMonthNameString(startDate), year: startDate.getFullYear(), startTime: getTimeAsString(startDate), endTime: getTimeAsString(endDate), diff --git a/src/backdrops/ConfirmConsultation/locales/en.json b/src/backdrops/ConfirmConsultation/locales/en.json index 9e16ee1a..24dd9f31 100644 --- a/src/backdrops/ConfirmConsultation/locales/en.json +++ b/src/backdrops/ConfirmConsultation/locales/en.json @@ -1,5 +1,17 @@ { "heading": "Your appointment was booked", "ctaLabel": "Continue", - "text": "for {{startDate}}th of {{month}} {{year}} for the slot from {{startTime}} to {{endTime}}. You can change it at any time through the app." + "text": "for {{startDate}}th of {{month}} {{year}} for the slot from {{startTime}} to {{endTime}}. You can change it at any time through the app.", + "january": "January", + "february": "February", + "march": "March", + "april": "April", + "may": "May", + "june": "June", + "july": "July", + "august": "August", + "september": "September", + "october": "October", + "november": "November", + "december": "December" } diff --git a/src/backdrops/ConfirmConsultation/locales/kk.json b/src/backdrops/ConfirmConsultation/locales/kk.json index 03f9f63f..2901e701 100644 --- a/src/backdrops/ConfirmConsultation/locales/kk.json +++ b/src/backdrops/ConfirmConsultation/locales/kk.json @@ -1,5 +1,17 @@ { "heading": "Кездесуіңіз брондалды", "ctaLabel": "Жалғастыру", - "text": "{{startDate}}-шы/ші {{month}} {{year}} күніне {{startTime}} бастап {{endTime}} дейінгі слот үшін. Оны кез келген уақытта қосымша арқылы өзгерте аласыз." + "text": "{{startDate}}-шы/ші {{month}} {{year}} күніне {{startTime}} бастап {{endTime}} дейінгі слот үшін. Оны кез келген уақытта қосымша арқылы өзгерте аласыз.", + "january": "қаңтар", + "february": "ақпан", + "march": "наурыз", + "april": "сәуір", + "may": "мамыр", + "june": "маусым", + "july": "шілде", + "august": "тамыз", + "september": "қыркүйек", + "october": "қазан", + "november": "қараша", + "december": "желтоқсан" } diff --git a/src/backdrops/ConfirmConsultation/locales/ru.json b/src/backdrops/ConfirmConsultation/locales/ru.json index 2f8981fa..3882ae1c 100644 --- a/src/backdrops/ConfirmConsultation/locales/ru.json +++ b/src/backdrops/ConfirmConsultation/locales/ru.json @@ -1,5 +1,17 @@ { "heading": "Ваша встреча была забронирована", "ctaLabel": "Продолжить", - "text": "на {{startDate}} {{month}} {{year}} для слота с {{startTime}} до {{endTime}}. Вы можете изменить его в любое время через приложение." + "text": "на {{startDate}} {{month}} {{year}} для слота с {{startTime}} до {{endTime}}. Вы можете изменить его в любое время через приложение.", + "january": "январь", + "february": "февраль", + "march": "март", + "april": "апрель", + "may": "май", + "june": "июнь", + "july": "июль", + "august": "август", + "september": "сентябрь", + "october": "октябрь", + "november": "ноябрь", + "december": "декабрь" } From 55c5527ed7f2d7c10c993586160530362f71477e Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Tue, 5 Sep 2023 11:25:27 +0300 Subject: [PATCH 034/153] Fix: SelectConsultation backdrop styling --- src/backdrops/SelectConsultation/select-consultation.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backdrops/SelectConsultation/select-consultation.scss b/src/backdrops/SelectConsultation/select-consultation.scss index 6599e8c9..abce9419 100644 --- a/src/backdrops/SelectConsultation/select-consultation.scss +++ b/src/backdrops/SelectConsultation/select-consultation.scss @@ -54,7 +54,7 @@ & .radio-button-selector-group { padding: 0 $spacing_1_2; - padding-bottom: 25rem; + padding-bottom: 28rem; } } } From 8b14c45e735d00e1404db5f201c730e3283f0835 Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Tue, 5 Sep 2023 18:10:37 +0300 Subject: [PATCH 035/153] Add: missing translations in FilterQuestions backdrop, RegisterAboutYou block and UserDetails block --- src/backdrops/FilterQuestions/FilterQuestions.jsx | 1 + src/backdrops/FilterQuestions/locales/en.json | 3 ++- src/backdrops/FilterQuestions/locales/kk.json | 3 ++- src/backdrops/FilterQuestions/locales/ru.json | 3 ++- src/blocks/RegisterAboutYou/RegisterAboutYou.jsx | 3 +++ src/blocks/RegisterAboutYou/locales/en.json | 5 ++++- src/blocks/RegisterAboutYou/locales/kk.json | 5 ++++- src/blocks/RegisterAboutYou/locales/ru.json | 5 ++++- src/blocks/UserDetails/UserDetails.jsx | 3 +++ src/blocks/UserDetails/locales/en.json | 5 ++++- src/blocks/UserDetails/locales/kk.json | 5 ++++- src/blocks/UserDetails/locales/ru.json | 5 ++++- 12 files changed, 37 insertions(+), 9 deletions(-) diff --git a/src/backdrops/FilterQuestions/FilterQuestions.jsx b/src/backdrops/FilterQuestions/FilterQuestions.jsx index 569b0f6b..c718566e 100644 --- a/src/backdrops/FilterQuestions/FilterQuestions.jsx +++ b/src/backdrops/FilterQuestions/FilterQuestions.jsx @@ -65,6 +65,7 @@ export const FilterQuestions = ({ isOpen, onClose, setTag }) => { className="filter-questions__dropdown" selected={selectedTagId} setSelected={setSelectedTagId} + placeholder={t("dropdown_placeholder")} />

)} diff --git a/src/backdrops/FilterQuestions/locales/en.json b/src/backdrops/FilterQuestions/locales/en.json index 2ad5d3ba..edca4a56 100644 --- a/src/backdrops/FilterQuestions/locales/en.json +++ b/src/backdrops/FilterQuestions/locales/en.json @@ -2,5 +2,6 @@ "heading": "Filter questions by tag", "dropdown_label": "Select a tag", "cta_label": "Apply filters", - "secondary_cta_label": "Reset filters" + "secondary_cta_label": "Reset filters", + "dropdown_placeholder": "Select a tag" } diff --git a/src/backdrops/FilterQuestions/locales/kk.json b/src/backdrops/FilterQuestions/locales/kk.json index df403224..8e704595 100644 --- a/src/backdrops/FilterQuestions/locales/kk.json +++ b/src/backdrops/FilterQuestions/locales/kk.json @@ -2,5 +2,6 @@ "heading": "Тег бойынша сұрағыңызды сүзгіден өткізіңіз", "dropdown_label": "Тегті таңдаңыз", "cta_label": "Сүзгілерді қолданыңыз", - "secondary_cta_label": "Сүзгілерді қалпына келтіру" + "secondary_cta_label": "Сүзгілерді қалпына келтіру", + "dropdown_placeholder": "Тегті таңдаңыз" } diff --git a/src/backdrops/FilterQuestions/locales/ru.json b/src/backdrops/FilterQuestions/locales/ru.json index 0557a1a3..840ab33f 100644 --- a/src/backdrops/FilterQuestions/locales/ru.json +++ b/src/backdrops/FilterQuestions/locales/ru.json @@ -2,5 +2,6 @@ "heading": "Фильтровать вопросы по тегу", "dropdown_label": "Выберите тег", "cta_label": "Примените фильтры", - "secondary_cta_label": "Сбросить фильтры" + "secondary_cta_label": "Сбросить фильтры", + "dropdown_placeholder": "Выберите тег" } diff --git a/src/blocks/RegisterAboutYou/RegisterAboutYou.jsx b/src/blocks/RegisterAboutYou/RegisterAboutYou.jsx index c83cd88a..7c1a1663 100644 --- a/src/blocks/RegisterAboutYou/RegisterAboutYou.jsx +++ b/src/blocks/RegisterAboutYou/RegisterAboutYou.jsx @@ -188,6 +188,7 @@ export const RegisterAboutYou = ({ isAnonymous }) => { setSelected={(option) => handleSelect("sex", option)} label={t("dropdown_sex_label")} classes="register-about-you__grid__content-item__inputs-container__sex-dropdown" + placeholder={t("sex_placeholder")} /> { setSelected={(option) => handleSelect("yearOfBirth", option)} label={t("dropdown_year_label")} classes="register-about-you__grid__content-item__inputs-container__year-dropdown" + placeholder={t("year_of_birth_placeholder")} /> { setSelected={(option) => handleSelect("urbanRural", option)} label={t("living_place_label")} classes="register-about-you__grid__content-item__inputs-container__year-dropdown" + placeholder={t("living_place_placeholder")} />
{errors.submit ? : null} diff --git a/src/blocks/RegisterAboutYou/locales/en.json b/src/blocks/RegisterAboutYou/locales/en.json index e2817592..06d01a5b 100644 --- a/src/blocks/RegisterAboutYou/locales/en.json +++ b/src/blocks/RegisterAboutYou/locales/en.json @@ -15,5 +15,8 @@ "place_of_living_rural": "Rural", "sex_error": "Please enter your sex", "year_of_birth_error": "Please enter your year of birth", - "place_of_living_error": "Please enter your place of living" + "place_of_living_error": "Please enter your place of living", + "sex_placeholder": "Enter your sex", + "year_of_birth_placeholder": "Enter your year of birth", + "living_place_placeholder": "Enter your living place" } diff --git a/src/blocks/RegisterAboutYou/locales/kk.json b/src/blocks/RegisterAboutYou/locales/kk.json index e9bed7f9..f30db60c 100644 --- a/src/blocks/RegisterAboutYou/locales/kk.json +++ b/src/blocks/RegisterAboutYou/locales/kk.json @@ -15,5 +15,8 @@ "place_of_living_rural": "Ауыл", "sex_error": "Өтінеміз, жынысыңызды көрсетіңіз", "year_of_birth_error": "Өтінеміз, туған жылыңызды көрсетіңіз", - "place_of_living_error": "Өтінеміз, тұрғылықты жеріңізді көрсетіңіз" + "place_of_living_error": "Өтінеміз, тұрғылықты жеріңізді көрсетіңіз", + "sex_placeholder": "Жынысыңызды енгізіңіз", + "year_of_birth_placeholder": "Туған жылыңызды енгізіңіз", + "living_place_placeholder": "Тұрғылықты жеріңізді енгізіңіз" } diff --git a/src/blocks/RegisterAboutYou/locales/ru.json b/src/blocks/RegisterAboutYou/locales/ru.json index 26c08029..faa4a4f4 100644 --- a/src/blocks/RegisterAboutYou/locales/ru.json +++ b/src/blocks/RegisterAboutYou/locales/ru.json @@ -15,5 +15,8 @@ "place_of_living_rural": "Село", "sex_error": "Пожалуйста, укажите свой пол", "year_of_birth_error": "Пожалуйста, укажите свой год рождения", - "place_of_living_error": "Пожалуйста, укажите свое место жительства" + "place_of_living_error": "Пожалуйста, укажите свое место жительства", + "sex_placeholder": "Введите свой пол", + "year_of_birth_placeholder": "Введите свой год рождения", + "living_place_placeholder": "Введите место вашего жительства" } diff --git a/src/blocks/UserDetails/UserDetails.jsx b/src/blocks/UserDetails/UserDetails.jsx index 914eedab..495f6e93 100644 --- a/src/blocks/UserDetails/UserDetails.jsx +++ b/src/blocks/UserDetails/UserDetails.jsx @@ -313,6 +313,7 @@ export const UserDetails = ({ label={`${t("sex")}${ clientDataQuery?.data?.accessToken ? "" : "*" }`} + placeholder={t("sex_placeholder")} /> {errors.submit ? : null}
{(isChatShownOnMobile || width >= 768) && ( Date: Tue, 17 Oct 2023 12:14:48 +0300 Subject: [PATCH 056/153] Refactor: Remove emergency button from register screens --- src/pages/RegisterAnonymous/RegisterAnonymous.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/RegisterAnonymous/RegisterAnonymous.jsx b/src/pages/RegisterAnonymous/RegisterAnonymous.jsx index ebe38047..398079b7 100644 --- a/src/pages/RegisterAnonymous/RegisterAnonymous.jsx +++ b/src/pages/RegisterAnonymous/RegisterAnonymous.jsx @@ -35,6 +35,7 @@ export const RegisterAnonymous = () => { heading={t("heading")} handleGoBack={handleGoBack} subheading={t("subheading")} + showEmergencyButton={false} > {width < 768 && } From c31976694a3ef97493b6b9ae5b969557c3b2dbfe Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Tue, 17 Oct 2023 11:13:37 +0100 Subject: [PATCH 057/153] Refactor: add emergency button back to RegisterPreview screen --- src/pages/RegisterPreview/RegisterPreview.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/RegisterPreview/RegisterPreview.jsx b/src/pages/RegisterPreview/RegisterPreview.jsx index be700685..ebcd37c9 100644 --- a/src/pages/RegisterPreview/RegisterPreview.jsx +++ b/src/pages/RegisterPreview/RegisterPreview.jsx @@ -29,7 +29,6 @@ export const RegisterPreview = () => { classes="page__register-preview" additionalPadding={false} showHeadingButtonInline - showEmergencyButton={false} > From de28c33135d444382fefbad8e14cc38e0c9dbedc Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Wed, 18 Oct 2023 14:57:51 +0300 Subject: [PATCH 058/153] Refactor: Add the new language switch and remove the old one --- src/blocks/RegisterEmail/RegisterEmail.jsx | 45 +------------------ src/pages/Login/Login.jsx | 1 + .../RegisterAnonymous/RegisterAnonymous.jsx | 1 + src/pages/RegisterEmail/RegisterEmail.jsx | 1 + 4 files changed, 4 insertions(+), 44 deletions(-) diff --git a/src/blocks/RegisterEmail/RegisterEmail.jsx b/src/blocks/RegisterEmail/RegisterEmail.jsx index bf929a14..f59a19c6 100644 --- a/src/blocks/RegisterEmail/RegisterEmail.jsx +++ b/src/blocks/RegisterEmail/RegisterEmail.jsx @@ -2,7 +2,6 @@ import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { useNavigate, Link } from "react-router-dom"; import ReCAPTCHA from "react-google-recaptcha"; -import { useQuery } from "@tanstack/react-query"; import Joi from "joi"; @@ -17,11 +16,8 @@ import { InputPassword, TermsAgreement, Button, - DropdownWithLabel, - Loading, } from "@USupport-components-library/src"; import { validateProperty, validate } from "@USupport-components-library/utils"; -import { languageSvc } from "@USupport-components-library/services"; import "./register-email.scss"; @@ -42,7 +38,7 @@ export const RegisterEmail = ({ showCaptcha, isCaptchaValid, }) => { - const { t, i18n } = useTranslation("register-email"); + const { t } = useTranslation("register-email"); const navigate = useNavigate(); const schema = Joi.object({ @@ -118,49 +114,10 @@ export const RegisterEmail = ({ data.nickname && isCaptchaValid; - const localStorageLanguage = localStorage.getItem("language"); - const [selectedLanguage, setSelectedLanguage] = useState(null); - - const fetchLanguages = async () => { - const res = await languageSvc.getActiveLanguages(); - const languages = res.data.map((x) => { - const languageObject = { - value: x.alpha2, - label: x.name === "English" ? x.name : `${x.name} (${x.local_name})`, - id: x["language_id"], - }; - if (localStorageLanguage === x.alpha2) { - setSelectedLanguage(x.alpha2); - i18n.changeLanguage(localStorageLanguage); - } - return languageObject; - }); - return languages; - }; - - const languagesQuery = useQuery(["languages"], fetchLanguages, { - retry: false, - }); - return ( - {!languagesQuery.isLoading ? ( - { - setSelectedLanguage(lang); - i18n.changeLanguage(lang); - }} - classes="register-email__grid__language-dropdown" - label={t("language")} - placeholder={t("placeholder")} - /> - ) : ( - - )} { classes="page__login" additionalPadding={false} heading={width >= 768 ? t("heading_1") : t("heading_2")} + renderLanguageSelector={true} > {width < 768 && } diff --git a/src/pages/RegisterAnonymous/RegisterAnonymous.jsx b/src/pages/RegisterAnonymous/RegisterAnonymous.jsx index ebe38047..7ccca540 100644 --- a/src/pages/RegisterAnonymous/RegisterAnonymous.jsx +++ b/src/pages/RegisterAnonymous/RegisterAnonymous.jsx @@ -35,6 +35,7 @@ export const RegisterAnonymous = () => { heading={t("heading")} handleGoBack={handleGoBack} subheading={t("subheading")} + renderLanguageSelector={true} > {width < 768 && } diff --git a/src/pages/RegisterEmail/RegisterEmail.jsx b/src/pages/RegisterEmail/RegisterEmail.jsx index fbd0d6b0..5ec1e2ac 100644 --- a/src/pages/RegisterEmail/RegisterEmail.jsx +++ b/src/pages/RegisterEmail/RegisterEmail.jsx @@ -129,6 +129,7 @@ export const RegisterEmail = () => { classes="page__register-email" heading={t("heading")} handleGoBack={handleGoBack} + renderLanguageSelector={true} > Date: Wed, 18 Oct 2023 14:58:09 +0300 Subject: [PATCH 059/153] Add: Language switch to page block --- src/blocks/Page/Page.jsx | 79 ++++++++++++++++++++++++++++++- src/blocks/Page/page.scss | 98 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 175 insertions(+), 2 deletions(-) diff --git a/src/blocks/Page/Page.jsx b/src/blocks/Page/Page.jsx index 611efe89..c2f223c0 100644 --- a/src/blocks/Page/Page.jsx +++ b/src/blocks/Page/Page.jsx @@ -4,6 +4,7 @@ import classNames from "classnames"; import { useQueryClient, useQuery } from "@tanstack/react-query"; import { useNavigate, Link, NavLink } from "react-router-dom"; import { useTranslation } from "react-i18next"; +import OutsideClickHandler from "react-outside-click-handler"; import { Navbar, @@ -11,6 +12,7 @@ import { Footer, Icon, PasswordModal, + Box, } from "@USupport-components-library/src"; import { @@ -60,6 +62,7 @@ export const Page = ({ showHeadingButtonBelow = false, classes, children, + renderLanguageSelector = false, }) => { useEffect(() => { window.scrollTo(0, 0); @@ -73,7 +76,7 @@ export const Page = ({ const { width } = useWindowDimensions(); - const [isRegistrationModalOpan, setIsRegistrationModalOpen] = useState(false); + const [isRegistrationModalOpen, setIsRegistrationModalOpen] = useState(false); const isTmpUser = userSvc.getUserID() === "tmp-user"; @@ -253,6 +256,11 @@ export const Page = ({ } }; + const [languagesShown, setLanguagesShown] = useState(false); + const handleLanguageSelectorClick = () => { + setLanguagesShown(!languagesShown); + }; + return ( <> )} + {renderLanguageSelector && ( +
+
+

+ {selectedLanguage.value} +

+ +
+ + setLanguagesShown(false)} + > + +
+ {languages.map((language) => ( +
{ + setSelectedLanguage(language); + i18n.changeLanguage(language.value); + localStorage.setItem("language", language.value); + setLanguagesShown(false); + }} + > +

+ {`${language.label} ${ + language.label !== "English" && + language.localName + ? `(${language.localName})` + : "" + }`} +

+
+ ))} +
+
+
+
+ )}
{headingButton && (
@@ -349,7 +424,7 @@ export const Page = ({ diff --git a/src/blocks/Page/page.scss b/src/blocks/Page/page.scss index a0833b46..c821b3b8 100644 --- a/src/blocks/Page/page.scss +++ b/src/blocks/Page/page.scss @@ -36,6 +36,104 @@ padding-right: $spacing_23_0; } + &__language { + margin-left: 3rem; + margin-right: 1rem; + position: relative; + cursor: pointer; + + @media screen and (min-width: $screen-sm) { + margin-left: auto; + } + + &:hover::before { + width: 50%; + } + + &::before { + content: ""; + position: absolute; + bottom: 0; + left: 0; + height: 0.2rem; + width: 0; + background-color: $color_primary_20809e; + transition: width 0.3s; + } + + &__heading { + display: flex; + align-items: center; + gap: 0.5rem; + position: relative; + + &__text { + text-transform: uppercase; + font-weight: $font_bold; + @include themify($themes, "color", "color_primary_20809e"); + } + + &__icon { + transition: transform 0.5s; + + &--rotated { + transform: rotate(180deg); + } + } + } + + &__dropdown { + position: absolute; + top: calc(100% + 1rem); + left: -50%; + transform: translateX(-50%); + z-index: 10; + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: center; + min-width: 18rem; + + @media screen and (min-width: $screen-lg) { + left: 50%; + min-width: 21rem; + } + + max-height: 0; + transition: max-height 0.4s ease-in-out; + overflow-y: auto; + + &--shown { + max-height: 16rem; + + @media screen and (min-width: $navbar-tight) { + max-height: 20rem; + } + } + + &__content { + padding: 2rem 2rem; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + + &__item { + display: flex; + cursor: pointer; + + &__text { + padding: 0.5rem 0; + + &--selected { + @include themify($themes, "color", "color_primary_20809e"); + } + } + } + } + } + } + &-heading { max-width: 75rem; word-break: break-word; From 7fc2c3026fd7e21a389cc7f4bfd561f7013b788c Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Wed, 18 Oct 2023 16:04:38 +0300 Subject: [PATCH 060/153] Refactor: Remove padding in register block --- src/blocks/RegisterEmail/register-email.scss | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/blocks/RegisterEmail/register-email.scss b/src/blocks/RegisterEmail/register-email.scss index 23d9538b..71dc2395 100644 --- a/src/blocks/RegisterEmail/register-email.scss +++ b/src/blocks/RegisterEmail/register-email.scss @@ -3,10 +3,6 @@ .register-email { @include full-height-page-navbar(); - @media screen and (min-width: $screen-md) { - padding-top: $spacing_6_4; - } - &__grid { place-items: center; min-height: 90vh; From 3e572e922ea52e05a69c18b02afb455c3f4cfecd Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Tue, 24 Oct 2023 16:20:08 +0300 Subject: [PATCH 061/153] Refactor: Add wellcome text --- src/blocks/Welcome/Welcome.jsx | 3 ++- src/blocks/Welcome/locales/en.json | 3 ++- src/blocks/Welcome/locales/kk.json | 3 ++- src/blocks/Welcome/locales/ru.json | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/blocks/Welcome/Welcome.jsx b/src/blocks/Welcome/Welcome.jsx index 22427b04..7c0f01a5 100644 --- a/src/blocks/Welcome/Welcome.jsx +++ b/src/blocks/Welcome/Welcome.jsx @@ -112,7 +112,8 @@ export const Welcome = () => { src={logoVerticalSvg} alt="Logo" className="welcome__grid__logo-item__logo" - /> + />{" "} +

{t("client")}

{!(countriesQuery.isLoading || languagesQuery.isLoading) ? ( diff --git a/src/blocks/Welcome/locales/en.json b/src/blocks/Welcome/locales/en.json index 3f627b42..e7a18ad2 100644 --- a/src/blocks/Welcome/locales/en.json +++ b/src/blocks/Welcome/locales/en.json @@ -3,5 +3,6 @@ "country": "Country", "language": "Language", "placeholder": "Select", - "button": "Continue" + "button": "Continue", + "client": "Client" } diff --git a/src/blocks/Welcome/locales/kk.json b/src/blocks/Welcome/locales/kk.json index c8480914..6a1ae5e9 100644 --- a/src/blocks/Welcome/locales/kk.json +++ b/src/blocks/Welcome/locales/kk.json @@ -3,5 +3,6 @@ "country": "Ел", "language": "Тіл", "placeholder": "Таңдау", - "button": "Жалғастыру" + "button": "Жалғастыру", + "client": "Клиент" } diff --git a/src/blocks/Welcome/locales/ru.json b/src/blocks/Welcome/locales/ru.json index 77add076..7eeaf605 100644 --- a/src/blocks/Welcome/locales/ru.json +++ b/src/blocks/Welcome/locales/ru.json @@ -3,5 +3,6 @@ "country": "Страна", "language": "Язык", "placeholder": "Выбрать", - "button": "Продолжить" + "button": "Продолжить", + "client": "Клиент" } From 8cb9cfac37d8ce2ae2df0c8ce7c4232b2a3c079f Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Tue, 24 Oct 2023 16:37:18 +0300 Subject: [PATCH 062/153] Refactor: Add logo in login screen --- src/blocks/Login/Login.jsx | 10 ++++++++++ src/blocks/Login/locales/en.json | 4 +++- src/blocks/Login/locales/kk.json | 4 +++- src/blocks/Login/locales/ru.json | 4 +++- src/blocks/Login/login.scss | 8 +++++++- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/blocks/Login/Login.jsx b/src/blocks/Login/Login.jsx index 42e5af96..85ba89e9 100644 --- a/src/blocks/Login/Login.jsx +++ b/src/blocks/Login/Login.jsx @@ -14,6 +14,7 @@ import { import { userSvc } from "@USupport-components-library/services"; import { useError } from "#hooks"; import { getCountryFromTimezone } from "@USupport-components-library/utils"; +import { logoVerticalSvg } from "@USupport-components-library/assets"; import "./login.scss"; @@ -101,6 +102,15 @@ export const Login = () => { return ( + +

{t("heading")}

+ Logo +

{t("client")}

+
Date: Wed, 25 Oct 2023 13:24:48 +0300 Subject: [PATCH 063/153] Remove: Unused language key --- src/blocks/RegisterEmail/locales/en.json | 1 - src/blocks/RegisterEmail/locales/kk.json | 1 - src/blocks/RegisterEmail/locales/ru.json | 1 - 3 files changed, 3 deletions(-) diff --git a/src/blocks/RegisterEmail/locales/en.json b/src/blocks/RegisterEmail/locales/en.json index 4ca443fe..ed4190bd 100644 --- a/src/blocks/RegisterEmail/locales/en.json +++ b/src/blocks/RegisterEmail/locales/en.json @@ -16,5 +16,4 @@ "confirm_password_label": "Confirm password", "password_match_error": "The Password and Confirm Password fields do not match", "age_terms_agreement_text_1": "I am over 13 years old", - "language": "Language" } diff --git a/src/blocks/RegisterEmail/locales/kk.json b/src/blocks/RegisterEmail/locales/kk.json index 8644f1b9..647d8eaa 100644 --- a/src/blocks/RegisterEmail/locales/kk.json +++ b/src/blocks/RegisterEmail/locales/kk.json @@ -16,5 +16,4 @@ "confirm_password_label": "Құпия сөзді растаңыз", "password_match_error": "Құпия сөз және Құпия сөзді растау өрістері сәйкес келмейді", "age_terms_agreement_text_1": "Менің жасым 13-тен үлкен", - "language": "Тіл" } diff --git a/src/blocks/RegisterEmail/locales/ru.json b/src/blocks/RegisterEmail/locales/ru.json index 970e4c9b..cbb7e60c 100644 --- a/src/blocks/RegisterEmail/locales/ru.json +++ b/src/blocks/RegisterEmail/locales/ru.json @@ -16,5 +16,4 @@ "confirm_password_label": "Подтвердите пароль", "password_match_error": "Поля Пароль и Подтвердите пароль не совпадают", "age_terms_agreement_text_1": "Мне больше 13 лет", - "language": "Язык" } From 56048b1ea5c907989c1bb4b95fb68c482a69ab47 Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Wed, 25 Oct 2023 11:31:19 +0100 Subject: [PATCH 064/153] Fix: locales json files in RegisterEmail block --- src/blocks/RegisterEmail/locales/en.json | 2 +- src/blocks/RegisterEmail/locales/kk.json | 2 +- src/blocks/RegisterEmail/locales/ru.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/blocks/RegisterEmail/locales/en.json b/src/blocks/RegisterEmail/locales/en.json index ed4190bd..7e8f6a5e 100644 --- a/src/blocks/RegisterEmail/locales/en.json +++ b/src/blocks/RegisterEmail/locales/en.json @@ -15,5 +15,5 @@ "login_button_label": "I already have an account", "confirm_password_label": "Confirm password", "password_match_error": "The Password and Confirm Password fields do not match", - "age_terms_agreement_text_1": "I am over 13 years old", + "age_terms_agreement_text_1": "I am over 13 years old" } diff --git a/src/blocks/RegisterEmail/locales/kk.json b/src/blocks/RegisterEmail/locales/kk.json index 647d8eaa..026f3ba3 100644 --- a/src/blocks/RegisterEmail/locales/kk.json +++ b/src/blocks/RegisterEmail/locales/kk.json @@ -15,5 +15,5 @@ "login_button_label": "Менің аккаунтым бар", "confirm_password_label": "Құпия сөзді растаңыз", "password_match_error": "Құпия сөз және Құпия сөзді растау өрістері сәйкес келмейді", - "age_terms_agreement_text_1": "Менің жасым 13-тен үлкен", + "age_terms_agreement_text_1": "Менің жасым 13-тен үлкен" } diff --git a/src/blocks/RegisterEmail/locales/ru.json b/src/blocks/RegisterEmail/locales/ru.json index cbb7e60c..73ce0846 100644 --- a/src/blocks/RegisterEmail/locales/ru.json +++ b/src/blocks/RegisterEmail/locales/ru.json @@ -15,5 +15,5 @@ "login_button_label": "У меня уже есть аккаунт", "confirm_password_label": "Подтвердите пароль", "password_match_error": "Поля Пароль и Подтвердите пароль не совпадают", - "age_terms_agreement_text_1": "Мне больше 13 лет", + "age_terms_agreement_text_1": "Мне больше 13 лет" } From 23df4c2de3a4cb4c2950ad6c4a0ac7aeb0231b6f Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Wed, 25 Oct 2023 12:27:45 +0100 Subject: [PATCH 065/153] Add further styling for login screen --- src/blocks/Login/login.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blocks/Login/login.scss b/src/blocks/Login/login.scss index a82c3705..e77c7c8f 100644 --- a/src/blocks/Login/login.scss +++ b/src/blocks/Login/login.scss @@ -12,6 +12,10 @@ place-items: center; text-align: left; + @media screen and (min-width: $screen-md) { + min-height: 75vh; + } + &__logo-item { display: flex; flex-direction: column; From 114728063618b9c48e2e53a4bf4e44e10c5b47c0 Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Wed, 25 Oct 2023 12:29:10 +0100 Subject: [PATCH 066/153] Add: further styling for login screen --- src/blocks/Login/login.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blocks/Login/login.scss b/src/blocks/Login/login.scss index e77c7c8f..98a70a00 100644 --- a/src/blocks/Login/login.scss +++ b/src/blocks/Login/login.scss @@ -16,6 +16,10 @@ min-height: 75vh; } + @media screen and (min-width: $screen-lg) { + min-height: 65vh; + } + &__logo-item { display: flex; flex-direction: column; From 6c7a570227b1fa71115bec90919ff78a910a048b Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Wed, 25 Oct 2023 15:05:37 +0300 Subject: [PATCH 067/153] Refactor: Add logo to forgot password --- src/blocks/ForgotPassword/ForgotPassword.jsx | 12 ++++++++++++ src/blocks/ForgotPassword/locales/en.json | 4 +++- src/blocks/ForgotPassword/locales/kk.json | 4 +++- src/blocks/ForgotPassword/locales/ru.json | 4 +++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/blocks/ForgotPassword/ForgotPassword.jsx b/src/blocks/ForgotPassword/ForgotPassword.jsx index a233c4c8..9c74c9a5 100644 --- a/src/blocks/ForgotPassword/ForgotPassword.jsx +++ b/src/blocks/ForgotPassword/ForgotPassword.jsx @@ -12,6 +12,7 @@ import { import { validate } from "@USupport-components-library/utils"; import { userSvc } from "@USupport-components-library/services"; import Joi from "joi"; +import { logoVerticalSvg } from "@USupport-components-library/assets"; import "./forgot-password.scss"; @@ -55,6 +56,17 @@ export const ForgotPassword = () => { +
+

+ {t("heading")} +

+ Logo +

{t("client")}

+
Date: Wed, 25 Oct 2023 16:45:27 +0300 Subject: [PATCH 068/153] Refactor: Fix logo position --- src/blocks/ForgotPassword/ForgotPassword.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blocks/ForgotPassword/ForgotPassword.jsx b/src/blocks/ForgotPassword/ForgotPassword.jsx index 9c74c9a5..95c5caaf 100644 --- a/src/blocks/ForgotPassword/ForgotPassword.jsx +++ b/src/blocks/ForgotPassword/ForgotPassword.jsx @@ -86,6 +86,11 @@ export const ForgotPassword = () => { />
+
Date: Thu, 26 Oct 2023 12:18:10 +0300 Subject: [PATCH 069/153] Refactor: Fix logo styling --- src/blocks/Login/Login.jsx | 20 ++++++++++++-------- src/blocks/Login/login.scss | 15 +++------------ 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/blocks/Login/Login.jsx b/src/blocks/Login/Login.jsx index 85ba89e9..87bfb807 100644 --- a/src/blocks/Login/Login.jsx +++ b/src/blocks/Login/Login.jsx @@ -102,14 +102,18 @@ export const Login = () => { return ( - -

{t("heading")}

- Logo -

{t("client")}

+ +
+

+ {t("heading")} +

+ Logo +

{t("client")}

+
diff --git a/src/blocks/Login/login.scss b/src/blocks/Login/login.scss index 98a70a00..606bcec4 100644 --- a/src/blocks/Login/login.scss +++ b/src/blocks/Login/login.scss @@ -8,22 +8,13 @@ } &__grid { - min-height: 85vh; place-items: center; text-align: left; - - @media screen and (min-width: $screen-md) { - min-height: 75vh; - } - - @media screen and (min-width: $screen-lg) { - min-height: 65vh; - } + margin-top: $spacing_5_0; &__logo-item { - display: flex; - flex-direction: column; - align-items: center; + text-align: center; + margin-bottom: 2rem; } &__inputs-item { From ab68e9bd9d9169d59dc8937f78b7dd964c5c3c24 Mon Sep 17 00:00:00 2001 From: Chavdar Shishkov Date: Thu, 26 Oct 2023 12:25:18 +0300 Subject: [PATCH 070/153] Refactor: Adjust the styling of the pdf export --- src/blocks/ActivityHistory/ActivityHistory.jsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/blocks/ActivityHistory/ActivityHistory.jsx b/src/blocks/ActivityHistory/ActivityHistory.jsx index c9fa384a..86f97d57 100644 --- a/src/blocks/ActivityHistory/ActivityHistory.jsx +++ b/src/blocks/ActivityHistory/ActivityHistory.jsx @@ -309,7 +309,6 @@ const MyDocument = ({ providerId, providerName, showSystemMessages, - providerImage, t, }) => { return ( @@ -325,16 +324,6 @@ const MyDocument = ({ {t("chat_history")} - - {providerName} {messages.map((message, index) => { From 40edf4e476bc6d78edf849341b169590ab7b0547 Mon Sep 17 00:00:00 2001 From: Sebastian Galustyan Date: Thu, 26 Oct 2023 12:38:56 +0100 Subject: [PATCH 071/153] Add: missing library import --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 9439906e..6d0cc182 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "react-idle-timer": "^5.6.2", "react-infinite-scroll-component": "^6.1.0", "react-markdown": "^8.0.3", + "react-outside-click-handler": "^1.3.0", "react-pin-input": "^1.3.1", "react-router-dom": "^6.4.1", "react-share": "^4.4.1", From db6584e459ab6c98644f3e2379a41f848d3e6827 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 2 Nov 2023 15:27:16 +0200 Subject: [PATCH 072/153] Fix: map languages when they are available --- src/blocks/Page/Page.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blocks/Page/Page.jsx b/src/blocks/Page/Page.jsx index c2f223c0..638e7289 100644 --- a/src/blocks/Page/Page.jsx +++ b/src/blocks/Page/Page.jsx @@ -351,7 +351,7 @@ export const Page = ({ ].join(" ")} >
- {languages.map((language) => ( + {languages?.map((language) => (
Date: Thu, 2 Nov 2023 15:27:24 +0200 Subject: [PATCH 073/153] Fix: imports --- src/backdrops/CodeVerification/CodeVerification.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backdrops/CodeVerification/CodeVerification.jsx b/src/backdrops/CodeVerification/CodeVerification.jsx index cf8d2f4d..0dd6d5e7 100644 --- a/src/backdrops/CodeVerification/CodeVerification.jsx +++ b/src/backdrops/CodeVerification/CodeVerification.jsx @@ -2,7 +2,6 @@ import React, { useState } from "react"; import { useMutation, useQueryClient } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; import { useNavigate } from "react-router-dom"; -import { PinInput } from "@USupport-components-library/src"; import { useError } from "#hooks"; @@ -11,6 +10,7 @@ import { ButtonWithIcon, Button, Error, + PinInput, } from "@USupport-components-library/src"; import { userSvc } from "@USupport-components-library/services"; From 33faf992e1b8a8699530a59ce43ed381521d017f Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 2 Nov 2023 15:27:29 +0200 Subject: [PATCH 074/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 2aedddfa..1bf9f783 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 2aedddfa15cea4ff4f7e85969558cb3e7b82d8e3 +Subproject commit 1bf9f7838e9730b1beda35b44d35abf20ceb5a2e From 11e72090f4144cc31f7e00e6c2c74775f3032de5 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Wed, 8 Nov 2023 12:34:06 +0200 Subject: [PATCH 075/153] Fix: duplications when displaying previous consultation messages --- src/pages/Consultation/Consultation.jsx | 87 +++++++++++++++---------- 1 file changed, 52 insertions(+), 35 deletions(-) diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index adfa5f13..80f116e7 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -127,20 +127,25 @@ export const Consultation = () => { return joinMessages[0].content === "provider_joined"; }; - const chatDataQuery = useGetChatData(consultation?.chatId, (data) => { + const onGetChatDataSuccess = (data) => { setIsProviderInSession(checkHasProviderJoined(data.messages)); setMessages((prev) => ({ ...prev, currentSession: data.messages, })); - }); + }; + + const chatDataQuery = useGetChatData( + consultation?.chatId, + onGetChatDataSuccess + ); const clientId = chatDataQuery.data?.clientDetailId; const providerId = chatDataQuery.data?.providerDetailId; const allChatHistoryQuery = useGetAllChatHistoryData( providerId, clientId, - true + chatDataQuery.isFetched ); const [areMessagesHidden, setAreMessagesHidden] = useState(true); @@ -152,50 +157,29 @@ export const Consultation = () => { ); }, [messages]); - useEffect(() => { - const endTime = new Date(consultation.timestamp + ONE_HOUR); - let isTenMinAlertShown, - isFiveMinAlertShown = false; - - const interval = setInterval(() => { - const now = new Date(); - const timeDifferenceInMinutes = Math.floor((endTime - now) / (1000 * 60)); - - if (timeDifferenceInMinutes <= 10 && !isTenMinAlertShown) { - toast(t("consultation_end_reminder", { minutes: 10 }), { - autoClose: false, - type: "info", - }); - isTenMinAlertShown = true; - } - if (timeDifferenceInMinutes <= 5 && !isFiveMinAlertShown) { - toast(t("consultation_end_reminder", { minutes: 5 }), { - autoClose: false, - type: "info", - }); - isFiveMinAlertShown; - clearInterval(interval); - } - }, 20000); - - return () => { - clearInterval(interval); - }; - }, []); + // End of seession alerts + useSessionEndReminder(consultation.timestamp, t); useEffect(() => { if ( allChatHistoryQuery.data?.messages && + chatDataQuery.data?.messages && !messages.previousSessions.length ) { setMessages((prev) => { + const currentMessagesTimes = chatDataQuery.data.messages.map( + (x) => x.time + ); + const previousFiltered = allChatHistoryQuery.data.messages + .flat() + .filter((x) => !currentMessagesTimes.includes(x.time)); return { ...prev, - previousSessions: allChatHistoryQuery.data.messages, + previousSessions: previousFiltered, }; }); } - }, [allChatHistoryQuery.data]); + }, [allChatHistoryQuery.data, chatDataQuery.data]); // TODO: Send a consultation add services request only when the provider leaves the consultation useEffect(() => { @@ -763,3 +747,36 @@ const OptionsContainer = ({
); }; + +const useSessionEndReminder = (timestamp, t) => { + useEffect(() => { + const endTime = new Date(timestamp + ONE_HOUR); + let isTenMinAlertShown, + isFiveMinAlertShown = false; + + const interval = setInterval(() => { + const now = new Date(); + const timeDifferenceInMinutes = Math.floor((endTime - now) / (1000 * 60)); + + if (timeDifferenceInMinutes <= 10 && !isTenMinAlertShown) { + toast(t("consultation_end_reminder", { minutes: 10 }), { + autoClose: false, + type: "info", + }); + isTenMinAlertShown = true; + } + if (timeDifferenceInMinutes <= 5 && !isFiveMinAlertShown) { + toast(t("consultation_end_reminder", { minutes: 5 }), { + autoClose: false, + type: "info", + }); + isFiveMinAlertShown; + clearInterval(interval); + } + }, 20000); + + return () => { + clearInterval(interval); + }; + }, []); +}; From b0ee9bf64c516e5b5e907d42d49591f0a61f177c Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Thu, 9 Nov 2023 10:27:53 +0200 Subject: [PATCH 076/153] Fix: subheading misalignment of text in page component --- src/blocks/Page/page.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/blocks/Page/page.scss b/src/blocks/Page/page.scss index c821b3b8..c1513f3d 100644 --- a/src/blocks/Page/page.scss +++ b/src/blocks/Page/page.scss @@ -176,10 +176,12 @@ @media screen and (min-width: $screen-md) { padding-left: calc($spacing_2_6 + $spacing_8_0); + padding-right: calc($spacing_2_6 + $spacing_8_0); } @media screen and (min-width: $screen-lg) { padding-left: calc($spacing_23_0 + $spacing_5_6); + padding-right: calc($spacing_23_0 + $spacing_5_6); } } From 2100f19e0e681947d1632152339044b6d765fbfe Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 9 Nov 2023 10:52:04 +0200 Subject: [PATCH 077/153] Fix: pass the translation function to the SendMessage component in the MessagesList --- src/pages/Consultation/Consultation.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/Consultation/Consultation.jsx b/src/pages/Consultation/Consultation.jsx index 1dcd09e7..bcddb991 100644 --- a/src/pages/Consultation/Consultation.jsx +++ b/src/pages/Consultation/Consultation.jsx @@ -705,6 +705,7 @@ const MessageList = ({ {showMessages && renderAllMessages()}
Date: Thu, 9 Nov 2023 10:52:43 +0200 Subject: [PATCH 078/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 2aedddfa..51db4446 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 2aedddfa15cea4ff4f7e85969558cb3e7b82d8e3 +Subproject commit 51db444604176d1ad0d8cb9435ca13e90c55691c From 8b65ed34b718d4560a531d7a5de59206ee275c10 Mon Sep 17 00:00:00 2001 From: Georgi 7DIGIT Date: Thu, 9 Nov 2023 11:05:00 +0200 Subject: [PATCH 079/153] Refactor: git submodule --- USupport-components-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/USupport-components-library b/USupport-components-library index 1bf9f783..51db4446 160000 --- a/USupport-components-library +++ b/USupport-components-library @@ -1 +1 @@ -Subproject commit 1bf9f7838e9730b1beda35b44d35abf20ceb5a2e +Subproject commit 51db444604176d1ad0d8cb9435ca13e90c55691c From 8773194d6d2e5ec40abc4df1b164e9dc55851496 Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Thu, 9 Nov 2023 11:22:58 +0200 Subject: [PATCH 080/153] Fix: Misaligned language text options --- src/blocks/Page/page.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/blocks/Page/page.scss b/src/blocks/Page/page.scss index c821b3b8..25a67ea1 100644 --- a/src/blocks/Page/page.scss +++ b/src/blocks/Page/page.scss @@ -102,6 +102,7 @@ max-height: 0; transition: max-height 0.4s ease-in-out; overflow-y: auto; + @include scrollbar-secondary; &--shown { max-height: 16rem; @@ -124,6 +125,7 @@ &__text { padding: 0.5rem 0; + text-align: left; &--selected { @include themify($themes, "color", "color_primary_20809e"); From ccbfe9cc68b20d50ae4a204ea4b95b0ff846395c Mon Sep 17 00:00:00 2001 From: "Georgi Ganchev @7DIGIT" Date: Thu, 9 Nov 2023 12:01:54 +0200 Subject: [PATCH 081/153] Refactor: RegisterPreview block layout on smaller devices --- .../RegisterPreview/RegisterPreview.jsx | 48 ++++++++++--------- .../RegisterPreview/register-preview.scss | 15 +++++- 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/blocks/RegisterPreview/RegisterPreview.jsx b/src/blocks/RegisterPreview/RegisterPreview.jsx index f1962646..4e126984 100644 --- a/src/blocks/RegisterPreview/RegisterPreview.jsx +++ b/src/blocks/RegisterPreview/RegisterPreview.jsx @@ -111,29 +111,31 @@ export const RegisterPreview = ({ handleLoginRedirection }) => { {renderCarouselItems()}
- - - - + setIsRegistrationModalOpen(false)} + handleRegisterRedirection={handleRegisterRedirection} /> - + + + +

{t("heading")}

+
+ +

{t("subheading")}

+
+ +