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

Commit

Permalink
Mitra/DERC-2411/hide app gallery and app store if it is not supported (
Browse files Browse the repository at this point in the history
…#6491)

* fix: 🐛 hide app gallery and app store if it is not supported in footer

* fix: 🐛 add both condition as the countries are different

* fix: 🚚 using links from const file

* build: 🐛 fix wrong country filters
  • Loading branch information
mitra-deriv authored Jan 11, 2024
1 parent 331c0a3 commit a20e4b4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
5 changes: 3 additions & 2 deletions src/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ export const derivx_ios_url = 'https://apps.apple.com/us/app/deriv-x/id156333750
export const derivx_android_url = 'https://play.google.com/store/apps/details?id=com.deriv.dx'
export const derivx_huawei_url = 'https://appgallery.cloud.huawei.com/ag/n/app/C104633219'
export const deriv_go_playstore_url = 'https://play.google.com/store/apps/details?id=com.deriv.app'
export const deriv_go_huaweiappgallery_url = 'https://appgallery.huawei.com/#/app/C103801913'
export const deriv_go_ios_url = 'https://apps.apple.com/my/app/deriv-go/id1550561298'
export const deriv_go_huaweiappgallery_url = 'https://appgallery.huawei.com/app/C103801913'
export const deriv_go_ios_url =
'https://apps.apple.com/my/app/deriv-go-online-trading-app/id1550561298'
export const dmt5_web_browser_url =
'https://metatraderweb.app/trade?servers=Deriv-Server-02&trade_server=Deriv-Server-02&login=100648979'
export const deriv_mt5_app_url =
Expand Down
7 changes: 1 addition & 6 deletions src/common/country-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ export const not_avalable_appgallery_and_ios_countries = [
'fk',
'tf',
'gg',
'cf',
'im',
'je',
'ki',
Expand All @@ -473,13 +472,9 @@ export const not_avalable_appgallery_and_ios_countries = [
'aq',
'hm',
'um',
'bi',
'et',
'gq',
'ls',
]

export const not_available_iOS_countries = ['ad', 'ck', 'ps']
export const not_available_iOS_countries = ['ad', 'ck', 'ps', 'et', 'bi', 'cf', 'gq', 'ls']

export const not_available_ctrader_countries = [
'as',
Expand Down
66 changes: 37 additions & 29 deletions src/features/components/templates/footer/download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,39 @@ import clsx from 'clsx'
import { StaticImage } from 'gatsby-plugin-image'
import { CustomLink } from '@deriv-com/components'
import { localize } from 'components/localization'
import useRegion from 'components/hooks/use-region'
import {
deriv_go_huaweiappgallery_url,
deriv_go_ios_url,
deriv_go_playstore_url,
} from 'common/constants'

const sharedClasses =
'flex items-center justify-center gap-gap-md p-general-sm rounded-[4px] border-solid border-xs border-opacity-black-100'

const DownloadBadges = () => {
const { is_appgallery_supported, is_ios_supported, is_appgallery_and_ios_supported } =
useRegion()
return (
<div className="flex flex-col gap-gap-md max-lg:flex-1">
{is_appgallery_supported && is_appgallery_and_ios_supported && (
<CustomLink
href={deriv_go_huaweiappgallery_url}
target="_blank"
className={clsx(sharedClasses, 'order-last')}
>
<LabelPairedHuaweiAppGalleryLgIcon fill="#000000b8" />
<StaticImage
src="../../../../images/common/migration/footer/explore-appgallery.png"
alt={localize('_t_explore it on appgallery_t_')}
formats={['webp', 'auto']}
width={90}
placeholder="none"
/>
</CustomLink>
)}
<CustomLink
href="https://appgallery.huawei.com/app/C103801913"
target="_blank"
className={clsx(sharedClasses, 'order-last')}
>
<LabelPairedHuaweiAppGalleryLgIcon fill="#000000b8" />
<StaticImage
src="../../../../images/common/migration/footer/explore-appgallery.png"
alt={localize('_t_explore it on appgallery_t_')}
formats={['webp', 'auto']}
width={90}
placeholder="none"
/>
</CustomLink>
<CustomLink
href="https://play.google.com/store/apps/details?id=com.deriv.app"
href={deriv_go_playstore_url}
target="_blank"
className={clsx(sharedClasses)}
>
Expand All @@ -44,20 +54,18 @@ const DownloadBadges = () => {
placeholder="none"
/>
</CustomLink>
<CustomLink
href="https://apps.apple.com/my/app/deriv-go-online-trading-app/id1550561298"
target="_blank"
className={clsx(sharedClasses)}
>
<LabelPairedAppleLgIcon fill="#000000b8" />
<StaticImage
src="../../../../images/common/migration/footer/download-appstore.png"
alt={localize('_t_download on the app store_t_')}
formats={['webp', 'auto']}
width={90}
placeholder="none"
/>
</CustomLink>
{is_ios_supported && is_appgallery_and_ios_supported && (
<CustomLink href={deriv_go_ios_url} target="_blank" className={clsx(sharedClasses)}>
<LabelPairedAppleLgIcon fill="#000000b8" />
<StaticImage
src="../../../../images/common/migration/footer/download-appstore.png"
alt={localize('_t_download on the app store_t_')}
formats={['webp', 'auto']}
width={90}
placeholder="none"
/>
</CustomLink>
)}
</div>
)
}
Expand Down

1 comment on commit a20e4b4

@vercel
Copy link

@vercel vercel bot commented on a20e4b4 Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com.binary.sx
deriv-com-git-master.binary.sx

Please sign in to comment.