Skip to content
Snippets Groups Projects
Verified Commit 24c2f05a authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: initial section implementation

parent 5752900b
No related branches found
No related tags found
1 merge request!8Support for react.js components
Pipeline #1149 passed
...@@ -3,3 +3,4 @@ export * from "./button-increment/button-increment"; ...@@ -3,3 +3,4 @@ export * from "./button-increment/button-increment";
export * from "./button-switch/button-switch"; export * from "./button-switch/button-switch";
export * from "./info/info"; export * from "./info/info";
export * from "./pair/pair"; export * from "./pair/pair";
export * from "./section/section";
...@@ -3,7 +3,7 @@ import React, { FC, ReactNode } from "react"; ...@@ -3,7 +3,7 @@ import React, { FC, ReactNode } from "react";
import "./info.css"; import "./info.css";
type InfoProps = { type InfoProps = {
children?: ReactNode; children: ReactNode;
style?: string[]; style?: string[];
}; };
...@@ -18,7 +18,7 @@ type InfoProps = { ...@@ -18,7 +18,7 @@ type InfoProps = {
* to build the info pairs. * to build the info pairs.
* @returns The info component with the associated pairs. * @returns The info component with the associated pairs.
*/ */
export const Info: FC<InfoProps> = ({ children = [], style = [] }) => { export const Info: FC<InfoProps> = ({ children, style = [] }) => {
const classes = () => ["info", ...style].join(" "); const classes = () => ["info", ...style].join(" ");
return <dl className={classes()}>{children}</dl>; return <dl className={classes()}>{children}</dl>;
}; };
......
import React, { FC, ReactNode } from "react";
import "./section.css";
type SectionProps = {
children: ReactNode;
separator?: boolean;
style?: string[];
};
export const Section: FC<SectionProps> = ({
children,
separator = true,
style = []
}) => {
const classes = () => ["section", ...style].join(" ");
return (
<div className={classes()}>
{separator && <div className="separator"></div>}
<div className="section-contents">{children}</div>
</div>
);
};
export default Section;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment