mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-06 03:14:39 +08:00
Disable signature image upload if you are signed out of Mailspring ID
This commit is contained in:
parent
30ef802f84
commit
dae008534b
1 changed files with 26 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { localized, PropTypes, MailspringAPIRequest } from 'mailspring-exports';
|
||||
import { localized, PropTypes, MailspringAPIRequest, IdentityStore } from 'mailspring-exports';
|
||||
import { RetinaImg, DropZone } from 'mailspring-component-kit';
|
||||
|
||||
const MAX_IMAGE_RES = 250;
|
||||
|
@ -157,6 +157,8 @@ export default class SignaturePhotoPicker extends React.Component<
|
|||
// we don't display the <input> for data URLs because they can be
|
||||
// long and the UI becomes slow.
|
||||
const isMailspringURL = resolvedURL && resolvedURL.includes('getmailspring.com');
|
||||
const isUploadEnabled = IdentityStore.identity() !== null;
|
||||
|
||||
const dropNote =
|
||||
resolvedURL && resolvedURL !== ''
|
||||
? localized('Click to replace')
|
||||
|
@ -169,6 +171,7 @@ export default class SignaturePhotoPicker extends React.Component<
|
|||
<div className="field photo-picker">
|
||||
<label>Picture</label>
|
||||
<div style={{ display: 'flex' }}>
|
||||
{isUploadEnabled && (
|
||||
<div>
|
||||
<DropZone
|
||||
onClick={this._onChooseImage}
|
||||
|
@ -189,6 +192,7 @@ export default class SignaturePhotoPicker extends React.Component<
|
|||
)}
|
||||
</DropZone>
|
||||
</div>
|
||||
)}
|
||||
<div className="photo-options">
|
||||
<select
|
||||
id="photoURL"
|
||||
|
@ -223,7 +227,7 @@ export default class SignaturePhotoPicker extends React.Component<
|
|||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="drop-note">{dropNote}</div>
|
||||
{isUploadEnabled && <div className="drop-note">{dropNote}</div>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue