1
1
import AsyncStorage from "@react-native-async-storage/async-storage" ;
2
2
3
- import React , { Component } from "react" ;
3
+ import React from "react" ;
4
4
import { View , ScrollView , Text , TouchableHighlight } from "react-native" ;
5
-
5
+ import { LinearGradient } from "expo-linear-gradient" ;
6
6
export default class History extends React . Component {
7
7
constructor ( props ) {
8
8
super ( props ) ;
@@ -107,7 +107,20 @@ export default class History extends React.Component {
107
107
historyData . push (
108
108
< TouchableHighlight
109
109
key = { i }
110
- style = { { width : "90%" , marginTop : 10 } }
110
+ style = { {
111
+ width : "90%" ,
112
+ marginTop : 10 ,
113
+ borderRadius : 8 ,
114
+ shadowColor : "#000" ,
115
+ shadowOffset : {
116
+ width : 0 ,
117
+ height : 2 ,
118
+ } ,
119
+ shadowOpacity : 0.25 ,
120
+ shadowRadius : 3.84 ,
121
+ overflow : "hidden" ,
122
+ elevation : 5 ,
123
+ } }
111
124
onPress = { ( ) =>
112
125
this . props . navigation . navigate (
113
126
allData [ i ] [ 1 ] [ "algorithm" ] ,
@@ -116,9 +129,28 @@ export default class History extends React.Component {
116
129
}
117
130
>
118
131
< View
119
- backgroundColor = "black"
120
- style = { { padding : 10 , backgroundColor : "black" } }
132
+ style = { {
133
+ padding : 10 ,
134
+ backgroundColor : "#020b5e" ,
135
+ display : "flex" ,
136
+ alignItems : "flex-start" ,
137
+ justifyContent : "center" ,
138
+ width : "100%" ,
139
+ borderRadius : 8 ,
140
+ overflow : "hidden" ,
141
+ } }
121
142
>
143
+ < LinearGradient
144
+ colors = { [ "#004e92" , "transparent" ] }
145
+ style = { {
146
+ position : "absolute" ,
147
+ left : 0 ,
148
+ right : 0 ,
149
+ top : 0 ,
150
+ height : "100%" ,
151
+ borderRadius : 8 ,
152
+ } }
153
+ />
122
154
< Text style = { { color : "white" } } > { allData [ i ] [ 1 ] [ "date" ] } </ Text >
123
155
< Text style = { { color : "white" } } > { allData [ i ] [ 1 ] [ "algorithm" ] } </ Text >
124
156
</ View >
@@ -131,28 +163,43 @@ export default class History extends React.Component {
131
163
render ( ) {
132
164
const state = this . state ;
133
165
return (
134
- < ScrollView >
166
+ < ScrollView style = { { backgroundColor : "white" } } >
135
167
< View
136
168
style = { {
137
169
display : "flex" ,
138
170
flexDirection : "column" ,
139
171
alignItems : "center" ,
140
172
justifyContent : "center" ,
173
+ paddingBottom : 30 ,
141
174
} }
142
175
>
143
176
< TouchableHighlight
144
- style = { { width : "90%" , marginTop : 10 } }
177
+ style = { {
178
+ width : "90%" ,
179
+ marginTop : 10 ,
180
+ shadowColor : "#000" ,
181
+ shadowOffset : {
182
+ width : 0 ,
183
+ height : 2 ,
184
+ } ,
185
+ shadowOpacity : 0.25 ,
186
+ shadowRadius : 3.84 ,
187
+ overflow : "hidden" ,
188
+ elevation : 5 ,
189
+ } }
145
190
onPress = { this . clearHistory }
146
191
>
147
192
< View
148
193
backgroundColor = "red"
149
194
style = { {
150
195
padding : 10 ,
196
+ backgroundColor : "red" ,
151
197
display : "flex" ,
152
- flexDirection : "column" ,
153
198
alignItems : "center" ,
154
199
justifyContent : "center" ,
155
- backgroundColor : "red" ,
200
+ width : "100%" ,
201
+ borderRadius : 4 ,
202
+ overflow : "hidden" ,
156
203
} }
157
204
>
158
205
< Text style = { { color : "white" , fontWeight : "bold" } } >
0 commit comments