mirror of
https://github.com/timepill/timepill-app.git
synced 2025-04-30 09:59:31 +08:00
修复评论不能复制问题
This commit is contained in:
parent
4cd7a606a8
commit
4815749589
3 changed files with 19 additions and 4 deletions
|
@ -23,7 +23,7 @@
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>30</string>
|
<string>32</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>NSAppTransportSecurity</key>
|
<key>NSAppTransportSecurity</key>
|
||||||
|
|
|
@ -49,7 +49,7 @@ export default class Comment extends Component {
|
||||||
comment.recipient == null
|
comment.recipient == null
|
||||||
? <Text style={localStyle.content}>{comment.content}</Text>
|
? <Text style={localStyle.content}>{comment.content}</Text>
|
||||||
: (
|
: (
|
||||||
<Text style={localStyle.content} selectable={true} selectionColor={Color.textSelect}>
|
<Text style={localStyle.content}>
|
||||||
<Text style={{color: Color.primary}}>@{comment.recipient.name} </Text>
|
<Text style={{color: Color.primary}}>@{comment.recipient.name} </Text>
|
||||||
{comment.content}
|
{comment.content}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
|
@ -8,7 +8,8 @@ import {
|
||||||
View,
|
View,
|
||||||
Alert,
|
Alert,
|
||||||
Keyboard,
|
Keyboard,
|
||||||
DeviceEventEmitter
|
DeviceEventEmitter,
|
||||||
|
Clipboard,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import {Navigation} from 'react-native-navigation';
|
import {Navigation} from 'react-native-navigation';
|
||||||
import {Divider} from "react-native-elements";
|
import {Divider} from "react-native-elements";
|
||||||
|
@ -131,6 +132,17 @@ export default class CommentList extends Component {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onCommentLongPress = (comment) => {
|
||||||
|
ActionSheet.showActionSheetWithOptions({
|
||||||
|
options: ['复制内容', '取消'],
|
||||||
|
cancelButtonIndex: 1,
|
||||||
|
}, (index) => {
|
||||||
|
if (index === 0) {
|
||||||
|
Clipboard.setString(comment.content);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let selfInfo = this.state.selfInfo;
|
let selfInfo = this.state.selfInfo;
|
||||||
|
|
||||||
|
@ -146,7 +158,10 @@ export default class CommentList extends Component {
|
||||||
|
|
||||||
renderItem={({item}) => {
|
renderItem={({item}) => {
|
||||||
return (
|
return (
|
||||||
<Touchable onPress={() => this._onCommentPress(item)}>
|
<Touchable
|
||||||
|
onPress={() => this._onCommentPress(item)}
|
||||||
|
onLongPress={() => this._onCommentLongPress(item)}
|
||||||
|
>
|
||||||
<Comment comment={item}
|
<Comment comment={item}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue