add paragraph component with props
This commit is contained in:
parent
bf682ba4b1
commit
a8bc7f7037
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
)
|
||||
}
|
Loading…
Reference in New Issue