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

Commit

Permalink
chore: added region loading condition
Browse files Browse the repository at this point in the history
  • Loading branch information
fasihali-deriv committed Dec 22, 2023
1 parent 92d3a95 commit 0a231fa
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/features/pages/home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ import useLangSwitcher from 'features/components/molecules/language-switcher/use
import { useLangDirection } from 'components/hooks/use-lang-direction'
import { LocaleContext } from 'components/localization'
import GatsbySharedLink from 'features/components/quill/shared-link'
import useRegion from 'components/hooks/use-region'

const HomePage = () => {
useOpenLiveChat(true)
const { is_region_loading } = useRegion()
const lang_direction = useLangDirection()
const { locale } = React.useContext(LocaleContext)
const formatted_lang = locale.replace('_', '-')
Expand Down Expand Up @@ -55,22 +57,24 @@ const HomePage = () => {
onLangSelect={onLanguageChange}
activeLanguage={activeLang}
>
<Layout>
<MainRowNavigation />
<PageLayout>
<HomeHero />
<TrustpilotSection />
<StatSection />
<TwentyYearsStrong />
<LiveMarketSection />
<UserFriendlyPlatforms />
<TradeTypeSection />
<StartTradingSteps />
<FastPaymentSection />
<CTA />
<ROWFooter />
</PageLayout>
</Layout>
{!is_region_loading && (
<Layout>
<MainRowNavigation />
<PageLayout>
<HomeHero />
<TrustpilotSection />
<StatSection />
<TwentyYearsStrong />
<LiveMarketSection />
<UserFriendlyPlatforms />
<TradeTypeSection />
<StartTradingSteps />
<FastPaymentSection />
<CTA />
<ROWFooter />
</PageLayout>
</Layout>
)}
</LanguageProvider>
</ThemeProvider>
</SharedLinkProvider>
Expand Down

0 comments on commit 0a231fa

Please sign in to comment.