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

Agrim/DPROD-4188/warningdisclaimerrow #7814

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 } from '@deriv/quill-design'
import { qtJoin, Text } from '@deriv/quill-design'
import {
EuFooterNavData,
RowFooterNavData,
Expand All @@ -19,6 +19,7 @@ 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 @@ -60,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 @@ -77,14 +78,21 @@ export const MainFooter = () => {

return (
<Footer.FooterBlock
warningText={warn_text}
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>
)}
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
Loading