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

Code verifications & Lighter demo app #2

Merged
merged 22 commits into from
Sep 15, 2016

Conversation

aviadhahami
Copy link
Contributor

@aviadhahami aviadhahami commented Sep 12, 2016

Hey,
Here's the changelog:

  1. Fixed the path in package.json to relative (rather than local absolute)
  2. Continuing [Example] can not run example app #1 , I've cleaned the linear-gradient and the sparkly deps as they wouldn't link thus project won't compile
  3. some indentation
    ezgif com-resize

This change is Reviewable

@aviadhahami
Copy link
Contributor Author

Added few cleanups (unused vars), typos and indentation 👍

@jacklam718
Copy link
Owner

@aviadhahami I'm use 2 spaces indentation, how many spaces do you indent? The indentation looks many spaces.

@aviadhahami
Copy link
Contributor Author

@jacklam718 i think it's 4 here

@jacklam718
Copy link
Owner

jacklam718 commented Sep 12, 2016

@aviadhahami Are you used Tab? In my editor looks many spaces.

@jacklam718
Copy link
Owner

@aviadhahami Do you mind if I change it to 2 spaces? Because I prefer 2 spaces for indentation.

@aviadhahami
Copy link
Contributor Author

sure thing

@aviadhahami
Copy link
Contributor Author

aviadhahami commented Sep 12, 2016

@jacklam718 hope c855a30ffb7fe84272af58785f49880093bce74ais better :)

@jacklam718
Copy link
Owner

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');
Copy link
Owner

@jacklam718 jacklam718 Sep 12, 2016

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');

Copy link
Contributor Author

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');
?

Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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 }

Copy link
Contributor Author

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 :) )

Copy link
Owner

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/

Copy link
Contributor Author

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) ;)

Copy link
Owner

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');
Copy link
Owner

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.

@jacklam718
Copy link
Owner

jacklam718 commented Sep 12, 2016

@aviadhahami
BTW: I saw you removed spaces inside curly braces. Actually, I follow the Aribnb style guide and on the style guide mentioned the best practice should add spaces inside curly braces.

FYI: https://github.com/airbnb/javascript/blob/master/README.md

The style guide mentioned about this:
18.11 Add spaces inside curly braces. eslint: object-curly-spacing guess: requireSpacesInsideObjectBrackets

// bad
const foo = {clark: 'kent'};

// good
const foo = { clark: 'kent' };

@jacklam718
Copy link
Owner

jacklam718 commented Sep 12, 2016

@aviadhahami I think all is good 👍, except above things.

setTimeout(() => {
dialogState = dialogState === 'closing' ? 'closed' : 'opened';
this.setState({dialogState});
if (callback && typeof callback === 'function') callback();
Copy link
Contributor Author

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

@aviadhahami aviadhahami changed the title Lighter demo app Code verifications & Lighter demo app Sep 13, 2016
{...this.props}
>
{title}
{this.props.children} // Critical!
Copy link
Owner

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.

Copy link
Contributor Author

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

@jacklam718
Copy link
Owner

@aviadhahami
Would you mind if I merge you PR then let me fix above things?

@jacklam718 jacklam718 merged commit 17a6a30 into jacklam718:master Sep 15, 2016
@aviadhahami
Copy link
Contributor Author

No, not at all.
Sorry for not filing it myself I was at a wedding :)

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.

None yet

2 participants