This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: digital options * fix: breadcrumbs
- Loading branch information
1 parent
8094982
commit 3aff8bd
Showing
5 changed files
with
118 additions
and
93 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
src/features/components/organisms/what-are-digital-options/accumulator/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import React from 'react' | ||
import { Hero } from '@deriv-com/blocks' | ||
// eslint-disable-next-line import/no-unresolved | ||
import { v4 as uuidv4 } from 'uuid' | ||
import { Text, Heading, Button } from '@deriv/quill-design' | ||
import { Localize } from 'components/localization' | ||
import { TString } from 'types/generics' | ||
import Label from 'features/components/atoms/label' | ||
import useScrollToElement from 'features/hooks/use-scroll-to-element' | ||
import TradersHubCtaButton from 'features/components/molecules/traders-hub-cta-button' | ||
import { useFloatingCtaContext } from 'features/contexts/floating-cta/cta.provider' | ||
import FloatingCta from 'features/pages/home/hero/floating-cta' | ||
|
||
interface WhatAreDigitalOptionsProps { | ||
heading: TString | ||
description: TString | ||
is_coming_soon: boolean | ||
has_content_block: boolean | ||
} | ||
|
||
const WhatAreDigitalOptions = ({ | ||
heading, | ||
description, | ||
is_coming_soon, | ||
has_content_block, | ||
}: WhatAreDigitalOptionsProps) => { | ||
const clickToScrollHandler = useScrollToElement('faqs', -100) | ||
const uniq = `navbuttons_uniq_class_${uuidv4()}` | ||
const { ctaBottom, visibilityPercentage, entryRef } = useFloatingCtaContext() | ||
|
||
return ( | ||
<> | ||
<Hero.ContentLess | ||
className="px-800 md:px-1200 lg:px-gap-none" | ||
description={ | ||
<Text className="leading-6"> | ||
<Localize translate_text={description} /> | ||
</Text> | ||
} | ||
title={ | ||
<Heading> | ||
<Localize translate_text={heading} /> | ||
</Heading> | ||
} | ||
> | ||
{is_coming_soon && ( | ||
<Label text="_t_Available on Demo accounts only_t_" bgcolor="blue" /> | ||
)} | ||
{has_content_block && ( | ||
<div | ||
className="flex flex-col items-center gap-400 md:!flex-row md:justify-center" | ||
id={uniq} | ||
> | ||
<TradersHubCtaButton | ||
ref={entryRef} | ||
className="w-full md:!w-auto" | ||
size="lg" | ||
/> | ||
<Button | ||
size="lg" | ||
variant="secondary" | ||
colorStyle="black" | ||
className="w-full md:!w-auto hover:!bg-solid-slate-50 sm:hover:!bg-opacity-black-100" | ||
onClick={clickToScrollHandler} | ||
> | ||
<Localize translate_text="_t_Read FAQs_t_" /> | ||
</Button> | ||
</div> | ||
)} | ||
</Hero.ContentLess> | ||
{has_content_block && ( | ||
<FloatingCta | ||
style={{ | ||
transform: `translateY(${visibilityPercentage - 100}%)`, | ||
bottom: `${-68 + ctaBottom}px`, | ||
}} | ||
/> | ||
)} | ||
</> | ||
) | ||
} | ||
|
||
export default WhatAreDigitalOptions |
82 changes: 21 additions & 61 deletions
82
src/features/components/organisms/what-are-digital-options/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters