This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: hero block variant for homepage
- Loading branch information
1 parent
ef4ff80
commit 2daa2b9
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
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,37 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import HomeHero from '.'; | ||
import { Button } from '@deriv/quill-design'; | ||
|
||
const meta = { | ||
title: 'Blocks/Hero/Home-Hero', | ||
component: HomeHero, | ||
} satisfies Meta<typeof HomeHero>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: ( | ||
<> | ||
<span className="text-solid-mustard-800">Gold </span>spreads from | ||
<br></br> | ||
30 pips | ||
</> | ||
), | ||
backgroundImage: <></>, | ||
description: | ||
'Trade gold and other precious metals on one of the world’s favourite leveraged trading platforms.', | ||
ctaButton: <Button size="lg">Open demo account</Button>, | ||
awards: <>Awards here</>, | ||
heroImage: ( | ||
<div className="absolute inset-50 z-10 max-lg:right-[-15vh] max-sm:left-[6vw] max-sm:w-[54vh] sm:left-auto sm:z-auto"> | ||
<img | ||
className="h-full w-[400px]" | ||
src="https://placehold.co/600x400?text=Hello\nWorld" | ||
alt="Placeholder" | ||
/> | ||
</div> | ||
), | ||
}, | ||
}; |
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,48 @@ | ||
import { FluidContainer, Heading, Section, Text } from '@deriv/quill-design'; | ||
import clsx from 'clsx'; | ||
import { HomeHeroProps } from '..'; | ||
|
||
const HomeHero = ({ | ||
backgroundImage: BackgroundImage, | ||
title: Title, | ||
description, | ||
ctaButton: CTAButton, | ||
awards: Awards, | ||
heroImage: HeroImage, | ||
}: HomeHeroProps) => { | ||
return ( | ||
<Section | ||
className={clsx( | ||
'relative isolate h-[calc(100vh-136px)] min-h-[587px] overflow-hidden', | ||
)} | ||
> | ||
{BackgroundImage} | ||
<FluidContainer | ||
className={ | ||
'relative flex h-full flex-col justify-end sm:justify-center' | ||
} | ||
> | ||
<div className="z-20 flex flex-col max-sm:pt-general-2xl max-sm:text-center sm:w-[444px] lg:w-1/2"> | ||
<Heading.H1 className="text-solid-slate-50">{Title}</Heading.H1> | ||
{description && ( | ||
<Text className="pt-general-md text-solid-slate-50"> | ||
{description} | ||
</Text> | ||
)} | ||
<div className="flex pt-general-2xl max-sm:justify-center"> | ||
{CTAButton} | ||
</div> | ||
</div> | ||
{Awards && ( | ||
<div className="bottom-50 z-10 flex pb-general-xl max-sm:py-general-2xl sm:absolute"> | ||
{Awards} | ||
</div> | ||
)} | ||
</FluidContainer> | ||
{HeroImage && HeroImage} | ||
<div className="absolute inset-50 z-10 bg-gradient-hero-mobile sm:-z-10 sm:bg-gradient-hero"></div> | ||
</Section> | ||
); | ||
}; | ||
|
||
export default HomeHero; |
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