From 9514ca3a65507fd9814077d296767ce66b46a069 Mon Sep 17 00:00:00 2001 From: Greg Holmes Date: Mon, 7 Jul 2025 09:32:30 +0100 Subject: [PATCH] Add getting-started index page --- src/components/Layout/MDXWrapper.tsx | 2 ++ src/components/Layout/mdx/tiles.tsx | 43 ++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/components/Layout/mdx/tiles.tsx diff --git a/src/components/Layout/MDXWrapper.tsx b/src/components/Layout/MDXWrapper.tsx index ef5c5c342e..9059726da7 100644 --- a/src/components/Layout/MDXWrapper.tsx +++ b/src/components/Layout/MDXWrapper.tsx @@ -16,6 +16,7 @@ import { HtmlComponentPropsData } from '../html-component-props'; import { languageData } from 'src/data/languages'; import { ActivePage } from './utils/nav'; import { Table, TableHead, TableBody, TableRow, TableHeader, TableCell } from './mdx/tables'; +import { Tiles } from './mdx/tiles'; import { Head } from '../Head'; import { useSiteMetadata } from 'src/hooks/use-site-metadata'; import { ProductName } from 'src/templates/template-data'; @@ -126,6 +127,7 @@ const MDXWrapper: React.FC = ({ children, pageContext, location tr: TableRow, th: TableHeader, td: TableCell, + Tiles, }} > {title} diff --git a/src/components/Layout/mdx/tiles.tsx b/src/components/Layout/mdx/tiles.tsx new file mode 100644 index 0000000000..a4d50b48b4 --- /dev/null +++ b/src/components/Layout/mdx/tiles.tsx @@ -0,0 +1,43 @@ +import Link from 'src/components/Link'; +import Icon from '@ably/ui/core/Icon'; +import { IconName } from '@ably/ui/core/Icon/types'; + +type TileProps = { + title?: string; + description?: string; + image?: IconName; + link?: string; +}; + +const Tile = ({ title, description, image, link = '/docs' }: TileProps) => { + return ( + +
+
+ {image && } +
+
+

{title}

+

+ {description} +

+
+
+ + ); +}; + +export const Tiles = ({ children }: { children: TileProps[] }) => { + return ( +
+ {children + .filter((item) => item.title && item.description) + .map((item: TileProps) => ( + + ))} +
+ ); +};