mirror of
https://github.com/laurent22/joplin.git
synced 2024-11-24 08:12:24 +02:00
Mobile: Resolves #503: Share note with other apps
This commit is contained in:
parent
41ba1043be
commit
3494937e34
@ -1,5 +1,5 @@
|
|||||||
const React = require('react'); const Component = React.Component;
|
const React = require('react'); const Component = React.Component;
|
||||||
const { Platform, Clipboard, Keyboard, BackHandler, View, Button, TextInput, WebView, Text, StyleSheet, Linking, Image } = require('react-native');
|
const { Platform, Clipboard, Keyboard, BackHandler, View, Button, TextInput, WebView, Text, StyleSheet, Linking, Image, Share } = require('react-native');
|
||||||
const { connect } = require('react-redux');
|
const { connect } = require('react-redux');
|
||||||
const { uuid } = require('lib/uuid.js');
|
const { uuid } = require('lib/uuid.js');
|
||||||
const RNFS = require('react-native-fs');
|
const RNFS = require('react-native-fs');
|
||||||
@ -409,6 +409,13 @@ class NoteScreenComponent extends BaseScreenComponent {
|
|||||||
this.setState({ noteTagDialogShown: true });
|
this.setState({ noteTagDialogShown: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async share_onPress() {
|
||||||
|
await Share.share({
|
||||||
|
message: this.state.note.title + '\n\n' + this.state.note.body,
|
||||||
|
title: this.state.note.title,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
setAlarm_onPress() {
|
setAlarm_onPress() {
|
||||||
this.setState({ alarmDialogShown: true });
|
this.setState({ alarmDialogShown: true });
|
||||||
}
|
}
|
||||||
@ -468,6 +475,7 @@ class NoteScreenComponent extends BaseScreenComponent {
|
|||||||
output.push({ title: _('Set alarm'), onPress: () => { this.setState({ alarmDialogShown: true }) }});;
|
output.push({ title: _('Set alarm'), onPress: () => { this.setState({ alarmDialogShown: true }) }});;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output.push({ title: _('Share'), onPress: () => { this.share_onPress(); } });
|
||||||
if (isSaved) output.push({ title: _('Tags'), onPress: () => { this.tags_onPress(); } });
|
if (isSaved) output.push({ title: _('Tags'), onPress: () => { this.tags_onPress(); } });
|
||||||
output.push({ title: isTodo ? _('Convert to note') : _('Convert to todo'), onPress: () => { this.toggleIsTodo_onPress(); } });
|
output.push({ title: isTodo ? _('Convert to note') : _('Convert to todo'), onPress: () => { this.toggleIsTodo_onPress(); } });
|
||||||
if (isSaved) output.push({ title: _('Copy Markdown link'), onPress: () => { this.copyMarkdownLink_onPress(); } });
|
if (isSaved) output.push({ title: _('Copy Markdown link'), onPress: () => { this.copyMarkdownLink_onPress(); } });
|
||||||
|
Loading…
Reference in New Issue
Block a user