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:
@@ -1,12 +1,11 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components/native';
|
||||
import {
|
||||
Clipboard,
|
||||
Alert,
|
||||
} from 'react-native';
|
||||
import Storage from '../../data/Storage';
|
||||
import State from '../../data/State';
|
||||
import Toolbar from '../../base/Toolbar';
|
||||
import Toolbar, {
|
||||
Button,
|
||||
Seperator,
|
||||
} from '../../base/Toolbar';
|
||||
import Keys from './Keys';
|
||||
import Value from './Value';
|
||||
|
||||
@@ -20,31 +19,25 @@ const StorageView = () => (
|
||||
<Storage>
|
||||
{(data, update, removeItem, clear) => (
|
||||
<Wrapper>
|
||||
<Toolbar
|
||||
items={[{
|
||||
name: 'Download',
|
||||
icon: 'download',
|
||||
onPress: () => {
|
||||
Clipboard.setString(JSON.stringify(data, null, ' '));
|
||||
Alert.alert(
|
||||
'Copied to clipboard',
|
||||
);
|
||||
},
|
||||
}, {
|
||||
name: 'Refresh',
|
||||
icon: 'reload',
|
||||
onPress: update,
|
||||
}, {
|
||||
name: 'Clear',
|
||||
icon: 'trash',
|
||||
onPress: clear,
|
||||
}, {
|
||||
name: 'Delete',
|
||||
icon: 'remove',
|
||||
disabled: !selected,
|
||||
onPress: () => removeItem(selected),
|
||||
}]}
|
||||
/>
|
||||
<Toolbar>
|
||||
<Seperator />
|
||||
<Button
|
||||
name="Refresh"
|
||||
icon="reload"
|
||||
onPress={update}
|
||||
/>
|
||||
<Button
|
||||
name="Clear"
|
||||
icon="trash"
|
||||
onPress={clear}
|
||||
/>
|
||||
<Button
|
||||
name="Delete"
|
||||
icon="remove"
|
||||
disabled={!selected}
|
||||
onPress={() => removeItem(selected)}
|
||||
/>
|
||||
</Toolbar>
|
||||
<Keys
|
||||
selected={selected}
|
||||
onSelect={(key) => setState({ selected: key })}
|
||||
|
||||
Reference in New Issue
Block a user