mirror of
https://github.com/morten-olsen/react-native-debug-console.git
synced 2026-02-08 00:36:26 +01:00
Misc
This commit is contained in:
@@ -2,15 +2,14 @@ import React from 'react';
|
||||
import {
|
||||
StyleSheet,
|
||||
View,
|
||||
Clipboard,
|
||||
Alert,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
} from 'react-native';
|
||||
import network from '../../../network';
|
||||
import State from '../../data/State';
|
||||
import Network from '../../data/Network';
|
||||
import Toolbar from '../../base/Toolbar';
|
||||
import Toolbar, {
|
||||
Button,
|
||||
Seperator,
|
||||
} from '../../base/Toolbar';
|
||||
import Details from './Details';
|
||||
import List from './List';
|
||||
|
||||
@@ -27,7 +26,7 @@ const styles = StyleSheet.create({
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
|
||||
let i = 0;
|
||||
const Console = () => (
|
||||
<State>
|
||||
{({
|
||||
@@ -38,22 +37,14 @@ const Console = () => (
|
||||
const selected = active >= 0 ? requests[active] : undefined;
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<Toolbar
|
||||
items={[{
|
||||
name: 'Download',
|
||||
icon: 'download',
|
||||
onPress: () => {
|
||||
Clipboard.setString(JSON.stringify(requests, null, ' '));
|
||||
Alert.alert(
|
||||
'Copied to clipboard',
|
||||
);
|
||||
},
|
||||
}, {
|
||||
name: 'Clear',
|
||||
icon: 'trash',
|
||||
onPress: () => network.clear(),
|
||||
}]}
|
||||
/>
|
||||
<Toolbar>
|
||||
<Seperator />
|
||||
<Button
|
||||
name="Clear"
|
||||
icon="trash"
|
||||
onPress={() => network.clear()}
|
||||
/>
|
||||
</Toolbar>
|
||||
<List
|
||||
selected={selected ? selected.id : undefined}
|
||||
requests={requests}
|
||||
|
||||
Reference in New Issue
Block a user