diff --git a/libs/blocks/src/lib/hero/home-hero/home-hero.stories.tsx b/libs/blocks/src/lib/hero/home-hero/home-hero.stories.tsx new file mode 100644 index 00000000..66060ec3 --- /dev/null +++ b/libs/blocks/src/lib/hero/home-hero/home-hero.stories.tsx @@ -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; + +export default meta; +type Story = StoryObj; + +export const Default: Story = { + args: { + title: ( + <> + Gold spreads from +

+ 30 pips + + ), + backgroundImage: <>, + description: + 'Trade gold and other precious metals on one of the world’s favourite leveraged trading platforms.', + ctaButton: , + awards: <>Awards here, + heroImage: ( +
+ Placeholder +
+ ), + }, +}; diff --git a/libs/blocks/src/lib/hero/home-hero/index.tsx b/libs/blocks/src/lib/hero/home-hero/index.tsx new file mode 100644 index 00000000..47db95e7 --- /dev/null +++ b/libs/blocks/src/lib/hero/home-hero/index.tsx @@ -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 ( +
+ {BackgroundImage} + +
+ {Title} + {description && ( + + {description} + + )} +
+ {CTAButton} +
+
+ {Awards && ( +
+ {Awards} +
+ )} +
+ {HeroImage && HeroImage} +
+
+ ); +}; + +export default HomeHero; diff --git a/libs/blocks/src/lib/hero/index.tsx b/libs/blocks/src/lib/hero/index.tsx index f8d95439..61759625 100644 --- a/libs/blocks/src/lib/hero/index.tsx +++ b/libs/blocks/src/lib/hero/index.tsx @@ -4,6 +4,7 @@ import ContentBottom from './content-bottom'; import ContentTop from './content-top'; import ContentLess from './content-less'; import { ReactNode } from 'react'; +import HomeHero from './home-hero'; export type HeroBlockProps = { title?: ReactNode | string; @@ -13,12 +14,23 @@ export type HeroBlockProps = { children?: ReactNode; className?: string; }; + +export interface HomeHeroProps { + title: ReactNode; + description?: string; + ctaButton: ReactNode; + awards?: ReactNode; + backgroundImage: ReactNode; + heroImage?: ReactNode; +} + export type HeroVariants = { ContentLimitless: typeof ContentLimitless; ContentLimit: typeof ContentLimit; ContentBottom: typeof ContentBottom; ContentTop: typeof ContentTop; ContentLess: typeof ContentLess; + HomeHero: typeof HomeHero; }; export const Hero: HeroVariants = ({ children }: { children: ReactNode }) => { @@ -30,5 +42,6 @@ Hero.ContentLimit = ContentLimit; Hero.ContentBottom = ContentBottom; Hero.ContentTop = ContentTop; Hero.ContentLess = ContentLess; +Hero.HomeHero = HomeHero; export default Hero; diff --git a/tailwind.config.js b/tailwind.config.js index 699a75ce..e83d03b6 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -21,6 +21,10 @@ module.exports = { slide: '50s slide infinite linear', slideRtl: '50s slideRtl infinite linear', }, + backgroundImage: (theme) => ({ + 'gradient-hero': `linear-gradient(84deg, rgba(0, 0, 0, 0.80) 6.97%, rgba(0, 0, 0, 0.00) 107.22%)`, + 'gradient-hero-mobile': `linear-gradient(180deg, rgba(0, 0, 0, 0.00) 1.45%, rgba(0, 0, 0, 0.00) 34.13%, rgba(15, 10, 10, 0.80) 86.38%)`, + }), }, }, presets: [require('@deriv/quill-design/quill-tailwind/tailwind.config.cjs')],