-
Notifications
You must be signed in to change notification settings - Fork 299
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
Code verifications & Lighter demo app #2
Conversation
…o prevent leaking
Added few cleanups (unused vars), typos and indentation 👍 |
@aviadhahami I'm use 2 spaces indentation, how many spaces do you indent? The indentation looks many spaces. |
@jacklam718 i think it's 4 here |
@aviadhahami Are you used Tab? In my editor looks many spaces. |
@aviadhahami Do you mind if I change it to 2 spaces? Because I prefer 2 spaces for indentation. |
sure thing |
@jacklam718 hope c855a30ffb7fe84272af58785f49880093bce74ais better :) |
FYI: Sorry i need go to outside now, I will get back to review your PR later. Thank you for PR |
import PopupDialog from 'react-native-popup-dialog'; | ||
|
||
const {width, height} = 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.
I think if the width & height use uppercase will be better.
FYI: have a sugar sytax for ES7:
const { width: WIDTH, height: HEIGHT } = 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.
then wouldn't be
const { WIDTH:width, HEIGHT:height } = 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.
@aviadhahami Sorry what do you mean?
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.
As in the order of assignment.
WIDTH: width
rather than width: WIDTH
FYI: I'm not familiar with this syntactic sugar this I might be wrong.
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.
@aviadhahami
The order of assignment.
{ width: WIDTH, 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.
Cool :)
Can u show me the specs of this ES7 thing? (So I can learn :) )
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.
@aviadhahami
Sorry, It's should belong to ES6.
It called Destructuring Objects
/ Destructuring Object Property
or something like that.
FYI: https://hacks.mozilla.org/2015/05/es6-in-depth-destructuring/
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.
Gotcha :)
Will fix it later today (gym time) ;)
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.
@aviadhahami 👌 👍
|
||
const SCRREN_WIDTH = Dimensions.get('window').width; | ||
const SCRREN_HEIGHT = Dimensions.get('window').height; | ||
const {width, height} = 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.
Same with PopupDialogExample.js
We can use ES7 sugar sytax & uppercase.
@aviadhahami FYI: https://github.com/airbnb/javascript/blob/master/README.md The style guide mentioned about this: // bad // good |
@aviadhahami I think all is good 👍, except above things. |
setTimeout(() => { | ||
dialogState = dialogState === 'closing' ? 'closed' : 'opened'; | ||
this.setState({dialogState}); | ||
if (callback && typeof callback === 'function') callback(); |
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.
@jacklam718 moved the verification here
{...this.props} | ||
> | ||
{title} | ||
{this.props.children} // Critical! |
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.
@aviadhahami
Need remove // Critical!
, that will make App crash while open dialog.
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.
ok, as long as you keep {this.props.children}
intact
@aviadhahami |
No, not at all. |
Hey,
Here's the changelog:
package.json
to relative (rather than local absolute)linear-gradient
and thesparkly
deps as they wouldn't link thus project won't compileThis change is