mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 17:59:57 +08:00
43 lines
1014 B
JavaScript
43 lines
1014 B
JavaScript
import React from 'react';
|
|
import RcPagination from 'rc-pagination';
|
|
import Select from '../select';
|
|
import MiniSelect from './MiniSelect';
|
|
import zhCN from './locale/zh_CN';
|
|
|
|
export default class Pagination extends React.Component {
|
|
static defaultProps = {
|
|
locale: zhCN,
|
|
className: '',
|
|
prefixCls: 'ant-pagination',
|
|
}
|
|
|
|
static contextTypes = {
|
|
antLocale: React.PropTypes.object,
|
|
}
|
|
|
|
render() {
|
|
let className = this.props.className;
|
|
let selectComponentClass = Select;
|
|
|
|
let locale;
|
|
if (this.context.antLocale && this.context.antLocale.Pagination) {
|
|
locale = this.context.antLocale.Pagination;
|
|
} else {
|
|
locale = this.props.locale;
|
|
}
|
|
|
|
if (this.props.size === 'small') {
|
|
className += ' mini';
|
|
selectComponentClass = MiniSelect;
|
|
}
|
|
|
|
return (
|
|
<RcPagination selectComponentClass={selectComponentClass}
|
|
selectPrefixCls="ant-select"
|
|
{...this.props}
|
|
locale={locale}
|
|
className={className} />
|
|
);
|
|
}
|
|
}
|