2017-11-17 14:38:54 +08:00
|
|
|
import * as React from 'react';
|
2017-07-07 13:36:54 +08:00
|
|
|
import classNames from 'classnames';
|
2018-12-05 19:12:18 +08:00
|
|
|
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
2017-07-07 13:36:54 +08:00
|
|
|
|
|
|
|
export interface CardGridProps {
|
|
|
|
prefixCls?: string;
|
|
|
|
style?: React.CSSProperties;
|
|
|
|
className?: string;
|
|
|
|
}
|
|
|
|
|
2019-02-19 13:37:38 +08:00
|
|
|
const Grid: React.SFC<CardGridProps> = props => (
|
2018-12-05 19:12:18 +08:00
|
|
|
<ConfigConsumer>
|
|
|
|
{({ getPrefixCls }: ConfigConsumerProps) => {
|
|
|
|
const { prefixCls: customizePrefixCls, className, ...others } = props;
|
|
|
|
const prefixCls = getPrefixCls('card', customizePrefixCls);
|
|
|
|
const classString = classNames(`${prefixCls}-grid`, className);
|
|
|
|
return <div {...others} className={classString} />;
|
|
|
|
}}
|
|
|
|
</ConfigConsumer>
|
|
|
|
);
|
2019-02-19 13:37:38 +08:00
|
|
|
|
|
|
|
export default Grid;
|