1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Add conditions to hide pin from /home, /starred or /trash

This commit is contained in:
asmsuechan
2017-10-13 13:12:41 +09:00
parent 0e312ba929
commit f3370242bf
2 changed files with 13 additions and 4 deletions

View File

@@ -45,7 +45,7 @@ const TagElementList = (tags) => {
* @param {Function} handleDragStart
* @param {string} dateDisplay
*/
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart }) => (
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleDragStart, handleNoteContextMenu, pathname }) => (
<div styleName={isActive
? 'item--active'
: 'item'
@@ -72,7 +72,7 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
{note.isStarred
? <i styleName='item-star' className='fa fa-star' /> : ''
}
{note.isPinned
{note.isPinned && !pathname.match(/\/home|\/starred|\/trash/)
? <i styleName='item-pin' className='fa fa-map-pin' /> : ''
}
{note.type === 'MARKDOWN_NOTE'