-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change scrolling behaviour to lock headers in place
- Loading branch information
Showing
10 changed files
with
188 additions
and
53 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import React from 'react'; | ||
import { connect } from 'react-redux'; | ||
import classNames from 'classnames'; | ||
|
||
import { toggleGridMode } from '../actions/app-actions'; | ||
|
||
class GridModeSelector extends React.Component { | ||
|
||
constructor(props, context) { | ||
super(props, context); | ||
|
||
this.enableGridMode = this.enableGridMode.bind(this); | ||
this.disableGridMode = this.disableGridMode.bind(this); | ||
} | ||
|
||
enableGridMode() { | ||
return this.props.toggleGridMode(true); | ||
} | ||
|
||
disableGridMode() { | ||
return this.props.toggleGridMode(false); | ||
} | ||
|
||
renderItem(icons, isSelected, onClick) { | ||
const className = classNames('network-selector-action', { | ||
'network-selector-action-selected': isSelected | ||
}); | ||
return ( | ||
<div | ||
className={className} | ||
onClick={onClick} > | ||
<span className={icons} style={{fontSize: 16}} /> | ||
</div> | ||
); | ||
} | ||
|
||
render() { | ||
const { gridMode } = this.props; | ||
|
||
return ( | ||
<div className="network-selector"> | ||
<div className="network-selector-wrapper"> | ||
{this.renderItem('fa fa-th', !gridMode, this.disableGridMode)} | ||
{this.renderItem('fa fa-bars', gridMode, this.enableGridMode)} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
gridMode: state.get('gridMode'), | ||
}; | ||
} | ||
|
||
export default connect( | ||
mapStateToProps, | ||
{ toggleGridMode } | ||
)(GridModeSelector); |
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
Oops, something went wrong.