1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-12 17:26:17 +00:00

Add Pin to NoteItemSimple

This commit is contained in:
Kazu Yokomizo
2017-12-12 02:27:44 +09:00
parent 9bc3d65554
commit eececf8a93
3 changed files with 16 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ import styles from './NoteItemSimple.styl'
* @param {Function} handleNoteContextMenu
* @param {Function} handleDragStart
*/
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu, handleDragStart }) => (
const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu, handleDragStart, pathname }) => (
<div styleName={isActive
? 'item-simple--active'
: 'item-simple'
@@ -30,6 +30,10 @@ const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu
? <i styleName='item-simple-title-icon' className='fa fa-fw fa-code' />
: <i styleName='item-simple-title-icon' className='fa fa-fw fa-file-text-o' />
}
{note.isPinned && !pathname.match(/\/home|\/starred|\/trash/)
? <i styleName='item-pin' className='fa fa-thumb-tack' />
: ''
}
{note.title.trim().length > 0
? note.title
: <span styleName='item-simple-title-empty'>Empty</span>

View File

@@ -50,6 +50,7 @@ $control-height = 30px
.item-simple-title
font-size 13px
height 40px
padding-right 20px
box-sizing border-box
line-height 24px
padding-top 8px
@@ -67,6 +68,15 @@ $control-height = 30px
font-weight normal
color $ui-inactive-text-color
.item-pin
position absolute
right 0px
top 12px
color #E54D42
font-size 14px
padding 0
border-radius 17px
body[data-theme="white"]
.item-simple
background-color $ui-white-noteList-backgroundColor

View File

@@ -717,6 +717,7 @@ class NoteList extends React.Component {
handleNoteContextMenu={this.handleNoteContextMenu.bind(this)}
handleNoteClick={this.handleNoteClick.bind(this)}
handleDragStart={this.handleDragStart.bind(this)}
pathname={location.pathname}
/>
)
})