-
Notifications
You must be signed in to change notification settings - Fork 10
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
About page, project sorting and project dropdown in navbar #16
Open
4xdk
wants to merge
11
commits into
EffectiveAF:master
Choose a base branch
from
4xdk:AboutPageAndProjectSorting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c3eb0e2
Adding about project page, project sorting and project selection drop…
cd300d2
fix navbar padding
8eb8fee
Fix page title
709dcca
Bring back mobile menu
8d5c065
Fix mobile menu layout
1f8e53d
reorder navbar project dropdown
4ed7232
use variable for project name
76441ee
Fix for project dropdown in mobile menu
bc270c6
couple more fixes to project dropdown on mobile
daca0d6
project dropdown CSS adjustments
6738470
Merge branch 'master' into AboutPageAndProjectSorting
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.about { | ||
width: 100%; | ||
padding: 0 80px 0 30px; | ||
overflow: auto; | ||
} | ||
|
||
.about h1, h2, h4 { | ||
color: #fcfcfc; | ||
} | ||
|
||
.about h1 { | ||
text-align: center; | ||
} | ||
|
||
@media (max-width: 768px) { | ||
.about { | ||
padding: 0 65px 0 15px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React, { Component } from 'react'; | ||
import { connect } from 'react-redux'; | ||
import './AboutView.css'; | ||
|
||
class AboutView extends Component { | ||
render() { | ||
const {currentPursuanceId, pursuances} = this.props; | ||
const p = (pursuances[currentPursuanceId] !== undefined) ? | ||
pursuances[currentPursuanceId] : ""; | ||
return ( | ||
<div className="content about"> | ||
<h1>About This Pursuance</h1> | ||
<h2>Name: {p.name}</h2> | ||
<h4>Mission: {p.mission}</h4> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default connect(({ currentPursuanceId, pursuances }) => | ||
({ currentPursuanceId, pursuances }) | ||
)(AboutView); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import { DropdownButton, MenuItem } from 'react-bootstrap'; | ||
import { setCurrentPursuance } from '../../../actions'; | ||
|
||
const getCurrentPursuanceName = (pursuances, currentPursuanceId) => { | ||
const rawPursuance = pursuances[currentPursuanceId]; | ||
if (rawPursuance !== undefined) { | ||
return rawPursuance.name; | ||
} else { | ||
return "Jump to a pursuance"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See 136c571 |
||
} | ||
} | ||
|
||
const produceOptions = (pursuances) => { | ||
const pursuanceArr = Object.values(pursuances); | ||
pursuanceArr.sort((p1, p2) => { | ||
return p1.name.toLowerCase().localeCompare(p2.name.toLowerCase()); | ||
}); | ||
|
||
return pursuanceArr.map((pursuance) => ( | ||
<MenuItem | ||
key={pursuance.id} | ||
eventKey={pursuance.id} | ||
value={pursuance.id} | ||
> | ||
{pursuance.name} | ||
</MenuItem> | ||
)); | ||
} | ||
|
||
const onMenuItemSelectAction = (pursuanceId, onMenuItemSelect, history) => { | ||
history.push({ | ||
pathname: `/pursuance/${pursuanceId}` | ||
}); | ||
onMenuItemSelect(pursuanceId); | ||
} | ||
|
||
const renderDropdown = (props) => { | ||
return ( | ||
<div className="nav-pursuances noselect"> | ||
<DropdownButton | ||
id="header-pursuance-dropdown" | ||
title={ getCurrentPursuanceName(props.pursuances, props.currentPursuanceId) } | ||
onSelect={ (pursuanceId) => onMenuItemSelectAction(pursuanceId, props.onMenuItemSelect, props.history) } | ||
> | ||
{ produceOptions(props.pursuances) } | ||
</DropdownButton> | ||
</div> | ||
) | ||
} | ||
|
||
const mapStateToProps = state => { | ||
return { | ||
currentPursuanceId: state.currentPursuanceId, | ||
pursuances: state.pursuances | ||
} | ||
} | ||
|
||
const mapDispatchToProps = dispatch => { | ||
return { | ||
onMenuItemSelect: (pursuanceId) => { | ||
dispatch(setCurrentPursuance(pursuanceId)); | ||
} | ||
} | ||
} | ||
|
||
const JumpToPursuance = connect( | ||
mapStateToProps, | ||
mapDispatchToProps | ||
)(renderDropdown) | ||
|
||
export default JumpToPursuance |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
About This {PROJECT_CAPITAL}