mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
add highlighting for an active item in the snippet list
This commit is contained in:
@@ -5,7 +5,8 @@ var CodeViewer = require('../Components/CodeViewer')
|
|||||||
var SnippetList = React.createClass({
|
var SnippetList = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
snippets: React.PropTypes.array,
|
snippets: React.PropTypes.array,
|
||||||
selectSnippet: React.PropTypes.func
|
selectSnippet: React.PropTypes.func,
|
||||||
|
currentSnippet: React.PropTypes.object
|
||||||
},
|
},
|
||||||
itemClickHandlerFactory: function (snippet) {
|
itemClickHandlerFactory: function (snippet) {
|
||||||
return function () {
|
return function () {
|
||||||
@@ -20,7 +21,7 @@ var SnippetList = React.createClass({
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
return (
|
return (
|
||||||
<li key={snippet.id} onClick={this.itemClickHandlerFactory(snippet)}>
|
<li className={this.props.currentSnippet.id === snippet.id ? 'active' : ''} key={snippet.id} onClick={this.itemClickHandlerFactory(snippet)}>
|
||||||
<div className='callSign'><i className='fa fa-code'></i> {snippet.callSign}</div>
|
<div className='callSign'><i className='fa fa-code'></i> {snippet.callSign}</div>
|
||||||
<div className='description'>{snippet.description}</div>
|
<div className='description'>{snippet.description}</div>
|
||||||
<div className='updatedAt'>{snippet.updatedAt}</div>
|
<div className='updatedAt'>{snippet.updatedAt}</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
.SideNavigator
|
.SideNavigator
|
||||||
absolute top bottom left
|
absolute top bottom left
|
||||||
width 200px
|
width 200px
|
||||||
border-right solid 2px brandColor
|
border-right solid 1px highlightenBorderColor
|
||||||
padding 10px
|
padding 10px
|
||||||
box-sizing border-box
|
box-sizing border-box
|
||||||
.nav-header
|
.nav-header
|
||||||
|
|||||||
@@ -31,6 +31,9 @@
|
|||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
&:hover, &.hover
|
&:hover, &.hover
|
||||||
background-color hoverBackgroundColor
|
background-color hoverBackgroundColor
|
||||||
|
&:active, &.active
|
||||||
|
border solid 2px brandBorderColor
|
||||||
|
padding 9px 9px 8px
|
||||||
|
|
||||||
.SnippetViewer
|
.SnippetViewer
|
||||||
absolute top bottom right
|
absolute top bottom right
|
||||||
|
|||||||
Reference in New Issue
Block a user