From b9ff3a1ab8895369b917c6ba083d879e74f54b6f Mon Sep 17 00:00:00 2001 From: gofnnp Date: Mon, 16 Oct 2023 18:18:33 +0400 Subject: [PATCH] fix: compatibility onboarding, payment method page text --- src/components/Compatibility/index.tsx | 11 ++++++----- src/components/NavbarFooter/index.tsx | 2 +- src/components/PaymentPage/index.tsx | 5 ++++- src/components/PriceItem/index.tsx | 2 -- src/components/PriceList/index.tsx | 1 - src/locales/dev.ts | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/Compatibility/index.tsx b/src/components/Compatibility/index.tsx index 702ef60..a110b52 100644 --- a/src/components/Compatibility/index.tsx +++ b/src/components/Compatibility/index.tsx @@ -31,8 +31,8 @@ function CompatibilityPage(): JSX.Element { const birthdate = useSelector(selectors.selectBirthdate); const onboardingCompatibility = useSelector( selectors.selectOnboardingCompatibility - ); - + ).isShown; + const [isDisabled, setIsDisabled] = useState(true); const [isDisabledName, setIsDisabledName] = useState(true); const [isDisabledSelfName, setIsDisabledSelfName] = useState(true); @@ -129,8 +129,6 @@ function CompatibilityPage(): JSX.Element { const { data } = useApiCall(loadData); const handleValidSelfName = (name: string) => { - console.log(name); - setIsDisabledSelfName(!name.length); setSelfName(name); checkAllDisabled(); @@ -158,7 +156,10 @@ function CompatibilityPage(): JSX.Element { setCompatCategory(parseInt(event.target.value)); }; - const scrollToElementOnboarding = (nextOnboarding: number, ref: HTMLElement | null) => { + const scrollToElementOnboarding = ( + nextOnboarding: number, + ref: HTMLElement | null + ) => { setCurrentOnboarding(nextOnboarding); ref?.scrollIntoView({ behavior: "smooth" }); }; diff --git a/src/components/NavbarFooter/index.tsx b/src/components/NavbarFooter/index.tsx index 860753d..95c65dc 100644 --- a/src/components/NavbarFooter/index.tsx +++ b/src/components/NavbarFooter/index.tsx @@ -31,7 +31,7 @@ function NavbarFooter({ items }: INavbarHomeProps): JSX.Element { useState(!onboardingConfigNavbarFooter?.isShown); const [selectedOnboarding, setSelectedOnboarding] = useState(3); const [rerender, setRerender] = useState(false); - console.log(rerender); + rerender const buttonsRef = useRef([] as HTMLDivElement[]); diff --git a/src/components/PaymentPage/index.tsx b/src/components/PaymentPage/index.tsx index baa8f6f..d754abc 100644 --- a/src/components/PaymentPage/index.tsx +++ b/src/components/PaymentPage/index.tsx @@ -32,6 +32,9 @@ function PaymentPage(): JSX.Element { const isLoading = applePay === null const isApplePayAvailable = import.meta.env.PROD && applePay?.canMakePayments() const email = useSelector(selectors.selectEmail) + const isDiscount = useSelector(selectors.selectIsDiscount) + const selectedPrice = useSelector(selectors.selectSelectedPrice) + const price = isDiscount ? (Math.round(selectedPrice || 0) / 2).toFixed(2) : selectedPrice const onSuccess = useCallback(() => { dispatch(actions.status.update('subscribed')) navigate(routes.client.wallpaper()) @@ -61,7 +64,7 @@ function PaymentPage(): JSX.Element {
{t('or').toUpperCase()}
setOpenCardModal(true)} />

- {t('will_be_charged', { strongText: {t('trial_price')} })} + {t('will_be_charged', { strongText: {t('trial_price', { price: price })} })}

{ const isPopular = id === 3; const isActive = active; diff --git a/src/components/PriceList/index.tsx b/src/components/PriceList/index.tsx index c9ef19c..fd51fb6 100644 --- a/src/components/PriceList/index.tsx +++ b/src/components/PriceList/index.tsx @@ -38,7 +38,6 @@ function PriceList({click}: PriceListProps): JSX.Element { const [activePriceItem, setActivePriceItem] = useState(null) const priceItemClick = (id: number) => { - console.log(id); setActivePriceItem(id) const activePriceItem = prices.find((item) => item.id === Number(id)) if (activePriceItem) { diff --git a/src/locales/dev.ts b/src/locales/dev.ts index 91b0dc0..ed18e08 100644 --- a/src/locales/dev.ts +++ b/src/locales/dev.ts @@ -43,7 +43,7 @@ export default { card: "Credit / Debit Card", contact_us: "Contact us", will_be_charged: "You will be charged only . We'll email your a reminder before your trial period ends.", - trial_price: "$1 for your 7-day trial", + trial_price: "$ for your 7-day trial", start_trial: "Start 7-Day Trial", analysis_background: "Analysis of personal background", error_processing: "An error processing your order.",