Skip to content

Commit

Permalink
Docs(web-react): Introduce DocsBox component
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelklibani committed Sep 1, 2023
1 parent 2feb782 commit ec381f7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 21 additions & 0 deletions packages/web-react/docs/DocsBox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React, { ReactNode } from 'react';
import { SizesDictionaryType } from '../src/types';

interface DocsBoxProps {
children: ReactNode;
size?: SizesDictionaryType;
}

const defaultProps = {
size: 'medium',
};

const DocsBox = ({ children, size }: DocsBoxProps) => {
const sizeClass = size ? `docs-Box--${size}` : '';

return <div className={`docs-Box ${sizeClass}`}>{children}</div>;
};

DocsBox.defaultProps = defaultProps;

export default DocsBox;
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import DocsBox from '../../../../docs/DocsBox';

const ContainerDefault = () => {
return <div className="docs-Box">Container</div>;
};
const ContainerDefault = () => <DocsBox>Container</DocsBox>;

export default ContainerDefault;

0 comments on commit ec381f7

Please sign in to comment.