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

Room header and copy link #34

Merged
merged 5 commits into from
Aug 8, 2017
Merged

Room header and copy link #34

merged 5 commits into from
Aug 8, 2017

Conversation

hyjk2000
Copy link
Member

@hyjk2000 hyjk2000 commented Aug 1, 2017

This resolves #25.

@hyjk2000 hyjk2000 requested a review from just4fun August 2, 2017 03:52
@@ -9,13 +9,13 @@ class Join extends Component {
};
}

handleChange = (e) => {
handleChange = (e) => { // eslint-disable-line
Copy link
Member

Choose a reason for hiding this comment

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

In this way, we will always add eslint-disable-line to bypass this line.

If you don't like .bind(this), I think we can move () => into component like onSubmit={() => this.handleSubmit()}.

Copy link
Member Author

@hyjk2000 hyjk2000 Aug 2, 2017

Choose a reason for hiding this comment

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

This is false-positive, and strangely it doesn't happen every time or on every machine, please check out the issue I mentioned in the PR description. This is a bug of eslint or babel-eslint and it should be fixed in the future.

As for workarounds, there are many of them, including binding them manually in constructor. Actually the method you gave looks less appealing than that, and it seems won't work. handleSubmit is still not bound to the class context. I'll try this when I got time.

}
}

const defaultTooltip = 'Click to copy link';
Copy link
Member

Choose a reason for hiding this comment

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

Let's move the const to the top, then we can see it easily.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm... I put it at the bottom because this is how React Native Tutorial done with the style declaration. I'm okay with either place, top or bottom.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's put it to the top as we usually did like this in FE routine work.


input {
position: absolute;
left: -99999px;
Copy link
Member

Choose a reason for hiding this comment

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

I know why you mentioned it's hacky now...

Could we use other hacky way instead of setting the left to a strange value?

Copy link
Member Author

@hyjk2000 hyjk2000 Aug 2, 2017

Choose a reason for hiding this comment

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

I'll try those ways we discussed about, but frankly, they look pretty much the same to me. 😉

Copy link
Member

Choose a reason for hiding this comment

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

OK, not a big problem, just think -99999px is not good looking.

Copy link
Member Author

Choose a reason for hiding this comment

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

<input> needs to be visible for this trick to work, and by visible it means it cannot be display: none or visibility: hidden. opacity: 0 and/or width: 0; height: 0 works, but does not look any less hacky. Actually, kicking elements off screen like this is a common trick used in front end development for years.

@just4fun just4fun merged commit 1e9324b into master Aug 8, 2017
@just4fun just4fun deleted the room-header-and-link branch August 8, 2017 09:02
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.

Display participants count and sharing link
2 participants