1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop, Mobile: Display a message when Joplin Cloud user don't have access to email to note feature (#10322)

This commit is contained in:
pedr
2024-04-18 10:29:49 -03:00
committed by GitHub
parent ed9b4fb831
commit a4137a83d8
4 changed files with 42 additions and 5 deletions

View File

@@ -345,6 +345,7 @@ class ConfigScreenComponent extends BaseScreenComponent<ConfigScreenProps, Confi
description={options?.description}
statusComponent={options?.statusComp}
styles={this.styles()}
disabled={options?.disabled}
/>
);
}
@@ -513,18 +514,27 @@ class ConfigScreenComponent extends BaseScreenComponent<ConfigScreenProps, Confi
if (section.name === 'joplinCloud') {
const label = _('Email to note');
const description = _('Any email sent to this address will be converted into a note and added to your collection. The note will be saved into the Inbox notebook');
const isEmailToNoteAvailableInAccount = this.props.settings['sync.10.accountType'] !== 1;
const inboxEmailValue = isEmailToNoteAvailableInAccount ? this.props.settings['sync.10.inboxEmail'] : '-';
addSettingComponent(
<View key="joplinCloud">
<View style={this.styles().styleSheet.settingContainerNoBottomBorder}>
<Text style={this.styles().styleSheet.settingText}>{label}</Text>
<Text style={this.styles().styleSheet.settingTextEmphasis}>{this.props.settings['sync.10.inboxEmail']}</Text>
<Text style={this.styles().styleSheet.settingTextEmphasis}>{inboxEmailValue}</Text>
</View>
{
!isEmailToNoteAvailableInAccount && (
<View style={this.styles().styleSheet.settingContainerNoBottomBorder}>
<Text style={this.styles().styleSheet.descriptionAlert}>{_('Your account doesn\'t have access to this feature')}</Text>
</View>
)
}
{
this.renderButton(
'sync.10.inboxEmail',
_('Copy to clipboard'),
() => Clipboard.setString(this.props.settings['sync.10.inboxEmail']),
{ description },
() => isEmailToNoteAvailableInAccount && Clipboard.setString(this.props.settings['sync.10.inboxEmail']),
{ description, disabled: !isEmailToNoteAvailableInAccount },
)
}
</View>,