diff --git a/public/images/architecture.png b/public/images/architecture.png new file mode 100644 index 00000000000..076b0418e4f Binary files /dev/null and b/public/images/architecture.png differ diff --git a/src/components/MediaSection/MediaSection.astro b/src/components/MediaSection/MediaSection.astro new file mode 100644 index 00000000000..79fc38d8472 --- /dev/null +++ b/src/components/MediaSection/MediaSection.astro @@ -0,0 +1,41 @@ +--- +import { Typography } from "@chainlink/blocks" +import styles from "./MediaSection.module.css" + +interface Props { + heading: string + description: string + image?: string + video?: string +} + +const { heading, description, image, video } = Astro.props +--- + +
+
+ {heading} + + {description} + +
+ + { + image && ( +
+ {heading} +
+ ) + } + + { + !image && video && ( +
+ +
+ ) + } +
diff --git a/src/components/MediaSection/MediaSection.module.css b/src/components/MediaSection/MediaSection.module.css new file mode 100644 index 00000000000..f7c5673f5a8 --- /dev/null +++ b/src/components/MediaSection/MediaSection.module.css @@ -0,0 +1,25 @@ +.section { + display: flex; + flex-direction: column; + gap: var(--space-8x); +} + +.textContent { + display: flex; + flex-direction: column; + gap: var(--space-6x); +} + +.mediaWrapper { + width: 100%; + display: flex; + justify-content: center; + align-items: center; +} + +.media { + width: 100%; + max-width: 100%; + height: auto; + border-radius: var(--space-2x); +} diff --git a/src/components/MediaSection/README.md b/src/components/MediaSection/README.md new file mode 100644 index 00000000000..c03ad7205c6 --- /dev/null +++ b/src/components/MediaSection/README.md @@ -0,0 +1,44 @@ +# MediaSection Component + +## What it does + +The MediaSection component displays a section with a heading, description, and optionally an image or video. It's perfect for explaining concepts with visual aids, like showing architecture diagrams or tutorial videos. + +## How to use it + +Import the component and add it to your page with the content you want to display: + +```astro +import MediaSection from "~/components/MediaSection/MediaSection.astro" + + +``` + +## Props explained + +- **heading** (required) - The title of your section +- **description** (required) - A paragraph explaining the section content +- **image** (optional) - Path to an image file you want to display +- **video** (optional) - Path to a video file you want to display + +**Note:** You can provide either an image OR a video, not both. If you include both, only the image will show. + +## Example + +```astro + +``` + +This will display: + +1. A heading that says "High-level architecture" +2. The description text below it +3. The architecture diagram image at the bottom diff --git a/src/layouts/DocsV3Layout/DocsV3Layout.astro b/src/layouts/DocsV3Layout/DocsV3Layout.astro index e55be9391eb..d9377a1ee8b 100644 --- a/src/layouts/DocsV3Layout/DocsV3Layout.astro +++ b/src/layouts/DocsV3Layout/DocsV3Layout.astro @@ -8,6 +8,7 @@ import LeftSidebar from "~/components/LeftSidebar/LeftSidebar.astro" import PageContent from "~/components/PageContent/PageContent.astro" import { TabGrid } from "~/components/TabGrid/TabGrid" import LayoutHero from "~/components/LayoutHero/LayoutHero.astro" +import MediaSection from "~/components/MediaSection/MediaSection.astro" import QuickLinkCard from "~/components/QuickLinkCard/QuickLinkCard.astro" import { SvgBulletList, @@ -190,6 +191,11 @@ const quickLinks = [ +