mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 21:57:55 +08:00
d7d5ed2832
Summary: This diff: - Improves the styling of the tabs in the preferences sidebar. - Adds an optional param to section cofnig that puts an "account" submenu beneath the tab item. - Renames preferences "sections" => "tabs", and renames the PreferencesSectionStore to PreferencesUIStore. I think we should include "UI" in more of our stores, and I think "tabs" is a good idea because it's unambigious—there's no way you could confuse it for a "section" of the NylasEnv.config tree or think it deals with actually saving prefs. Test Plan: Inspect visually Reviewers: evan, juan Reviewed By: evan Differential Revision: https://phab.nylas.com/D2296
42 lines
1.4 KiB
CoffeeScript
42 lines
1.4 KiB
CoffeeScript
{PreferencesUIStore, DraftStore} = require 'nylas-exports'
|
|
SignatureDraftExtension = require './signature-draft-extension'
|
|
|
|
module.exports =
|
|
activate: (@state={}) ->
|
|
DraftStore.registerExtension(SignatureDraftExtension)
|
|
|
|
@preferencesTab = new PreferencesUIStore.TabItem
|
|
# TODO: Fix RetinaImg to handle plugin images
|
|
icon: ->
|
|
if process.platform is "win32"
|
|
"nylas://composer-signature/images/ic-settings-signatures-win32@2x.png"
|
|
else
|
|
"nylas://composer-signature/images/ic-settings-signatures@2x.png"
|
|
tabId: "Signatures"
|
|
displayName: "Signatures"
|
|
component: require "./preferences-signatures"
|
|
|
|
# TODO Re-enable when fixed!
|
|
# PreferencesUIStore.registerPreferencesTab(@preferencesTab)
|
|
|
|
## TODO
|
|
# PreferencesUIStore.registerPreferences "composer-signatures", [
|
|
# {
|
|
# section: PreferencesUIStore.Section.Signatures
|
|
# type: "richtext"
|
|
# label: "Signature:"
|
|
# perAccount: true
|
|
# defaultValue: "- Sent from N1"
|
|
# }, {
|
|
# section: PreferencesUIStore.Section.Signatures
|
|
# type: "toggle"
|
|
# label: "Include on replies"
|
|
# defaultValue: true
|
|
# }
|
|
# ]
|
|
|
|
deactivate: ->
|
|
DraftStore.unregisterExtension(SignatureDraftExtension)
|
|
PreferencesUIStore.unregisterPreferencesTab(@preferencesTab.sectionId)
|
|
|
|
serialize: -> @state
|