add paragraph component with props

This commit is contained in:
amirhouieh 2022-05-19 15:12:03 +02:00
parent bf682ba4b1
commit a8bc7f7037
2 changed files with 18 additions and 4 deletions

View File

@ -111,8 +111,20 @@
.container :global(.logos-paragraph) p{
white-space: break-spaces;
}
.container :global(.logos-paragraph.x) p{
column-count: 1;
}
.container :global(.logos-paragraph.xx) p{
column-count: 2;
}
.container :global(.logos-paragraph.xxx) p{
column-count: 3;
}
.container :global(.logos-paragraph.xxxx) p{
column-count: 4;
}
.container p{
margin-top: 0;

View File

@ -1,14 +1,16 @@
import {FC, PropsWithChildren} from "react";
import {logosCustomMarkdownLanguages} from "../../configs";
interface IProps{
columns?: number
}
export const Paragraph: FC<PropsWithChildren<IProps>> = (props) => {
const {children} = props;
const {children, columns = 2} = props;
const cClass = new Array(columns).fill(null).map(c => `x`).join("");
return (
<>
<article className={`${logosCustomMarkdownLanguages.paragraph} ${cClass}`}>
{children}
</>
</article>
)
}