RateLine.js
2.98 KB
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
import React, {useEffect} from 'react';
import { Surface, Text,Divider} from 'react-native-paper';
import { View,StyleSheet } from 'react-native';
import {connect} from 'react-redux';
import {load } from '../../reducers/search';
import PromptSearchRate from '../PromptSearch/PromptSearchRate';
const RateLine = ({load,pastRecords }) => {
useEffect(()=>{
const get = async () => {
await load();
}
get();
}, [load]);
return (
<Surface style={styles.surface}>
{pastRecords.length ?
<>
<Text style={styles.info}>점수 변화</Text>
<View style={styles.scoreContainer}>
{pastRecords.map((past,index)=> (
<View key={index} style={styles.past}>
<Text style={styles.score}>{past.score}</Text>
<<<<<<< HEAD
<Text style={styles.date}>{past.date.substring(5,7)+'/'+past.date.substring(8,10)}</Text>
</View>
))}
</View>
<Text style={styles.message}>당신의 점수 변화를 확인하세요!</Text>
=======
<Text style={styles.day}>{past.date.substring(5,7)+'/'+past.date.substring(8,10)}</Text>
</View>
))}
</View>
<Text style={styles.message}>당신의 점수 변화를 확인해 보세요!</Text>
>>>>>>> master
</>
: <PromptSearchRate />
}
</Surface>
);
}
const styles = StyleSheet.create({
surface: {
padding: 8,
flex: 0.3,
width: '95%',
alignItems: 'center',
justifyContent: 'center',
elevation: 2,
marginTop: 10,
marginBottom: 10,
<<<<<<< HEAD
borderRadius: 5,
},
info:{
fontSize:22,
marginBottom: 5,
fontFamily:"Bold",
},
score:{
fontSize:20,
fontFamily:"Bold",
=======
borderRadius: 5
},
info:{
fontSize:23,
fontWeight:'bold',
marginBottom: 5,
},
score:{
fontSize:20,
color:"#002857"
>>>>>>> master
},
scoreContainer:{
flexDirection:'row',
justifyContent: 'space-around',
width:'100%'
},
<<<<<<< HEAD
data:{
fontSize:10,
textAlign:'center',
fontFamily:"Regular",
=======
day:{
fontSize: 10,
textAlign:'center',
marginBottom:5
>>>>>>> master
},
past:{
alignItems:'center',
marginBottom:5
},
message:{
<<<<<<< HEAD
fontFamily:"Son",
marginTop : 10,
fontSize: 20,
=======
margin: 5,
color:"#6e8fb4"
>>>>>>> master
}
});
const RateLineContainer = ( {load,pastRecords } ) => (
<RateLine load={load} pastRecords={pastRecords} />
);
export default connect(
({search})=>({
pastRecords:search.pastRecords
}),
{
load
}
)(RateLineContainer);