-
Notifications
You must be signed in to change notification settings - Fork 44
update layout on orientation change #2
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
base: master
Are you sure you want to change the base?
Conversation
index.js
Outdated
| import PageData from './components/PageData'; | ||
| import Paginator from './components/Paginator'; | ||
|
|
||
| var {height, width} = Dimensions.get('window'); |
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.
Can you change this to const and style the curlies as { height, width } please?
index.js
Outdated
| this.state = { | ||
| currentPage: 0, | ||
| layout:{ | ||
| height:height, |
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.
Add a space after the colon
index.js
Outdated
| }; | ||
|
|
||
| updatePosition = (event) => { | ||
| const { contentOffset, layoutMeasurement } = event.nativeEvent; |
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.
Seems like layoutMeasurement is no longer needed
|
Thanks for your PR! Please address the minor code styling issues I've pointed out |
|
I committed a change with your suggestions |
|
Did you see my code update ? |
|
Nice! Sorry, busy with my other projects at the moment. I run the code in a simulator this weekend to see if it works properly. |
goshacmd
left a comment
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.
Hey, thanks for contributing! Did you run this on iOS and/or Android?
Also, can you please fix these three minor code style issues and squash the commits? Looks good otherwise!
| import PageData from './components/PageData'; | ||
| import Paginator from './components/Paginator'; | ||
|
|
||
| var { height, width } = Dimensions.get('window'); |
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.
Minor nitpick: can you switch to const please?
|
|
||
| this.state = { | ||
| currentPage: 0, | ||
| layout:{ |
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.
Styling nitpick: please add a space after the colon :)
| currentPage: 0, | ||
| layout:{ | ||
| height: height, | ||
| width: width, |
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.
Both of these can use the ES6 shorthand syntax:
layout: {
height,
width,
}|
@acerbetti can you update the styling issues so we can move the PR forward? |
No description provided.