From 5464397f87adfdc7e99e687da4703939572d672c Mon Sep 17 00:00:00 2001 From: Hossein Mehrabi Date: Tue, 10 Oct 2023 17:52:39 +0330 Subject: [PATCH] fix: restore Grid's actions section --- .../docusaurus-playground/src/pages/index.mdx | 14 +++++++- .../src/client/components/mdx/Grid/Grid.tsx | 35 +++++++++++++------ 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/packages/docusaurus-playground/src/pages/index.mdx b/packages/docusaurus-playground/src/pages/index.mdx index 1a15b06..a3b3b24 100644 --- a/packages/docusaurus-playground/src/pages/index.mdx +++ b/packages/docusaurus-playground/src/pages/index.mdx @@ -181,7 +181,19 @@ import { description="Codex is currently in its first proof-of-concept iteration and aims to release its beta version, Katana, before the end of Q4 2023." bottom={{ xs: '4rem', lg: '7.25rem' }} /> - + + Read more + + } + > & {} +export type GridProps = React.ComponentProps & { + actions?: React.ReactNode +} export const Grid: { Item: typeof GridItem } & React.FC = ({ + actions, children, ...props }) => { @@ -35,15 +38,18 @@ export const Grid: { Item: typeof GridItem } & React.FC = ({ return ( -
- - - - - - - - +
+ {actions} +
+ + + + + + + + +
{children} @@ -70,7 +76,6 @@ const GridRoot = styled.div<{ width: 100%; .mdx-grid__scroll { - margin-bottom: 2rem; display: flex; flex-direction: row; gap: 0 1rem; @@ -83,6 +88,14 @@ const GridRoot = styled.div<{ overflow: hidden; } + .mdx-grid__actions { + display: flex; + flex-direction: row; + align-items: center; + gap: 1rem; + margin-bottom: 2rem; + } + ${(props) => THEME_BREAKPOINTS.map((key) => { if (!props[key]) return null