Skip to content

Commit 859c561

Browse files
committed
Small update on upload center
1 parent e9f6c4f commit 859c561

File tree

1 file changed

+25
-22
lines changed
  • packages/camera/src/components/UploadCenter

1 file changed

+25
-22
lines changed

packages/camera/src/components/UploadCenter/index.js

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
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';
33
import PropTypes from 'prop-types';
44

55
import { utils } from '@monkvision/toolkit';
@@ -31,10 +31,9 @@ const styles = StyleSheet.create({
3131
fontSize: 12,
3232
},
3333
button: {
34-
width: '100%',
34+
margin: spacing(1),
3535
borderRadius: 4,
3636
padding: spacing(1.4),
37-
marginVertical: spacing(0.6),
3837
},
3938
loadingLayout: {
4039
width: '100%',
@@ -45,6 +44,11 @@ const styles = StyleSheet.create({
4544
cardsLayout: {
4645
marginTop: spacing(2),
4746
},
47+
actions: {
48+
display: 'flex',
49+
flexDirection: 'row',
50+
justifyContent: 'flex-start',
51+
},
4852
});
4953

5054
const getItemById = (id, array) => array.find((item) => item.id === id);
@@ -70,7 +74,7 @@ export default function UploadCenter({
7074

7175
const { ids, state } = useComplianceIds({ navigationOptions, ...states });
7276

73-
const { handldeRetakeAll, handleRetake, handleReupload } = useHandlers({
77+
const { handleRetakeAll, handleRetake, handleReUpload } = useHandlers({
7478
inspectionId,
7579
task,
7680
onRetakeAll,
@@ -158,7 +162,7 @@ export default function UploadCenter({
158162
<UploadCard
159163
key={`uploadCard-${id}`}
160164
onRetake={handleRetake}
161-
onReupload={handleReupload}
165+
onReupload={handleReUpload}
162166
id={id}
163167
label={getItemById(id, sights.state.tour).label}
164168
picture={sights.state.takenPictures[id]}
@@ -170,23 +174,22 @@ export default function UploadCenter({
170174
</View>
171175

172176
{/* 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>
190193
</ScrollView>
191194
);
192195

0 commit comments

Comments
 (0)