이윤영

Modify complete

import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
export default class HomeTab extends Component {
render() {
return (
<View style={style.container}>
<Text>HistoryTab</Text>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
import WasteDetail from '../WasteDetail'
export default class HomeTab extends Component {
render() {
return (
<View style={style.container}>
<Text>HomeTab</Text>
<WasteDetail></WasteDetail>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
}
});
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
export default class HomeTab extends Component {
render() {
return (
<View style={style.container}>
<Text>SettingTab</Text>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
}
});
import React, { Component } from 'react';
import { StyleSheet, Platform, View, Text } from 'react-native';
import { createAppContainer } from 'react-navigation';
import { createMaterialTopTabNavigator } from 'react-navigation-tabs'
import HomeTab from './AppTabNavigator/HomeTab'
import HistoryTab from './AppTabNavigator/HistoryTab'
import SettingTab from './AppTabNavigator/SettingTab'
// 하단 탭 네비게이터 생성
const AppTabNavigator = createMaterialTopTabNavigator({
Home: { screen: HomeTab },
History: { screen: HistoryTab },
Setting: { screen: SettingTab }
},{
animationEnabled: true,
swipeEnabled: true,
tabBarPosition: "bottom",
tabBarOptions: {
style: {
...Platform.select({
android:{
backgroundColor:'white',
}
})
},
iconStyle: { height: 10 },
activeTintColor: '#000',
inactiveTintColor: '#d1cece',
upperCaseLabel: true,
showLabel: true,
showIcon: true,
}
});
const AppTabContainet = createAppContainer(AppTabNavigator);
export default class MainScreen extends Component {
static navigationOptions = {
title: 'FW IOT' }
render() {
return <AppTabContainet/>; // AppTabContainet 컴포넌트를 리턴한다.
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
});
import React, { Component } from 'react';
import { View, Text, StyleSheet } from 'react-native';
export default class HomeTab extends Component {
render() {
return (
<View style={style.container}>
<Text> 3.8kg 추가</Text>
</View>
);
}
}
const style = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "rgba(230,230,230,0.5)"
}
});
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { View, Text, StyleSheet,ScrollView, RefreshControl } from 'react-native';
import HistoryGraph from '../component/HistoryGraph'
import SegmentedControlTab from "react-native-segmented-control-tab";
import {get_id, add_data, get_week_data, get_month_data, get_year_data} from'../component/DBhelper.js';
import {get_id, add_data, get_week_data, get_month_data, get_year_data, get_recent_date} from'../component/DBhelper.js';
//var today = new Date();
//today.setHours(today.getHours()+9);
......@@ -68,7 +68,7 @@ export default class HomeTab extends Component {
},
body:JSON.stringify({
ras_id : this.state.ID,
date : "1576339901541",
date : String(get_recent_date()),
}),
})
.then((response) => response.json())
......
......@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { View, Text, StyleSheet, SafeAreaView, ScrollView, Image } from 'react-native';
import Circle from '../component/circle_component'
import {Table, TableWrapper, Row,Rows} from 'react-native-table-component'
import {get_now_weight, get_today_data, add_data ,get_id} from'../component/DBhelper.js';
import {get_now_weight, get_today_data, add_data ,get_id, get_recent_date} from'../component/DBhelper.js';
var date = new Date();
date.setHours(date.getHours()+9);
......@@ -41,7 +41,7 @@ export default class HomeTab extends Component {
},
body:JSON.stringify({
ras_id : this.state.ID,
date : "1576648647000",
date : String(get_recent_date()),
}),
})
.then((response) => response.json())
......@@ -83,7 +83,7 @@ export default class HomeTab extends Component {
<Text style={style.history}>Today's History</Text>
<Table>
<TableWrapper>
<Row data={['시간', '', '총량']} flexArr={[1, 1, 1]} textStyle={style.row_style1}/>
<Row data={['시간', '', '총량']} flexArr={[1, 1, 1]} textStyle={style.row_style1}/>
<Rows data={this.state.table_contents} flexArr={[1, 1, 1]} textStyle={style.row_style2}/>
</TableWrapper>
......
......@@ -57,8 +57,6 @@ export default class Login extends Component {
onChangeText={(text) => {this.setState({ID:text})}}
/>
<LoginButton
//onPress={()=>{this.getdata}}
//onPress={() =>{ this.props.navigation.navigate('MainScreen', { ID: this.state.ID });}}
onPress={() =>{ this.getdata().then(()=>{this.props.navigation.navigate('MainScreen', { ID: this.state.ID })}) }}
/>
</View>
......
......@@ -49,7 +49,7 @@ export default class MainScreen extends Component {
render() {
registerID(this.state.ID);
return <AppTabContainer/>; // AppTabContainet 컴포넌트를 리턴한다.
return <AppTabContainer/>; // AppTabContainer 컴포넌트를 리턴한다.
}
}
......