Skip to content

Commit

Permalink
fix: fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
meenu-deriv committed Dec 11, 2023
2 parents 2d58731 + 303b5e2 commit a68ae43
Show file tree
Hide file tree
Showing 79 changed files with 6,949 additions and 6,206 deletions.
1 change: 0 additions & 1 deletion crowdin/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@
"888978991": "Each of these indices replicates the performance of top publicly traded companies in financial markets in Europe.",
"890646842": "White architecture building in Ipoh",
"890667695": "45%",
"891650376": "Tiktok",
"893607771": "Benefit from round-the-clock trading hours (Monday to Friday), high liquidity, low barriers to entry, a wide range of offerings, and opportunities to trade on world events.",
"893980632": "Have more questions? Check out the <0>FAQ section</0> on the MQL5 website.",
"894402947": "Fee per million",
Expand Down
8 changes: 8 additions & 0 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react'
import { createRoot } from 'react-dom/client'
import Cookies from 'js-cookie'
import { isMobile } from 'react-device-detect'
import { Analytics } from '@deriv/analytics'
Expand All @@ -21,6 +22,13 @@ import './static/css/global.css'

const is_browser = typeof window !== 'undefined'

export const replaceHydrateFunction = () => {
return (element, container) => {
const root = createRoot(container)
root.render(element)
}
}

const checkDomain = () => {
return eval(
decodeURIComponent(
Expand Down
37 changes: 12 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dependencies": {
"@artsy/fresnel": "^6.2.1",
"@builder.io/partytown": "^0.8.1",
"@deriv-com/blocks": "^0.35.0",
"@deriv-com/components": "^0.22.0",
"@deriv-com/blocks": "^0.42.0",
"@deriv-com/components": "^0.26.0",
"@deriv-com/hooks": "^0.9.0",
"@deriv-com/providers": "^0.8.0",
"@deriv-com/providers": "^0.10.0",
"@deriv/analytics": "^1.4.3",
"@deriv/deriv-api": "^1.0.13",
"@deriv/quill-design": "^1.2.6",
Expand Down Expand Up @@ -86,7 +86,6 @@
"@graphql-codegen/cli": "^2.16.5",
"@graphql-codegen/typescript": "^2.8.8",
"@graphql-codegen/typescript-operations": "^2.5.13",
"@lmdb/lmdb-darwin-arm64": "^2.8.5",
"@loadable/babel-plugin": "^5.16.1",
"@parcel/watcher": "^2.3.0",
"@storybook/addon-actions": "^6.4.9",
Expand Down
21 changes: 8 additions & 13 deletions src/components/elements/stepper-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,11 @@ type StepperViewTickProps = {
color?: string
}

type StepperType = {
id: number
data: {
title: TString
subtitle: TString
}
}

type StepperViewProps = {
items: StepperType[]
items: {
title?: TString
subtitle?: TString
}[]
} & Pick<StepperViewTickProps, 'pb' | 'pl'>

const handleLastBorder = (index, items) => {
Expand All @@ -103,14 +98,14 @@ const StepperView = ({ pb, items }: StepperViewProps) => {

return (
<>
{items.map(({ data: { title, subtitle } }, index) => (
<div key={title}>
{items.map((item, index) => (
<div key={item.title}>
<FlexWrapper is_border={handleLastBorder(index, items)} pb={pb}>
<ContentWrapper>
<Oval></Oval>
<CommonHeaderSection
title={title}
subtitle={subtitle}
title={item.title}
subtitle={item.subtitle}
title_font_size={is_mobile ? '18px ' : '24px'}
margin_subtitle="1.3rem 0 0 0"
subtitle_font_size="1.6rem"
Expand Down
9 changes: 2 additions & 7 deletions src/components/hooks/use-dynamic-visible-content.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState } from 'react'
import { useMemo } from 'react'
import { ObjectPropType, TSmartContent } from 'types/generics'

export interface IUseDynamicVisibleContent<T extends TSmartContent<unknown, object>> {
Expand Down Expand Up @@ -27,16 +27,11 @@ function useDynamicVisibleContent<T extends TSmartContent<unknown, object>>({
config,
content,
}: IUseDynamicVisibleContent<T>): T[] {
const [items, setItems] = useState<T[]>([])
const visible_items = useMemo(() => {
return filterDynamicVisibleContent(content, config)
}, [content, config])

useEffect(() => {
setItems(visible_items)
}, [visible_items.length])

return items
return visible_items
}

export default useDynamicVisibleContent
9 changes: 2 additions & 7 deletions src/components/hooks/use-visible-content.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useMemo, useState } from 'react'
import { useMemo } from 'react'
import { TSmartContent } from 'types/generics'

export interface IUseVisibleContent<T extends TSmartContent<unknown, object>> {
Expand All @@ -23,16 +23,11 @@ function useVisibleContent<T extends TSmartContent<unknown, object>>({
config,
content,
}: IUseVisibleContent<T>): T[] {
const [items, setItems] = useState<T[]>([])
const visible_items = useMemo(() => {
return filterVisibleContent(content, config)
}, [content, config])

useEffect(() => {
setItems(visible_items)
}, [visible_items.length])

return items
return visible_items
}

export default useVisibleContent
15 changes: 0 additions & 15 deletions src/features/components/atoms/suspense-helper/index.tsx

This file was deleted.

26 changes: 5 additions & 21 deletions src/features/components/molecules/layout-overlay/index.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
import React, { lazy, useEffect, useState } from 'react'
import React, { lazy, Suspense } from 'react'
import pMinDelay from 'p-min-delay'
import loadable from '@loadable/component'
import { overlay_container } from './layout-overlay.module.scss'
import CfdWarningBanner from './cfd-warning-banner'
import Flex from 'features/components/atoms/flex-box'
import { useIsRtl } from 'components/hooks/use-isrtl'
import { getLocationPathname, getLanguage } from 'common/utility'
import SuspenseHelper from 'features/components/atoms/suspense-helper'

const LiveChatButton = loadable(() => pMinDelay(import('./live-chat-button'), 5000))
const WhatsappButton = loadable(() => pMinDelay(import('./whats-app-button'), 5000))
const CookieBanner = lazy(() => import('./cookie-banner'))
const CfdWarningBanner = lazy(() => import('./cfd-warning-banner'))

const LayoutOverlay = () => {
const is_rtl = useIsRtl()
const [is_home, setIsHome] = useState(false)

const isHomePage = () => {
const currentPath = getLocationPathname()
const language = getLanguage()

return currentPath === `/${language}/` || currentPath === '/'
}
useEffect(() => {
setIsHome(isHomePage())
}, [])
return (
<Flex.Box
id="overlay-container"
Expand All @@ -42,20 +30,16 @@ const LayoutOverlay = () => {
align="end"
>
<Flex.Box justify={is_rtl ? 'end' : 'start'} basis="6-12" grow={'1'}>
<SuspenseHelper fallback={<></>}>
<Suspense fallback={<></>}>
<CookieBanner />
</SuspenseHelper>
</Suspense>
</Flex.Box>
<Flex.Box direction="col">
<LiveChatButton />
<WhatsappButton />
</Flex.Box>
</Flex.Box>
{is_home && (
<SuspenseHelper fallback={<></>}>
<CfdWarningBanner />
</SuspenseHelper>
)}
<CfdWarningBanner />
</Flex.Box>
)
}
Expand Down
35 changes: 1 addition & 34 deletions src/features/components/templates/footer/social-icons/data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Telegram from 'images/svg/footer/telegram_icon.svg'
import Tiktok from 'images/svg/footer/tiktok_icon.svg'
import Twitter from 'images/svg/footer/twitter_icon.svg'
import Youtube from 'images/svg/footer/youtube_icon.svg'
import Instagram from 'images/svg/footer/instagram_icon.svg'
Expand Down Expand Up @@ -319,22 +318,6 @@ export const socialMediaAccounts: SmartSocialAccount[] = [
},
{
id: 12,
data: {
url: {
type: 'non-company',
target: '_blank',
href: 'https://twitter.com/deriv_careers',
show_eu_modal: true,
},
icon: Twitter,
image_alt: '_t_Twitter_t_',
},
visibility: {
is_career_page: true,
},
},
{
id: 13,
data: {
url: {
type: 'non-company',
Expand All @@ -351,7 +334,7 @@ export const socialMediaAccounts: SmartSocialAccount[] = [
},
//temp removal of telegram : Start
// {
// id: 14,
// id: 13,
// data: {
// url: {
// type: 'non-company',
Expand All @@ -367,20 +350,4 @@ export const socialMediaAccounts: SmartSocialAccount[] = [
// },
// },
//temp removal of telegram : End
{
id: 15,
data: {
url: {
type: 'non-company',
target: '_blank',
href: 'https://tiktok.com/@derivcareers',
show_eu_modal: true,
},
icon: Tiktok,
image_alt: '_t_Tiktok_t_',
},
visibility: {
is_career_page: true,
},
},
]
Loading

0 comments on commit a68ae43

Please sign in to comment.