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

Issue #44. Added React Modal! #206

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

greg-han
Copy link

Added a Modal!
Update Removed JS event listeners, and added an in-react-component listener.
Changed some of the styling and also added responsiveness to the media queries in pusruancepage.css.

</table>
</div>
</div>
</ReactModal>
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Please indent properly so it's clear which tags are nested inside other tags. Use 2 spaces of indentation per level.

@@ -21,13 +21,52 @@
order: 1;
}

.Modal{
position: absolute; top: 120px; left: 60px; right: 60px; bottom: 60px; border: 1px solid rgb(204, 204, 204); background: rgb(255, 255, 255); overflow: auto; border-radius: 10px; outline: none; padding: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han One CSS rule per line, please 👍

@greg-han
Copy link
Author

Just fixed these issues.

<div className="column one-half">
<table className="keyboard-mappings">
<tbody>
j <tr>
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Stray j

</tbody> </table>
</div>
</div>
</ReactModal>
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Turn this into its own component and then use it here just like PursuanceMenu or the like is used -- like this: <PursuanceMenu /> (rather than putting all the code in-line).

Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Sorry for all the changes, but the React way of doing things is very different from the vanilla JS way.

Copy link
Author

@greg-han greg-han Jun 28, 2018

Choose a reason for hiding this comment

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

No problem, I appreciate the feedback!
Thanks for helping me improve.
Do you want the component on PursuancePage.js or in it's own js file such as Modal.js?

greg-han added 2 commits June 30, 2018 21:24
…ance page. Looks much cleaner and is the reacty way of doing it
<RightPanel />
</article>
<Router>
<div id="pursuance-page" className="content-ctn" onKeyDown={(event) => {this.child.handleKeyDown(event);}} tabIndex="0">
Copy link
Contributor

Choose a reason for hiding this comment

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

onKeyDown={(event) => {this.child.handleKeyDown(event);}}

can be just

onKeyDown={(event) => this.child.handleKeyDown(event)}

or in this case -- even simpler -- just

onKeyDown={this.child.handleKeyDown}

<div id="pursuance-page" className="content-ctn" onKeyDown={(event) => {this.child.handleKeyDown(event);}} tabIndex="0">
<ShortcutsModal ref={instance => { this.child = instance; }} />
<nav id="pursuance-nav">
<PursuanceMenu />
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Please indent 2 spaces per level at to show the structure of the HTML/JSX


class PursuancePage extends Component {

Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Whitespace

Copy link

Choose a reason for hiding this comment

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

Hey @elimisteve, I think you should totally leverage prettier on those tedious stuffs, I can think a PR later

</Switch>
<RightPanel />
</article>
<Router>
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han This line shouldn't be different; check whitespace

<RightPanel />
</article>
<Router>
<div id="pursuance-page" className="content-ctn" onKeyDown={(event) => {this.child.handleKeyDown(event);}} tabIndex="0">
Copy link
Contributor

Choose a reason for hiding this comment

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

Break down long lines like this to look more like:

<div
  id="pursuance-page"
  className="content-ctn"
  onKeyDown={this.child.handleKeyDown}
  ...
  />

<Route exact path="/pursuance/:pursuanceId/participants" component={ParticipantsView} />
</Switch>
<RightPanel />
</article>
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han None of these lines should be different; check whitespace

@@ -9,9 +9,10 @@ import DiscussView from './views/DiscussView';
import ParticipantsView from './views/ParticipantsView';
import RightPanel from '../RightPanel/RightPanel';
import './PursuancePage.css';
import ShortcutsModal from '../ShortcutsModal/ShortcutsModal';
Copy link
Contributor

Choose a reason for hiding this comment

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

@greg-han Looks like you forgot to git add ShortcutsModal, yes?

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.

3 participants