-
Notifications
You must be signed in to change notification settings - Fork 8
feat(controls): add pagination controls #12
Conversation
Storybook Hub is building storybooks for every commit in this PR. Latest Storybook: https://38dfe732-fe93-4b01-8e82-343b109a5f83.sbook.io/
|
super(props) | ||
this.state = { | ||
isPrevPageValid: false, | ||
isNextPageValid: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is fine, just brainstorming. both of these ^^ are derived state. hence, something akin to get isPrevPageValid () { this.state.currentPage > 1 }
and the like could feasibly 🔥 down some code! no action requested. just talkin :)
stories/Welcome.js
Outdated
</div> | ||
); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed, i think. we already have a Welcome component
hey @eddier, looks good.
thanks! this is cool stuff! @antoinejuhel, 👀 storybook |
oh, and, https://github.com/semantic-release/semantic-release#default-commit-message-format . dont worry about rebasing. were still learning it too! |
Can you give me account on your Codeship instance so I can see the build issues? I'll check out the triple click issue that is causing the highlighting, good catch. The "jump to end" state was not part of the initial scope but it makes sense to include those as optional controls. I'll bring it up to the design team. I assume you guys will handle the required API support necessary for those components? |
This resolves the text selecting from rapidly triple clicking
cool. hmm. the project should be open. i just double checked. do you have an acct? looks like the linter isnt happy atm |
& yep, we'll wire in the API calls. thx! |
eraffaele at g mail - it currently throws an error about access being denied to CS. |
@eddier
|
This resolves the linting issues which may be causing CI to fail
Thanks Josh! Didn't realize the .stories.js files were in scope of the linter for your ci. |
Access granted. Sorry for the delay
…On Tue, Feb 21, 2017 at 4:51 PM, Edward Raffaele ***@***.***> wrote:
Thanks Josh! Didn't realize the .stories.js files were in scope of the
linter.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA9O_Q1EkXQV5U5AUPT4uKy6L1SnwyRgks5re4aagaJpZM4MFRAZ>
.
|
I noticed that the "5 of 15" page number text has the text selection cursor when mousing over; should that just have the normal pointing mouse cursor instead? (I'm really not sure) |
keep the cursor as default when hovering over the page count
That makes sense to me, updated to reflect that change. |
Because of the sorting functions we have for consoles, I don't see a need for jump to end/beginning in this use case. That said if these are the pagination controls we want to use throughout our products, then yes, a jump to end/beginning would be required (a good example of this would be for reporting). |
feature description
Adding pagination controls to the the set of available components
content
Includes the PaginationControl element as well as the necessary CSS. Also includes testable storybook component. No new dependencies.
usage
Handle the navigateToPage call:
navigateToPage(page) { this.setState({ currentNotes: this.getNotes(page) }); }
In this example you can fetch the appropriate notes from the API or if they are all loaded in a parent array just set them...
getNotes(pageNum) { return this.state.allNotes.slice( pageNum * this.state.perPage - this.state.perPage, pageNum * this.state.perPage); }