-
Notifications
You must be signed in to change notification settings - Fork 0
/
load.js
126 lines (103 loc) · 3.59 KB
/
load.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
import React, { Component } from "react";
import { View, Text, Button, StyleSheet, ScrollView } from 'react-native';
const style = StyleSheet.create({
container: {
backgroundColor: '#B9BFFF',
flex: 1,
margin : 20
},
text: {
fontSize: 30,
color: '#21610B',
textAlign: 'center'
},
Button: {
color: 'black',
fontSize: 40,
},
input: {
height: 40,
margin: 50,
borderWidth: 5,
padding: 10,
color: 'black'
},
box : {
margin: 20,
backgroundColor:'white',
}
})
const Load_post = (props) =>{
const new_arr = []
const len = props.item.length
console.log("************ Load의 state.id의 : " , (props.id))
console.log("************ Load의 state.item의 : " , (props.item))
console.log("************ Load의 state.item의 : " , (props.item[0]))
let a = "2022.02.24"
let b = a.replace('.','');
console.log("test :", b)
for(var i = 0 ; i< len ; i++){
if(!props.item[i].Link){
var Link = "매칭 완료"
}else{
var Link = " 상대를 찾는중"
}
new_arr.push([ " 날짜: ", props.item[i].Date,"시간 : ",props.item[i].Time," 나이 : " , props.item[i].Age," 연락처: ", props.item[i].Contact,
" 수준: ", props.item[i].Level , " 장소: ", props.item[i].Place, " 유니폼: ", props.item[i].Uniform, " 매치 성사 여부: " , Link
])
}
return(
new_arr.map((id,idx)=>( // id : 요소값 idx : 인덱스
<View style = {style.container} key={idx}>
<View style = {style.box}>
<Text style = {{color : 'black'}}> {id} </Text>
</View>
</View>
))
)
}
const Load_post2 = (props) =>{
const new_arr = []
const new_arr2 = []
const new_arr3 = []
const len = props.item.length
for(var i = 0 ; i< len ; i++){
if(!props.item[i].Link){
var Link = "매칭 완료"
}else{
var Link = " 상대를 찾는중"
}
new_arr.push([ " 날짜: ", props.item[i].Date,"시간 : ",props.item[i].Time," 나이 : " , props.item[i].Age," 연락처: ", props.item[i].Contact,
" 수준: ", props.item[i].Level , " 장소: ", props.item[i].Place, " 유니폼: ", props.item[i].Uniform, " 매치 성사 여부: " , Link
])
}
console.log("new_arr : ",new_arr)
console.log("알아보기 : ",new_arr[0][1])
console.log("len : " , len)
for(var j = 0 ; j<len ; j++){
new_arr2.push(new_arr[j][1].replace('.',''))
}
console.log("정렬 전 new_arr2 : " ,new_arr2)
console.log("정렬 후 new_arr2 : " ,new_arr2.sort())
console.log("정렬 후 new_arr2 : " ,new_arr2)
for(var i = 0 ; i<len ; i++){
for(var j = 0 ; j<len ; j++){
if(new_arr2[i]==new_arr[j][1].replace('.','')){
new_arr3.push(new_arr[j])
}
}
}
const Result_ = new Set(new_arr3)
const Result = [...Result_]
console.log("정렬이 완료된 결과 :",Result)
return(
Result.map((id,idx)=>( // id : 요소값 idx : 인덱스
<View style = {style.container} key={idx}>
<View style = {style.box}>
<Text style = {{color : 'black'}}> {id} </Text>
</View>
</View>
))
)
}
export default Load_post2 ;