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>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>30</string>
|
||||
<string>32</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
|
|
|
@ -49,7 +49,7 @@ export default class Comment extends Component {
|
|||
comment.recipient == null
|
||||
? <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>
|
||||
{comment.content}
|
||||
</Text>
|
||||
|
|
|
@ -8,7 +8,8 @@ import {
|
|||
View,
|
||||
Alert,
|
||||
Keyboard,
|
||||
DeviceEventEmitter
|
||||
DeviceEventEmitter,
|
||||
Clipboard,
|
||||
} from 'react-native';
|
||||
import {Navigation} from 'react-native-navigation';
|
||||
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() {
|
||||
let selfInfo = this.state.selfInfo;
|
||||
|
||||
|
@ -146,7 +158,10 @@ export default class CommentList extends Component {
|
|||
|
||||
renderItem={({item}) => {
|
||||
return (
|
||||
<Touchable onPress={() => this._onCommentPress(item)}>
|
||||
<Touchable
|
||||
onPress={() => this._onCommentPress(item)}
|
||||
onLongPress={() => this._onCommentLongPress(item)}
|
||||
>
|
||||
<Comment comment={item}
|
||||
{...this.props}
|
||||
|
||||
|
|
Loading…
Reference in a new issue