= (props) => {
- const { type = "horizontal", children } = props;
- const classNames = className("dui-divider", `dui-divider-${type}`);
+ const { type = "horizontal", children, dashed, plain, orientation } = props;
+ const classNames = className(
+ "dui-divider",
+ `dui-divider-${type}`,
+ { [`ant-divider-with-text-${orientation}`]: type == "horizontal" },
+ { "dui-divider-dashed": dashed && type == "horizontal" },
+ { "dui-divider-plain": plain && type == "horizontal" }
+ );
- return {children}
;
+ if (type === "vertical" && children) {
+ console.warn("children not working in vertical mode");
+ }
+
+ return (
+
+ {type === "vertical" ? null : children ? (
+ {children}
+ ) : null}
+
+ );
+};
+
+Divider.defaultProps = {
+ plain: false,
+ orientation: "center",
+ type: "horizontal",
+ dashed: false,
};
export default Divider;
diff --git a/src/styles/index.scss b/src/styles/index.scss
index d08e236..3374646 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -25,3 +25,6 @@
//upload
@import "../components/Upload/style";
+
+//Divider
+@import "../components/Divider/style";