From 26ef911c2d7b205e52002e0dbf2ea43eb18289ba Mon Sep 17 00:00:00 2001 From: Leandru Martin Date: Tue, 4 Jul 2023 15:05:46 -0500 Subject: [PATCH] Relocated database and form to a separate screen --- src/App.js | 2 ++ src/screens/Home/index.js | 1 - src/screens/Home/src/components/Database.js | 5 +++ src/screens/PlantsScreen.js | 38 +++++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/screens/PlantsScreen.js diff --git a/src/App.js b/src/App.js index 868546e..887b415 100644 --- a/src/App.js +++ b/src/App.js @@ -9,6 +9,7 @@ import HomeScreen from './screens/Home'; import App_2 from './screens/Home/src/components/mqttfile'; import store from './redux/store'; import { Provider } from 'react-redux'; +import PlantsScreen from './screens/PlantsScreen'; const Tab = createBottomTabNavigator(); @@ -19,6 +20,7 @@ const App = () => { + diff --git a/src/screens/Home/index.js b/src/screens/Home/index.js index bb9e2d0..51390e5 100644 --- a/src/screens/Home/index.js +++ b/src/screens/Home/index.js @@ -37,7 +37,6 @@ const HomeScreen = () => { - diff --git a/src/screens/Home/src/components/Database.js b/src/screens/Home/src/components/Database.js index 46cca1a..dcbc3be 100644 --- a/src/screens/Home/src/components/Database.js +++ b/src/screens/Home/src/components/Database.js @@ -149,6 +149,8 @@ export default class Database extends React.Component { title="Clear data" onPress={this.handleClear} > + + {JSON.stringify(this.state.data)} ); } @@ -213,6 +215,9 @@ const styles = { borderWidth: 2, minWidth: 300, }, + text: { + maxWidth: 300, + }, errorText: { color: 'red', maxWidth: 300, diff --git a/src/screens/PlantsScreen.js b/src/screens/PlantsScreen.js new file mode 100644 index 0000000..ee53716 --- /dev/null +++ b/src/screens/PlantsScreen.js @@ -0,0 +1,38 @@ +import React from 'react'; +import { + View, + Text, + Button, + StyleSheet, + ScrollView, + TouchableWithoutFeedback, + Keyboard, + KeyboardAvoidingView, + Platform, +} from 'react-native'; +import Database from './Home/src/components/Database'; + +const styles = StyleSheet.create({ + container: { + flex: 1, + alignItems: 'center', + justifyContent: 'center', + }, +}); + +const PlantsScreen = () => { + return ( + + + + + + + + ); +}; + +export default PlantsScreen;