ant-design/components/pagination/index.jsx

33 lines
799 B
React
Raw Normal View History

import React from 'react';
import Pagination from 'rc-pagination';
import Select from 'rc-select';
2015-11-16 14:10:42 +08:00
import zhCN from './locale/zh_CN';
import enUS from './locale/en_US';
2015-07-13 01:04:05 +08:00
const prefixCls = 'ant-pagination';
2015-07-13 01:04:05 +08:00
2015-11-16 14:10:42 +08:00
class AntPagination extends React.Component {
2015-07-13 01:04:05 +08:00
render() {
let className = this.props.className;
if (this.props.size === 'small') {
className += ' mini';
}
2015-07-15 17:32:32 +08:00
return <Pagination selectComponentClass={Select}
2015-11-16 14:10:42 +08:00
selectPrefixCls="ant-select"
prefixCls={prefixCls}
{...this.props} className={className}/>;
2015-07-13 01:04:05 +08:00
}
}
2015-11-16 14:10:42 +08:00
AntPagination.defaultProps = {
locale: zhCN,
};
2015-11-16 14:13:58 +08:00
// TODO. remove after https://github.com/ant-design/ant-design/issues/487
2015-11-16 14:10:42 +08:00
AntPagination.locale = {
en_US: enUS,
zh_CN: zhCN,
};
export default AntPagination;