const { connect } = require('react-redux'); import { AppState } from '../app.reducer'; import { _ } from '@joplin/lib/locale'; import { clipboard } from 'electron'; import Button from './Button/Button'; import { Fragment } from 'react'; import { accountTypeToString } from '@joplin/lib/utils/joplinCloud/types'; import bridge from '../services/bridge'; type JoplinCloudConfigScreenProps = { inboxEmail: string; joplinCloudAccountType: number; userEmail: string; joplinCloudWebsite: string; }; const JoplinCloudConfigScreen = (props: JoplinCloudConfigScreenProps) => { const copyToClipboard = () => { clipboard.writeText(props.inboxEmail); }; const isEmailToNoteAvailableInAccount = props.joplinCloudAccountType !== 1; const goToJoplinCloudProfile = async () => { await bridge().openExternal(`${props.joplinCloudWebsite}/users/me`); }; return (

{_('Account information')}

{_('Account type')} {accountTypeToString(props.joplinCloudAccountType)}
{_('Email')} {props.userEmail}

{_('Email to note')}

{_('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')}

{ isEmailToNoteAvailableInAccount ?

{props.inboxEmail}

); }; const mapStateToProps = (state: AppState) => { return { inboxEmail: state.settings['sync.10.inboxEmail'], joplinCloudAccountType: state.settings['sync.10.accountType'], userEmail: state.settings['sync.10.userEmail'], joplinCloudWebsite: state.settings['sync.10.website'], }; }; export default connect(mapStateToProps)(JoplinCloudConfigScreen);