Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom render support for divider #122

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MarcoNicolodi
Copy link

@MarcoNicolodi MarcoNicolodi commented Feb 18, 2018

Hi.

This PR adds support for customizing the "slash" divider.

At our company we'd rather display "1 of 30" instead of "1 / 30".

I also added itemRender tests for simple pagination.

Things to keep aware:
I wrapped the slash divider with a <span> with a styleless class for testing purposes. Could it brake production applications?

Also, the first argument of the itemRender is the page number(an integer) , which isnt relevant for the divider. I passed the current page, because if I passed null, it could brake production applications that rely on integer methods without null check.

Thanks.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.693% when pulling a332762 on MarcoNicolodi:add-divider-to-itemrender into d78fa4b on react-component:master.

Copy link
Contributor

@yutingzhao1991 yutingzhao1991 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove lock file

@@ -0,0 +1,15794 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove lock file.

@@ -347,7 +347,11 @@ export default class Pagination extends React.Component {
onChange={this.handleKeyUp}
size="3"
/>
<span className={`${prefixCls}-slash`}>/</span>
<span className={`${prefixCls}-divider`} >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think use itemRender for this feature is a good idea. Maybe just add a prop dividerSymbol for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants