Skip to content

Commit

Permalink
feat: changed the redirection of traders hub
Browse files Browse the repository at this point in the history
  • Loading branch information
aswathy-deriv committed Nov 6, 2023
1 parent 6e8209b commit 983b6b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import useHandleSignup from 'components/hooks/use-handle-signup'
import usePpc from 'features/hooks/use-ppc'
import LanguageSwitcher from 'features/components/molecules/language-switcher'
import Flex from 'features/components/atoms/flex-box'
import { handleGetTrading, handleRedirectToTradersHub } from 'components/custom/utils'
import { getLocationPathname } from 'common/utility'
import { handleRedirectToTradersHub } from 'components/custom/utils'

const MainNavButtons = () => {
const [is_logged_in] = useAuthCheck()
const { is_ppc_redirect } = usePpc()
const is_ctrader = getLocationPathname().includes('deriv-ctrader')

const handleLogin = useHandleLogin()
const handleSignup = useHandleSignup(is_ppc_redirect)
Expand All @@ -27,10 +25,7 @@ const MainNavButtons = () => {
gap="8x"
>
{is_logged_in ? (
<Button.Primary
onClick={is_ctrader ? handleRedirectToTradersHub : handleGetTrading}
outlined
>
<Button.Primary onClick={handleRedirectToTradersHub} outlined>
<Localize translate_text="_t_Get trading_t_" />
</Button.Primary>
) : (
Expand Down
4 changes: 2 additions & 2 deletions src/features/pages/home/hero/content/hero-cta.button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Localize } from 'components/localization'
import useAuthCheck from 'components/hooks/use-auth-check'
import Button from 'features/components/atoms/button'
import useHandleSignup from 'components/hooks/use-handle-signup'
import { handleGetTrading } from 'components/custom/utils'
import { handleRedirectToTradersHub } from 'components/custom/utils'

const HeroCtaButton = () => {
const [is_logged_in] = useAuthCheck()
Expand All @@ -15,7 +15,7 @@ const HeroCtaButton = () => {
<Button.Primary
className={hero_cta}
type={'button'}
onClick={handleGetTrading}
onClick={handleRedirectToTradersHub}
id="dm-hero-signup"
aria-label="Get trading"
hero
Expand Down

0 comments on commit 983b6b9

Please sign in to comment.