From adddc7f2a4a2b3276adb4a8d3da1eaeb1b995106 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 5 Jul 2019 13:55:13 +0200 Subject: [PATCH] Better seperation --- demo/App.js | 2 -- lib/src/components/DevTool/Console/Input.js | 9 +++++--- lib/src/components/DevTool/Console/index.js | 8 +++---- lib/src/components/DevTool/Requests/index.js | 6 +++-- lib/src/components/DevTool/index.js | 23 ++++++++++++-------- lib/src/components/data/Log.js | 7 +++--- lib/src/components/data/requests.js | 7 +++--- lib/src/console.js | 12 +++++----- lib/src/index.js | 2 -- lib/src/log.js | 10 +++++++++ 10 files changed, 50 insertions(+), 36 deletions(-) diff --git a/demo/App.js b/demo/App.js index 50ce944..890fe0f 100644 --- a/demo/App.js +++ b/demo/App.js @@ -14,12 +14,10 @@ import { log, network, show, - context, } from 'react-native-debug-console'; network.attach(); log.attach(); -context.hello = () => 'earth'; console.log('fooo'); let xhr = new XMLHttpRequest(); diff --git a/lib/src/components/DevTool/Console/Input.js b/lib/src/components/DevTool/Console/Input.js index 5ecd9a2..ecb9862 100644 --- a/lib/src/components/DevTool/Console/Input.js +++ b/lib/src/components/DevTool/Console/Input.js @@ -5,8 +5,7 @@ import { TextInput, } from 'react-native'; import styled from 'styled-components/native'; -import { context } from '../../../console'; -import log from '../../../log'; +import { createContext } from '../../../console'; import Icon from '../../base/Icon'; const Button = styled.TouchableOpacity` @@ -33,6 +32,7 @@ const styles = StyleSheet.create({ }); const Input = ({ + provider, logs, }) => { const [text, setText] = useState(''); @@ -79,6 +79,9 @@ const Input = ({