Skip to content

Commit

Permalink
[1917] [ES-1166] Fixed two popups overlap issue in slot checking scre…
Browse files Browse the repository at this point in the history
…en and minor theme changes and fixes. (#422)

Signed-off-by: GurukiranP <[email protected]>
  • Loading branch information
gk-4VII authored Nov 11, 2024
1 parent a1e8be4 commit 817eed7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import {
} from "~typings/types";

import {
criticalErrorSelector,
EkycVerificationStep,
kycProviderSelector,
setCriticalErrorSelector,
setStepSelector,
setSlotIdSelector,
setStepSelector,
useEkycVerificationStore,
} from "../useEkycVerificationStore";
import { SlotCheckingLoading } from "./components/SlotCheckingLoading";
Expand All @@ -23,17 +24,19 @@ export const SlotChecking = ({ settings }: DefaultEkyVerificationProp) => {
retryDelay: settings.configs["slot.request.delay"],
});

const { kycProvider, setStep, setCriticalError, setSlotId } = useEkycVerificationStore(
useCallback(
(state) => ({
kycProvider: kycProviderSelector(state),
setStep: setStepSelector(state),
setCriticalError: setCriticalErrorSelector(state),
setSlotId: setSlotIdSelector(state)
}),
[]
)
);
const { kycProvider, setStep, setCriticalError, setSlotId, criticalError } =
useEkycVerificationStore(
useCallback(
(state) => ({
kycProvider: kycProviderSelector(state),
setStep: setStepSelector(state),
setCriticalError: setCriticalErrorSelector(state),
setSlotId: setSlotIdSelector(state),
criticalError: criticalErrorSelector(state),
}),
[]
)
);

useEffect(() => {
if (!kycProvider) throw Error("KycProvider should not be null");
Expand All @@ -49,15 +52,9 @@ export const SlotChecking = ({ settings }: DefaultEkyVerificationProp) => {
slotAvailabilityMutation.mutate(slotAvailabilityRequestDto, {
onSuccess: ({ response, errors }) => {
if (errors.length > 0) {
switch (errors[0].errorCode) {
case "invalid_transaction":
setCriticalError(errors[0]);
break;
case "slot_unavailable":
break;
}
setCriticalError(errors[0]);
} else {
setSlotId(response.slotId)
setSlotId(response.slotId);
setStep(EkycVerificationStep.VerificationScreen);
}
},
Expand All @@ -66,7 +63,11 @@ export const SlotChecking = ({ settings }: DefaultEkyVerificationProp) => {

if (slotAvailabilityMutation.isPending) {
return <SlotCheckingLoading />;
} else if (
slotAvailabilityMutation.isSuccess &&
criticalError?.errorCode === "slot_not_available"
) {
return <SlotUnavailableAlert />;
}

return <SlotUnavailableAlert />;
return <></>;
};
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const VerificationSteps = ({
<LoadingIndicator
message="please_wait"
msgParam="Loading. Please wait....."
iconClass="fill-[#EB6F2D]"
iconClass="loading-indicator"
divClass="align-loading-center"
/>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const AccountSetupStatus = ({
<Step>
<StepContent className="py-16">
<div className="flex flex-col items-center gap-8">
<Icons.loader className="h-20 w-20 animate-spin text-orange-500" />
<Icons.loader className="h-20 w-20 animate-spin text-primary" />
<div>
<h1 className="text-center text-2xl font-semibold">
{t("setup_progress")}
Expand Down
1 change: 1 addition & 0 deletions signup-ui/src/typings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const SlotAvailabilityPossibleErrors = [
"invalid_request",
"reset_pwd_failed",
"slot_unavailable",
"slot_not_available",
] as const;

export type SlotAvailabilityErrors =
Expand Down

0 comments on commit 817eed7

Please sign in to comment.