1
1
import React , { useEffect , useMemo , useState } from 'react' ;
2
- import { ScrollView , Text , StyleSheet , Button , TouchableOpacity , useWindowDimensions , View } from 'react-native' ;
2
+ import { ScrollView , Text , StyleSheet , Button , useWindowDimensions , View } from 'react-native' ;
3
3
import PropTypes from 'prop-types' ;
4
4
5
5
import { utils } from '@monkvision/toolkit' ;
@@ -31,10 +31,9 @@ const styles = StyleSheet.create({
31
31
fontSize : 12 ,
32
32
} ,
33
33
button : {
34
- width : '100%' ,
34
+ margin : spacing ( 1 ) ,
35
35
borderRadius : 4 ,
36
36
padding : spacing ( 1.4 ) ,
37
- marginVertical : spacing ( 0.6 ) ,
38
37
} ,
39
38
loadingLayout : {
40
39
width : '100%' ,
@@ -45,6 +44,11 @@ const styles = StyleSheet.create({
45
44
cardsLayout : {
46
45
marginTop : spacing ( 2 ) ,
47
46
} ,
47
+ actions : {
48
+ display : 'flex' ,
49
+ flexDirection : 'row' ,
50
+ justifyContent : 'flex-start' ,
51
+ } ,
48
52
} ) ;
49
53
50
54
const getItemById = ( id , array ) => array . find ( ( item ) => item . id === id ) ;
@@ -70,7 +74,7 @@ export default function UploadCenter({
70
74
71
75
const { ids, state } = useComplianceIds ( { navigationOptions, ...states } ) ;
72
76
73
- const { handldeRetakeAll , handleRetake, handleReupload } = useHandlers ( {
77
+ const { handleRetakeAll , handleRetake, handleReUpload } = useHandlers ( {
74
78
inspectionId,
75
79
task,
76
80
onRetakeAll,
@@ -158,7 +162,7 @@ export default function UploadCenter({
158
162
< UploadCard
159
163
key = { `uploadCard-${ id } ` }
160
164
onRetake = { handleRetake }
161
- onReupload = { handleReupload }
165
+ onReupload = { handleReUpload }
162
166
id = { id }
163
167
label = { getItemById ( id , sights . state . tour ) . label }
164
168
picture = { sights . state . takenPictures [ id ] }
@@ -170,23 +174,22 @@ export default function UploadCenter({
170
174
</ View >
171
175
172
176
{ /* actions */ }
173
- < Button
174
- style = { styles . button }
175
- title = { submitButtonLabel }
176
- onPress = { onComplianceCheckFinish }
177
- disabled = { isSubmitting || hasAllRejected }
178
- />
179
-
180
- < TouchableOpacity
181
- onPress = { handldeRetakeAll }
182
- style = { styles . button }
183
- disabled = { ! hasFulfilledAllUploads }
184
- >
185
- < Text style = { { textAlign : 'center' , color : '#274B9F' } } >
186
- { `RETAKE ALL (${ ids . length } )` }
187
- </ Text >
188
- </ TouchableOpacity >
189
-
177
+ < View style = { styles . actions } >
178
+ < Button
179
+ color = "#36b0c2"
180
+ style = { styles . button }
181
+ title = { submitButtonLabel }
182
+ onPress = { onComplianceCheckFinish }
183
+ disabled = { isSubmitting || hasAllRejected || ! hasFulfilledAllUploads }
184
+ />
185
+ < Button
186
+ color = "#274B9F"
187
+ onPress = { handleRetakeAll }
188
+ style = { styles . button }
189
+ disabled = { ! hasFulfilledAllUploads }
190
+ title = { `Retake all (${ ids . length } )` }
191
+ />
192
+ </ View >
190
193
</ ScrollView >
191
194
) ;
192
195
0 commit comments