diff --git a/themes/gatsby-theme-deriv/src/pages/deriv-go/_banner.tsx b/themes/gatsby-theme-deriv/src/pages/deriv-go/_banner.tsx index dc4fef99367..751db95fcc9 100644 --- a/themes/gatsby-theme-deriv/src/pages/deriv-go/_banner.tsx +++ b/themes/gatsby-theme-deriv/src/pages/deriv-go/_banner.tsx @@ -1,30 +1,36 @@ import React from 'react' import styled from 'styled-components' import { StaticImage } from 'gatsby-plugin-image' -import {StyledHeaderForPlatform} from 'components/elements/common-header-section' +import { StyledHeaderForPlatform } from 'components/elements/common-header-section' import DerivGOLogo from 'images/svg/deriv-go/deriv-go-banner-logo.svg' import device from 'themes/device' import useHandleSignup from 'components/hooks/use-handle-signup' import useAuthCheck from 'components/hooks/use-auth-check' -import { handleGetTrading } from 'components/custom/utils' +import useBreakpoints from 'components/hooks/use-breakpoints' import Shape from 'components/custom/_hero-shape' import Button from 'components/custom/_button' import { useIsRtl } from 'components/hooks/use-isrtl' import { Container } from 'components/containers' import { breakpoints } from 'themes/theme.breakpoints' +import { mobileOSDetect } from 'common/os-detect' +import { + deriv_go_huaweiappgallery_url, + deriv_go_ios_url, + deriv_go_playstore_url, +} from 'common/constants' //TODO: (deriv-rebranding) to make the content section reusable . const ImageWrapper = styled.div` flex: 1; justify-content: center; - &.mobile-img{ + &.mobile-img { display: none; @media ${device.tablet} { display: flex; } } - &.tablet-img{ + &.tablet-img { display: none; @media ${breakpoints.sm} { display: flex; @@ -33,9 +39,9 @@ const ImageWrapper = styled.div` display: flex; } } - &.desktop-img{ + &.desktop-img { display: none; - @media screen and (min-width: 1201px ) { + @media screen and (min-width: 1201px) { display: flex; } } @@ -129,6 +135,36 @@ const DHero = () => { const handleSignup = useHandleSignup() const [is_logged_in] = useAuthCheck() const is_rtl = useIsRtl() + const { is_mobile } = useBreakpoints() + + const handleGetTradingDesktop = () => { + const targetComponent = document.getElementById('target-component') + if (targetComponent) { + targetComponent.scrollIntoView({ behavior: 'smooth', block: 'center' }) + } + } + + const handleGetTradingMobile = () => { + const os = mobileOSDetect() + + switch (os) { + case 'Android': + window.open('https://play.google.com/store/apps/details?id=com.deriv.app', '_blank') + window.open(deriv_go_playstore_url, '_blank') + break + case 'iOS': + window.open( + 'https://apps.apple.com/my/app/deriv-go-online-trading-app/id1550561298', + '_blank', + ) + window.open(deriv_go_ios_url, '_blank') + + break + case 'Huawei': + window.open('https://appgallery.huawei.com/app/C103801913', '_blank') + window.open(deriv_go_huaweiappgallery_url, '_blank') + } + } return ( @@ -138,7 +174,7 @@ const DHero = () => { { {is_logged_in ? ( { - - - + + + - + { imgStyle={{ objectFit: 'contain' }} /> - +