From b19917b556cf0f9905d0f51122010074734f287d Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Fri, 15 Mar 2024 12:15:08 +0800 Subject: [PATCH 1/4] chore: fixed deriv prime minified error --- crowdin/messages.json | 2 +- .../deriv-prime/get-in-touch/contact-form.tsx | 18 +++-- .../deriv-prime/meet-us-there/data.tsx | 3 + .../deriv-prime/meet-us-there/index.tsx | 67 +++++++++---------- .../deriv-prime/meet-us-there/types.ts | 3 +- 5 files changed, 50 insertions(+), 43 deletions(-) diff --git a/crowdin/messages.json b/crowdin/messages.json index 51967b84c4c..3ae0f1c67c1 100644 --- a/crowdin/messages.json +++ b/crowdin/messages.json @@ -83,7 +83,6 @@ "71535160": "Calculate the overnight fees for holding any open positions. The fees can be positive or negative depending on your swap rate.", "71630191": "Do not share your account information and other personal details with anyone via Telegram.", "71650838": "Speak simply and plainly, and not hide behind ambiguity", - "71755468": "In a journey spanning more than 23 years, we have grown to over 2.5 million customers worldwide. But our mission has remained the same:", "73765361": "Chief Audit Executive", "74138086": "Take control of your trades on Deriv MT5", "74593350": "3. Select Real account or Demo account.", @@ -4726,6 +4725,7 @@ "-1520902282": "No credit card needed", "-2022759357": "Make trading accessible to anyone, anywhere", "-77779780": "From inception, our goal was to break free of the high commissions and clunky products offered by traditional brokers. Also, we aim to deliver a first-class experience to digitally inclined traders, regardless of the size of their accounts.", + "-1321496264": "In a journey spanning 25 years, we have grown to over 2.5 million customers worldwide. But our mission has remained the same:", "-554746075": "Integrity", "-1917169640": "We serve our customers with fairness and transparency. We settle all contracts by the book and speak plainly and truthfully.", "-1679427554": "Customer focus", diff --git a/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx b/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx index 33dfb97cd04..1c2a9c325eb 100644 --- a/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx +++ b/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx @@ -1,4 +1,4 @@ -import React, { useMemo } from 'react' +import React, { useEffect, useMemo, useState } from 'react' import { get_in_touch_form_container, get_in_touch_form } from './get-in-touch.module.scss' import Flex from 'features/components/atoms/flex-box' import Typography from 'features/components/atoms/typography' @@ -11,6 +11,10 @@ import { TTypographyColor } from 'features/types' const ContactFormGetInTouch = () => { const { contact_us_form, on_submit, form_state } = useContactForm() + const [text_values, setTextValues] = useState<{ color: TTypographyColor; text: TString }>({ + color: 'gray-shade', + text: '_t_By clicking "Submit", you give your consent to be contacted by Deriv by email and telephone for marketing purposes._t_', + }) const { register, @@ -20,7 +24,7 @@ const ContactFormGetInTouch = () => { handleSubmit, } = contact_us_form - const get_form_bottom_message = useMemo(() => { + useEffect(() => { const { is_submission_fail, is_submitted } = form_state let text_values: { color: TTypographyColor; text: TString } if (!is_submission_fail && !is_submitted) @@ -38,7 +42,7 @@ const ContactFormGetInTouch = () => { color: 'brand', text: '_t_Form submission error. Please submit the form again._t_', } - return text_values + setTextValues(text_values) }, [form_state]) return ( @@ -140,17 +144,17 @@ const ContactFormGetInTouch = () => { - + - + diff --git a/src/features/pages/partners/deriv-prime/meet-us-there/data.tsx b/src/features/pages/partners/deriv-prime/meet-us-there/data.tsx index e70d64f917e..d14bfba8fe3 100644 --- a/src/features/pages/partners/deriv-prime/meet-us-there/data.tsx +++ b/src/features/pages/partners/deriv-prime/meet-us-there/data.tsx @@ -6,6 +6,7 @@ import { localize } from 'components/localization' export const expo_cards: ExpoCardTypes[] = [ { + id: 1, title: 'iFX Expo Latam', date: '_t_9-11 April 2024_t_', image: ( @@ -20,6 +21,7 @@ export const expo_cards: ExpoCardTypes[] = [ link: 'https://latam2024.ifxexpo.com/', }, { + id: 2, title: 'iFX Expo Cyprus', date: '_t_18-20 June 2024_t_', image: ( @@ -34,6 +36,7 @@ export const expo_cards: ExpoCardTypes[] = [ link: 'https://ifxexpo.com/', }, { + id: 3, title: 'Forex Expo Dubai', date: '_t_7-8 October 2024_t_', image: ( diff --git a/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx b/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx index 10744e677f2..2a009220a66 100644 --- a/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx +++ b/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx @@ -35,46 +35,45 @@ const MeetUsThere = () => { > {expo_cards.map((card) => { return ( - <> - + + {card.image} - {card.image} - - - - - - - - + + + + + - - + + ) })} diff --git a/src/features/pages/partners/deriv-prime/meet-us-there/types.ts b/src/features/pages/partners/deriv-prime/meet-us-there/types.ts index fb7edfbe7f4..e7870097c4c 100644 --- a/src/features/pages/partners/deriv-prime/meet-us-there/types.ts +++ b/src/features/pages/partners/deriv-prime/meet-us-there/types.ts @@ -2,7 +2,8 @@ import { ReactElement } from 'react' import { TString } from 'types/generics' export type ExpoCardTypes = { - title?: TString + id: number + title?: string image?: ReactElement date?: TString link?: string From b1b296c9eb3be06086b6978191e322393b0e3524 Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Fri, 15 Mar 2024 12:20:21 +0800 Subject: [PATCH 2/4] chore: fixed type error --- src/features/pages/partners/deriv-prime/meet-us-there/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx b/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx index 2a009220a66..b8008d01b8e 100644 --- a/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx +++ b/src/features/pages/partners/deriv-prime/meet-us-there/index.tsx @@ -66,7 +66,7 @@ const MeetUsThere = () => { mb={'4x'} font_family="UBUNTU" > - + {card.title} From da0b7d2ccdb46ad855b2643e88bdf6e6ef51f88d Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Fri, 15 Mar 2024 13:13:35 +0800 Subject: [PATCH 3/4] chore: test --- src/features/pages/partners/deriv-prime/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/pages/partners/deriv-prime/index.tsx b/src/features/pages/partners/deriv-prime/index.tsx index f7bb09629e6..10230b2063e 100644 --- a/src/features/pages/partners/deriv-prime/index.tsx +++ b/src/features/pages/partners/deriv-prime/index.tsx @@ -1,7 +1,7 @@ import React from 'react' import Layout from 'features/components/templates/layout' import CommercialPlan from './commercial-plan' -import GetInTouchBanner from './get-in-touch' +// import GetInTouchBanner from './get-in-touch' import BrowseOurFaq from './browse-our-faq' import Potential from './potential' import WhyDerivPrime from './why-deriv-prime' @@ -24,7 +24,7 @@ const DerivPrime = () => { - + {/* */} From 3120ae3cdc3f5dd87cfad3e2443e03d6c18b0deb Mon Sep 17 00:00:00 2001 From: hasan-deriv Date: Fri, 15 Mar 2024 14:27:53 +0800 Subject: [PATCH 4/4] chore: fixed contact us error --- .../pages/partners/deriv-prime/get-in-touch/contact-form.tsx | 4 ++++ src/features/pages/partners/deriv-prime/index.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx b/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx index 1c2a9c325eb..6b07d8a6776 100644 --- a/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx +++ b/src/features/pages/partners/deriv-prime/get-in-touch/contact-form.tsx @@ -8,8 +8,10 @@ import Input from 'features/components/atoms/input' import { TString } from 'types/generics' import useContactForm from 'features/hooks/use-contact-form' import { TTypographyColor } from 'features/types' +import { usePageLoaded } from 'components/hooks/use-page-loaded' const ContactFormGetInTouch = () => { + const [is_mounted] = usePageLoaded() const { contact_us_form, on_submit, form_state } = useContactForm() const [text_values, setTextValues] = useState<{ color: TTypographyColor; text: TString }>({ color: 'gray-shade', @@ -45,6 +47,8 @@ const ContactFormGetInTouch = () => { setTextValues(text_values) }, [form_state]) + if (!is_mounted) return null + return ( { - {/* */} +