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

refactor: replace storage item component with common component

This commit is contained in:
sota1235
2016-12-30 19:13:38 +09:00
parent d65464401c
commit b18b1171e7
2 changed files with 15 additions and 16 deletions

View File

@@ -4,6 +4,7 @@
import React, { PropTypes } from 'react'
import styles from './StorageItem.styl'
import CSSModules from 'browser/lib/CSSModules'
import { isNumber } from 'lodash'
/**
* @param {boolean} isActive
@@ -33,7 +34,7 @@ const StorageItem = ({
>
{isFolded ? folderName.substring(0, 1) : folderName}
</span>
{!isFolded &&
{(!isFolded && isNumber(noteCount)) &&
<span styleName='folderList-item-noteCount'>{noteCount}</span>
}
{isFolded &&
@@ -51,7 +52,7 @@ StorageItem.propTypes = {
folderName: PropTypes.string.isRequired,
folderColor: PropTypes.string,
isFolded: PropTypes.bool.isRequired,
noteCount: PropTypes.number.isRequired,
noteCount: PropTypes.number,
}
export default CSSModules(StorageItem, styles)