Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
fix: minified react error
Browse files Browse the repository at this point in the history
  • Loading branch information
agrim-deriv committed Jul 11, 2024
1 parent 0c57aac commit 32e0ce6
Showing 1 changed file with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from 'react'
import Cookies from 'js-cookie'
import { Footer } from '@deriv-com/blocks'
import { qtJoin, Text } from '@deriv/quill-design'
import { qtJoin } from '@deriv/quill-design'
import {
EuFooterNavData,
RowFooterNavData,
Expand All @@ -15,11 +15,11 @@ import {
import { DerivGoBanner } from './deriv-go-banner'
import { IIPAward } from './iip-award'
import { DescriptionContent } from './description'
import { usePageLoaded } from 'components/hooks/use-page-loaded'
import useThirdPartyFlags from 'components/hooks/use-third-party-flags'
import { getLocationPathname } from 'common/utility'
import useRegion from 'components/hooks/use-region'
import useBuildVariant from 'features/hooks/use-build-variant'
import { Localize } from 'components/localization'
// import { socialIconROW, socialIconEU, socialIconCareer } from './validate-social-icons-data'

const overrideWithLang = (buttons, lang) =>
Expand Down Expand Up @@ -61,10 +61,10 @@ export const MainFooter = () => {
const socialIconCareer = filterSocialIcons(career_social_media_icons, socialButtonsCareers)
const socialIconCPA = filterSocialIcons(cpa_social_media_icons, socialButtonsCPA)

const region_buttons = region === 'eu' ? socialIconEU : is_cpa_plan ? socialIconCPA : socialIconROW
const region_buttons = region === "eu" ? socialIconEU : is_cpa_plan ? socialIconCPA : socialIconROW
const buttons = is_career ? socialIconCareer : region_buttons
setSocialButtons(overrideWithLang(buttons, lang))
setWarnText(region !== 'eu' && !is_cpa_plan ? warnText : null)
setWarnText(region !== "eu" && !is_cpa_plan ? warnText : null)
}, [
lang,
region,
Expand All @@ -76,23 +76,20 @@ export const MainFooter = () => {
cpa_social_media_icons,
])

const[is_mounted] = usePageLoaded();

if(!is_mounted) return null

return (
<Footer.FooterBlock
warningText={warn_text && (
<Text className={`text-solid-slate-600 ${region !== 'eu' && !is_cpa_plan ? 'additional-warning-classname' : ''}`} size="sm">
<Localize
translate_text={warn_text}
values={{ loss_percent: 'some_value' }} // Replace 'some_value' with the appropriate value
/>
</Text>
)}
warningText={warn_text}
socialButtons={social_buttons}
banner={DerivGoBanner}
awards={IIPAward}
descriptionContent={DescriptionContent}
className={qtJoin((region === 'eu' || is_cpa_plan) && 'mb-[120px] lg:mb-[80px]')}
className={qtJoin((region === "eu" || is_cpa_plan) && 'mb-[120px] lg:mb-[80px]')}
>
<Footer.MainNavContent items={region === 'eu' ? EuFooterNavData : RowFooterNavData} cols='six' />
<Footer.MainNavContent items={region === "eu" ? EuFooterNavData : RowFooterNavData} cols="six" />
</Footer.FooterBlock>
)
}
Expand Down

0 comments on commit 32e0ce6

Please sign in to comment.