|
1 | 1 | import React, { Component } from 'react'; |
2 | | -import { TextInput, FlatList, Text, StyleSheet, View, TouchableOpacity } from 'react-native'; |
| 2 | +import { TextInput, FlatList, Text, StyleSheet, View, TouchableOpacity,Clipboard,TouchableWithoutFeedback,Alert } from 'react-native'; |
3 | 3 | import event from './event'; |
4 | 4 | import { debounce } from './tool'; |
5 | 5 |
|
@@ -169,20 +169,29 @@ class Log extends Component { |
169 | 169 | if (this.state.filterLevel && this.state.filterLevel != item.method) return null; |
170 | 170 | if (this.state.filterValue && this.regInstance && !this.regInstance.test(item.data)) return null; |
171 | 171 | return ( |
172 | | - <View style={styles.logItem}> |
173 | | - <View style={{ flexDirection: 'row' }}> |
174 | | - <View style={{ flex: 0.8 }}> |
175 | | - <Text style={styles.logItemTime}>{item.index}</Text> |
176 | | - </View> |
177 | | - <View style={{ flex: 0.8 }}> |
178 | | - <Text style={styles.logItemTime}>{item.method}</Text> |
179 | | - </View> |
180 | | - <View style={{ flex: 2 }}> |
181 | | - <Text style={styles.logItemTime}>{item.time}</Text> |
| 172 | + <TouchableWithoutFeedback |
| 173 | + onLongPress={() => { |
| 174 | + try { |
| 175 | + Clipboard.setString(`${item.data}\r\n\r\nLight up the little star and support me.\r\nhttps://github.com/itenl/react-native-vdebug`); |
| 176 | + Alert.alert('Info', 'Copy successfully', [{ text: 'OK' }]); |
| 177 | + } catch (error) {} |
| 178 | + }} |
| 179 | + > |
| 180 | + <View style={styles.logItem}> |
| 181 | + <View style={{ flexDirection: 'row' }}> |
| 182 | + <View style={{ flex: 0.8 }}> |
| 183 | + <Text style={styles.logItemTime}>{item.index}</Text> |
| 184 | + </View> |
| 185 | + <View style={{ flex: 0.8 }}> |
| 186 | + <Text style={styles.logItemTime}>{item.method}</Text> |
| 187 | + </View> |
| 188 | + <View style={{ flex: 2 }}> |
| 189 | + <Text style={styles.logItemTime}>{item.time}</Text> |
| 190 | + </View> |
182 | 191 | </View> |
| 192 | + <Text style={[styles.logItemText, styles[item.method]]}>{item.data}</Text> |
183 | 193 | </View> |
184 | | - <Text style={[styles.logItemText, styles[item.method]]}>{item.data}</Text> |
185 | | - </View> |
| 194 | + </TouchableWithoutFeedback> |
186 | 195 | ); |
187 | 196 | } |
188 | 197 |
|
|
0 commit comments