-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRankingScreen.js
221 lines (202 loc) · 8.83 KB
/
RankingScreen.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
import React ,{Component} from 'react';
import { StyleSheet, Text, View, Image,Dimensions, StatusBar, ScrollView,TouchableWithoutFeedback,TouchableOpacity,ImageBackground,Modal,TouchableHighlight } from 'react-native';
import { Header,Icon,SearchBar,Input,Button } from 'react-native-elements';
import { LinearGradient } from 'expo-linear-gradient';
class RankingScreen extends React.Component {
// TODO タブメニューの実装
static navigationOptions = ({ navigate }) => ({
header: null
})
constructor(props){
super();
this.state = {
nav: 'default',
};
}
render() {
this.searchContents = {
default : <RankingDefault/>,
daily : <RankingDaily/>,
weekly : <RankingWeekly/>,
monthly : <RankingMonthly/>
};
this.navDefault = {width:'25%',height:'100%',padding:'3%'};
this.navSelect = {backgroundColor:'rgba(0,0,0,0.1)',width:'25%',height:'100%',padding:'3%', borderRadius:20};
this.navDefaultText = {color:'white',fontSize:14,textAlign:'center', fontWeight:'bold'};
this.navSelectText = {color:'white',fontSize:14,textAlign:'center'};
return (
<View>
{/* //4Top Nav Tabs */}
<View style={{width:'100%',height:40,flexDirection:'row', borderRadius:20, paddingLeft:'5%', paddingRight:'5%', backgroundColor:'gray'}}>
<TouchableOpacity
key = {0}
style={this.state.nav == 'default' ? this.navSelect : this.navDefault}
onPress={() => {this.setState({nav: 'default'})}}>
<Text style={this.state.nav == 'default' ? this.navSelectText : this.navDefaultText}>All</Text>
</TouchableOpacity>
<TouchableOpacity
key = {1}
style={this.state.nav == 'daily' ? this.navSelect : this.navDefault}
onPress={() => {this.setState({nav: 'daily'})}}>
<Text style={this.state.nav == 'daily' ? this.navSelectText : this.navDefaultText}>Daily</Text>
</TouchableOpacity>
<TouchableOpacity
key = {2}
style={this.state.nav == 'weekly' ? this.navSelect : this.navDefault}
onPress={() => {this.setState({nav: 'weekly'})}}>
<Text style={this.state.nav == 'weekly' ? this.navSelectText : this.navDefaultText}>Weekly</Text>
</TouchableOpacity>
<TouchableOpacity
key = {3}
style={this.state.nav == 'monthly' ? this.navSelect : this.navDefault}
onPress={() => {this.setState({nav: 'monthly'})}}>
<Text style={this.state.nav == 'monthly' ? this.navSelectText : this.navDefaultText}>Monthly</Text>
</TouchableOpacity>
</View>
{this.searchContents[this.state.nav]}
</View>
);
}
}
class RankingDefault extends React.Component{
render(){
return(
<View style={{ alignItems: 'center',justifyContent: 'center', width:'100%', height:'100%'}}>
<ScrollView style={{width:'100%'}}>
<TouchableOpacity
style={{backgroundColor:'rgba(0,0,0,0.1)', width:'100%', height:80, marginBottom:5, flexDirection: 'row', padding:5, borderRadius:20}}
//メッセージの繋ぎこみが一方通行
onPress={() => this.props.navigation.navigate('Send')}>
<View style={{height:'100%',aspectRatio: 1, padding:2,}}>
<Image
source={require('./assets/number-sample3.jpg')}
style={{ width:65, height: 65, borderRadius: 65 / 2}}/>
</View>
<View style={{height:'100%',width:'68%',paddingTop:20,paddingBottom:20,paddingLeft:10}}>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>厄介オタクさんからメッセージが届いています</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{backgroundColor:'rgba(0,0,0,0.1)', width:'100%', height:80, marginBottom:5, flexDirection: 'row', padding:5, borderRadius:20}}
//Todo onPress={() => this.props.navigation.navigate('Myposts')}
>
<View style={{height:'100%',aspectRatio: 1,padding:2}}>
<Image source={require('./assets/instagram-clone-sample.png')} style={{ width:65, height: 65, borderRadius: 65 / 2}}/>
</View>
<View style={{height:'100%',width:'68%',paddingTop:20,paddingBottom:20,paddingLeft:10}}>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>姫の取り巻き</Text>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>さんがあなたの投稿にいいねしました。</Text>
</View>
<View style={{height:'100%',width:'10%',paddingTop:20,paddingBottom:20}}>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{backgroundColor:'rgba(0,0,0,0.1)', width:'100%', height:80, marginBottom:5, flexDirection: 'row', padding:5, borderRadius:20}}
//Todo onPress={() => this.props.navigation.navigate('Users')}
>
<View style={{height:'100%',aspectRatio: 1,padding:2}}>
<Image
source={require('./assets/insta-maid1.jpg')}
style={{ width:65, height: 65, borderRadius: 65 / 2}}
/>
</View>
<View style={{height:'100%',width:'68%',paddingTop:20,paddingBottom:20,paddingLeft:10}}>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>チキン南蛮佐藤</Text>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>さんにフォローされました。</Text>
</View>
<View style={{height:'100%',width:'10%',paddingTop:20,paddingBottom:20}}>
</View>
</TouchableOpacity>
<TouchableOpacity
style={{backgroundColor:'rgba(0,0,0,0.1)', width:'100%', height:80, marginBottom:5, flexDirection: 'row', padding:5, borderRadius:20}}
//Todo onPress={() => this.props.navigation.navigate('Users')}
>
<View style={{height:'100%',aspectRatio: 1,padding:2}}>
<Image
source={require('./assets/insta-loli1.jpg')}
style={{ width:65, height: 65, borderRadius: 65 / 2}}
/>
</View>
<View style={{height:'100%',width:'68%',paddingTop:20,paddingBottom:20,paddingLeft:10}}>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}></Text>
<Text style={{color:'black',fontWeight:'bold',fontSize:14}}>さんにフォローされました。</Text>
</View>
<View style={{height:'100%',width:'10%',paddingTop:20,paddingBottom:20}}>
</View>
</TouchableOpacity>
</ScrollView>
</View>
);
}
}
class RankingDaily extends React.Component{
render(){
return(
<View style={{ alignItems: 'center',justifyContent: 'center', width:'100%', height:'80%'}}>
<Text style ={{fontSize: 16, fontWeight:'bold', color:'gray'}}>Daiy</Text>
</View>
);
}
}
class RankingWeekly extends React.Component{
render(){
return(
<View style={{ alignItems: 'center',justifyContent: 'center', width:'100%', height:'80%'}}>
<Text style ={{fontSize: 16, fontWeight:'bold', color:'gray'}}>weekly</Text>
</View>
);
}
}
class RankingMonthly extends React.Component{
render(){
return(
<View style={{ alignItems: 'center',justifyContent: 'center', width:'100%', height:'80%'}}>
<Text style ={{fontSize: 16, fontWeight:'bold', color:'gray'}}>monthly</Text>
</View>
);
}
}
const styles = StyleSheet.create({
welcomeImages:{
height: Dimensions.get('window').height,
width: Dimensions.get('window').width,
resizeMode: 'cover',
zIndex: 0,
position: 'relative',
},
title:{
alignItems: 'center',
justifyContent: 'center',
color: 'pink',
zIndex: 2,
fontSize:40,
position: 'absolute',
textAlign: 'center',
textAlignVertical: "center",
top:'35%',
left:'30%',
// fontFamily:'insta-font'
},
text:{
position: 'absolute',
height: Dimensions.get('window').height,
width: Dimensions.get('window').width,
backgroundColor:'rgba(0,0,0,0.6)',
},
slide:{
backgroundColor:'rgba(0,0,0,0.6)',
},
image:{
resizeMode: 'contain',
},
carousel:{
// borderRadius:10,
},
storyEnd:{
width:100,
height:100,
backgroundColor:"gray"
}
}
);
export default RankingScreen;