-
Notifications
You must be signed in to change notification settings - Fork 0
/
Home.js
158 lines (147 loc) · 3.3 KB
/
Home.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
import React, { Component } from "react";
import { Actions } from "react-native-router-flux";
import { Text, View, StyleSheet, Alert, Button } from "react-native";
import { Agenda } from "react-native-calendars";
import {
Container,
Header,
Content,
Footer,
FooterTab,
Button as Btn,
Icon,
Badge,
Left,
Right,
} from "native-base";
import Drawer from 'react-native-drawer'
class Application extends Component {
closeControlPanel = () => {
this._drawer.close()
};
openControlPanel = () => {
this._drawer.open()
};
render () {
return (
<Drawer
ref={(ref) => this._drawer = ref}
content={<ControlPanel />}
>
<MainView />
</Drawer>
)
}
}
const goToAbout = () => {
Actions.about();
};
export default class Home extends Component {
constructor(props) {
super(props);
this.state = {
items: {
"2017-06-14": [
{
height: 50,
name: "0614"
}
],
"2017-06-17": [
{
height: 50,
name: "0617"
}
]
},
data: [],
tempDate: ""
};
}
updateDate(temp) {
this.setState({ tempDate: temp });
}
render() {
return (
<Container>
<Header>
<Left><Btn><Icon name="settings" /></Btn></Left>
<Text>전체 일정보기</Text>
<Right>
<Btn><Icon name="search" /></Btn>
<Btn><Icon name="menu" /></Btn>
</Right>
</Header>
{/* <Content> */}
<Agenda
items={this.state.items}
onDayPress={this.onDayPress.bind(this)}
// loadItemsForMonth={this.loadItems.bind(this)}
selected={"2017-06-16"}
renderItem={this.renderItem.bind(this)}
renderEmptyData={this.renderEmptyData.bind(this)}
rowHasChanged={this.rowHasChanged.bind(this)}
/>
{/* </Content> */}
<Footer class="footer" backgroundColor="blue">
<FooterTab>
<Btn badge vertical>
<Badge><Text>2</Text></Badge>
<Icon name="home" />
<Text>Apps</Text>
</Btn>
<Btn active vertical>
<Icon name="home"/>
<Text>홈</Text>
</Btn>
<Btn vertical>
<Icon name="people" />
<Text>커뮤니티</Text>
</Btn>
</FooterTab>
</Footer>
</Container>
);
}
onDayPress(day) {
const temp = day.dateString;
this.updateDate(temp);
}
renderItem(item) {
// console.log(item)
return (
<View style={[styles.item, { height: item.height }]}>
<Text>{item.name}</Text>
<Button title="일정 수정" onPress={goToAbout} />
</View>
);
}
renderEmptyData() {
return (
<View style={styles.emptyDate}>
<Button title="일정 추가" onPress={goToAbout} />
</View>
);
}
rowHasChanged(r1, r2) {
return r1.name !== r2.name;
}
}
const styles = StyleSheet.create({
item: {
backgroundColor: "lightgray",
flex: 1,
borderRadius: 5,
padding: 10,
marginRight: 10,
marginTop: 17
},
emptyDate: {
height: 15,
flex: 1,
paddingTop: 30
},
Container: {
backgroundColor: 'red',
}
})