Skip to content

Commit

Permalink
Docs(web-react): Add hasStack and stackAlignment to DocsSection comp
Browse files Browse the repository at this point in the history
Add same props and functionality as in the web-twig component.
  • Loading branch information
pavelklibani committed Sep 14, 2023
1 parent b73811e commit 340613d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/web-react/docs/DocsSections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import { Tag } from '../src/components';

interface DocsSectionProps {
children: ReactNode;
hasStack?: boolean;
stackAlignment?: 'start' | 'center' | 'end';
tag?: string;
title: string;
}

const DocsSection = ({ children, title, tag }: DocsSectionProps) => (
const DocsSection = ({ children, hasStack = true, stackAlignment = 'start', title, tag }: DocsSectionProps) => (
<section className="docs-Section">
<h2 className="docs-Heading">
{title}
Expand All @@ -17,11 +19,13 @@ const DocsSection = ({ children, title, tag }: DocsSectionProps) => (
</Tag>
)}
</h2>
{children}
{hasStack ? <div className={`docs-Stack docs-Stack--${stackAlignment}`}>{children}</div> : children}
</section>
);

DocsSection.defaultProps = {
hasStack: true,
stackAlignment: 'start',
tag: '',
};

Expand Down

0 comments on commit 340613d

Please sign in to comment.