Skip to content

Commit

Permalink
fix: diplay components may have error attr
Browse files Browse the repository at this point in the history
  • Loading branch information
yehuozhili committed Jun 26, 2020
1 parent 33144a2 commit 0dfc316
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bigbear-ui",
"version": "0.2.0",
"version": "0.2.1",
"description": "Neumorphic component library for React;基于React制作的拟物风格组件库",
"keywords": [
"component",
Expand Down
6 changes: 4 additions & 2 deletions src/components/Alert/alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export const Alert: FC<AlertProps> = function(props: AlertProps) {
initiativeCloseCallback,
children,
style,
icon,
close,
...restProps
} = props;
const classes = classNames(
Expand Down Expand Up @@ -98,12 +100,12 @@ export const Alert: FC<AlertProps> = function(props: AlertProps) {
>
<div className={classes} style={style} {...restProps}>
<span>
{props.icon && props.icon}
{icon && icon}
{title}
</span>
{description && <span>{description}</span>}
{children}
{props.close && (
{close && (
<Button
btnType={type}
onClick={(e) => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Badge/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface BadgeProps extends DOMAttributes<HTMLDivElement> {
}

export const Badge: FC<BadgeProps> = (props) => {
const { refCallback, className, type, count, visible, dot, ...restProps } = props;
const { refCallback, className, type, count, visible, dot, children, ...restProps } = props;
const classes = classNames("bigbear-badge", `bigbear-type-${type}`, className);
const divref = useRef<HTMLDivElement>(null);
useEffect(() => {
Expand All @@ -39,14 +39,14 @@ export const Badge: FC<BadgeProps> = (props) => {
{count || dot ? (
<div
className={`bigbear-badge-count bigbear-count-${type}
${props.children ? "" : "nochildren"} ${visible ? "" : "badge-hide"} ${
${children ? "" : "nochildren"} ${visible ? "" : "badge-hide"} ${
dot ? "badge-dot" : ""
}`}
>
<span>{count}</span>
</div>
) : null}
{props.children ? props.children : null}
{children ? children : null}
</div>
);
};
Expand Down
8 changes: 4 additions & 4 deletions src/components/Grid/grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ interface ColProps extends DOMAttributes<HTMLDivElement> {
}

function Col(props: PropsWithChildren<ColProps>) {
const { className, style, xxl, xs, sm, md, lg, xl, ...restProps } = props;
const { className, style, xxl, xs, sm, md, lg, xl, children, ...restProps } = props;
const classes = classnames("bigbear-grid-col", className, {
[`bigbear-col-xs-${xs}`]: typeof xs === "number",
[`bigbear-col-sm-${sm}`]: typeof sm === "number",
Expand All @@ -32,7 +32,7 @@ function Col(props: PropsWithChildren<ColProps>) {
});
return (
<div className={classes} style={style} {...restProps}>
{props.children}
{children}
</div>
);
}
Expand All @@ -45,11 +45,11 @@ interface RowProps extends DOMAttributes<HTMLDivElement> {
}

function Row(props: PropsWithChildren<RowProps>) {
const { className, style, ...restProps } = props;
const { className, style, children, ...restProps } = props;
const classes = classnames("bigbear-grid-row", className);
return (
<div className={classes} style={style} {...restProps}>
{props.children}
{children}
</div>
);
}
Expand Down
22 changes: 11 additions & 11 deletions src/components/Layout/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,53 +14,53 @@ export interface LayoutProps extends LayoutItemProps {
}

function Layout(props: PropsWithChildren<LayoutProps>) {
const { style, className, row, ...restProps } = props;
const { style, className, row, children, ...restProps } = props;
const classes = classnames("bigbear-layout", className, {
"bigbear-layout-row": row
});
return (
<section className={classes} style={style} {...restProps}>
{props.children}
{children}
</section>
);
}

function Header(props: PropsWithChildren<LayoutItemProps>) {
const { style, className, ...restProps } = props;
const { style, className, children, ...restProps } = props;
const classes = classnames("bigbear-layout-header", className);
return (
<header className={classes} style={style} {...restProps}>
{props.children}
{children}
</header>
);
}

function Content(props: PropsWithChildren<LayoutItemProps>) {
const { style, className } = props;
const { style, className, children, ...restProps } = props;
const classes = classnames("bigbear-layout-content", className);
return (
<main className={classes} style={style}>
{props.children}
<main className={classes} style={style} {...restProps}>
{children}
</main>
);
}

function Sider(props: PropsWithChildren<LayoutItemProps>) {
const { style, className, ...restProps } = props;
const { style, className, children, ...restProps } = props;
const classes = classnames("bigbear-layout-sider", className);
return (
<aside className={classes} style={style} {...restProps}>
{props.children}
{children}
</aside>
);
}

function Footer(props: PropsWithChildren<LayoutItemProps>) {
const { style, className, ...restProps } = props;
const { style, className, children, ...restProps } = props;
const classes = classnames("bigbear-layout-footer", className);
return (
<footer className={classes} style={style} {...restProps}>
{props.children}
{children}
</footer>
);
}
Expand Down

0 comments on commit 0dfc316

Please sign in to comment.