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

Mayuran/DPROD-3852/text align accumulator #7332

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
import React, { ComponentPropsWithRef, forwardRef } from 'react'
import { Button } from '@deriv/quill-design'
import { LabelPairedGrid2LgBoldIcon } from '@deriv/quill-icons'
import { LabelPairedGrid2MdBoldIcon, LabelPairedGrid2LgBoldIcon } from '@deriv/quill-icons'
import useAuthCheck from 'components/hooks/use-auth-check'
import useHandleSignup from 'components/hooks/use-handle-signup'
import { handleRedirectToTradersHub } from 'components/custom/utils'
import { Localize } from 'components/localization'

type TradersHubCtaButtonProps = ComponentPropsWithRef<typeof Button>
type TradersHubCtaButtonProps = ComponentPropsWithRef<typeof Button> & {
is_accumulator_mobile?: boolean
}

const TradersHubCtaButton = forwardRef<HTMLButtonElement, TradersHubCtaButtonProps>(
({ className, ...rest }, ref) => {
({ is_accumulator_mobile = false, className, ...rest }, ref) => {
const [is_logged_in] = useAuthCheck()
const handleSignup = useHandleSignup()
if (is_logged_in && is_accumulator_mobile) {
return (
<Button
ref={ref}
size="lg"
onClick={handleRedirectToTradersHub}
className={className}
{...rest}
>
<div className="relative">
<LabelPairedGrid2MdBoldIcon className="absolute top-100" fill="#ffffff" />
<Localize translate_text="_t_Trader's Hub_t_" />
</div>
</Button>
)
}

if (is_logged_in) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ const WhatAreDigitalOptions = ({
className="flex flex-col items-center gap-400 md:!flex-row md:justify-center"
id={uniq}
>
<TradersHubCtaButton
className="w-full hidden md:!flex md:!w-auto "
size="lg"
/>

<TradersHubCtaButton
ref={entryRef}
className="w-full md:!w-auto"
className="w-full flex md:hidden"
size="lg"
is_accumulator_mobile
/>
<Button
size="lg"
Expand Down
Loading