mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-10 02:03:07 +08:00
feat(labels): replace account sidebar icon with proper image
This commit is contained in:
parent
98ad2e6ebc
commit
feac0d1b8a
3 changed files with 14 additions and 3 deletions
|
@ -47,10 +47,20 @@ class AccountSidebarCategoryItem extends React.Component
|
|||
onDragStateChange={ ({isDropping}) => @setState({isDropping}) }
|
||||
onDrop={@_onDrop}>
|
||||
{unread}
|
||||
<RetinaImg name={"#{@props.item.name}.png"} fallback={'folder.png'} mode={RetinaImg.Mode.ContentIsMask} />
|
||||
|
||||
{@_renderIcon()}
|
||||
<span className="name"> {@props.item.displayName}</span>
|
||||
</DropZone>
|
||||
|
||||
_renderIcon: ->
|
||||
if @props.sectionType is "category" and NamespaceStore.current()
|
||||
if NamespaceStore.current().usesLabels()
|
||||
<RetinaImg name={"tag.png"} mode={RetinaImg.Mode.ContentIsMask} />
|
||||
else
|
||||
<RetinaImg name={"folder.png"} mode={RetinaImg.Mode.ContentIsMask} />
|
||||
else if @props.sectionType is "mailboxes"
|
||||
<RetinaImg name={"#{@props.item.name}.png"} fallback={'folder.png'} mode={RetinaImg.Mode.ContentIsMask} />
|
||||
|
||||
_shouldAcceptDrop: (e) =>
|
||||
return false if @props.item.name in CategoryStore.LockedCategoryNames
|
||||
return false if @props.item.name is FocusedCategoryStore.categoryName()
|
||||
|
|
|
@ -60,7 +60,7 @@ class AccountSidebarStore extends NylasStore
|
|||
@_sections = []
|
||||
if featureSheets.length > 0
|
||||
@_sections.push { label: '', items: featureSheets, type: 'sheet' }
|
||||
@_sections.push { label: 'Mailboxes', items: standardCategories, type: 'category' }
|
||||
@_sections.push { label: 'Mailboxes', items: standardCategories, type: 'mailboxes' }
|
||||
@_sections.push { label: 'Views', items: extraSheets, type: 'sheet' }
|
||||
@_sections.push { label: CategoryStore.categoryLabel(), items: userCategories, type: 'category' }
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class AccountSidebar extends React.Component
|
|||
|
||||
_itemComponents: (section) =>
|
||||
section.items?.map (item) =>
|
||||
if section.type is 'category'
|
||||
if section.type is 'mailboxes' or section.type is 'category'
|
||||
itemClass = AccountSidebarCategoryItem
|
||||
else if section.type is 'sheet'
|
||||
itemClass = item.sidebarComponent ? SidebarSheetItem
|
||||
|
@ -52,6 +52,7 @@ class AccountSidebar extends React.Component
|
|||
<itemClass
|
||||
key={item.id ? item.type}
|
||||
item={item}
|
||||
sectionType={section.type}
|
||||
select={item.id is @state.selected?.id }/>
|
||||
|
||||
_onStoreChange: =>
|
||||
|
|
Loading…
Reference in a new issue