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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"react-dom": "^15.6.1",
"react-icons": "^2.2.7",
"react-markdown": "^2.5.0",
"react-modal": "^3.4.5",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-toastify": "^2.2.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/Content/Pursuance/PursuancePage.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
order: 1;
}


@media (max-width: 1279px) {
#pursuance-page {
padding-left: 0;
Expand Down
34 changes: 18 additions & 16 deletions src/components/Content/Pursuance/PursuancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?


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

componentWillMount() {
let { setCurrentPursuance, match, currentPursuanceId } = this.props;
currentPursuanceId = Number(match.params.pursuanceId) || currentPursuanceId;
Expand All @@ -20,21 +21,22 @@ class PursuancePage extends Component {

render() {
return (
<Router>
<div id="pursuance-page" className="content-ctn">
<nav id="pursuance-nav">
<PursuanceMenu />
</nav>
<article>
<Switch>
<Route exact path="/pursuance/:pursuanceId" component={TaskListView} />
<Route exact path="/pursuance/:pursuanceId/tasks" component={TaskListView} />
<Route exact path="/pursuance/:pursuanceId/calendar" component={CalendarView} />
<Route exact path="/pursuance/:pursuanceId/discuss/task/:taskGid" component={DiscussView} />
<Route exact path="/pursuance/:pursuanceId/participants" component={ParticipantsView} />
</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

<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}

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}
  ...
  />

<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

</nav>
<article>
<Switch>
<Route exact path="/pursuance/:pursuanceId" component={TaskListView} />
<Route exact path="/pursuance/:pursuanceId/tasks" component={TaskListView} />
<Route exact path="/pursuance/:pursuanceId/calendar" component={CalendarView} />
<Route exact path="/pursuance/:pursuanceId/discuss/task/:taskGid" component={DiscussView} />
<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

</div>
</Router>
);
Expand Down