forked from binary-com/deriv-com
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
75 changed files
with
6,734 additions
and
5,851 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
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,42 @@ | ||
import React, { ReactNode } from 'react' | ||
import MainRowNavigation from '../../templates/navigation/main-nav' | ||
import Layout from '../quill-layout' | ||
import MainFooter from 'features/components/templates/footer' | ||
import { TString } from 'types/generics' | ||
import OptionsTopTab from 'features/components/organisms/options-top-tab' | ||
import WhatAreDigitalOptions from 'features/components/organisms/what-are-digital-options/accumulator' | ||
|
||
interface OptionsLayoutProps { | ||
children?: ReactNode | ||
heading: TString | ||
description: TString | ||
is_coming_soon?: boolean | ||
has_content_block?: boolean | ||
} | ||
|
||
const OptionsLayout = ({ | ||
heading, | ||
description, | ||
children, | ||
is_coming_soon = false, | ||
has_content_block = false, | ||
}: OptionsLayoutProps) => { | ||
return ( | ||
<> | ||
<Layout> | ||
<MainRowNavigation /> | ||
<OptionsTopTab /> | ||
<WhatAreDigitalOptions | ||
heading={heading} | ||
description={description} | ||
is_coming_soon={is_coming_soon} | ||
has_content_block={has_content_block} | ||
/> | ||
{children} | ||
<MainFooter /> | ||
</Layout> | ||
</> | ||
) | ||
} | ||
|
||
export default OptionsLayout |
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
Oops, something went wrong.