Skip to content

Commit c5e779e

Browse files
committed
Update Upload Center
1 parent 8e0fbed commit c5e779e

File tree

5 files changed

+66
-7
lines changed

5 files changed

+66
-7
lines changed

packages/camera/src/components/Capture/hooks.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,25 @@ import log from '../../utils/log';
1111
import getOS from '../../utils/getOS';
1212

1313
const COVERAGE_360_WHITELIST = [
14+
// T-ROCK
1415
'GHbWVnMB', 'GvCtVnoD', 'IVcF1dOP', 'LE9h1xh0',
1516
'PLh198NC', 'UHZkpCuK', 'XyeyZlaU', 'vLcBGkeh',
1617
'Pzgw0WGe', 'EqLDVYj3', 'jqJOb6Ov', 'j3E2UHFc',
1718
'AoO-nOoM', 'B5s1CWT-',
19+
// AUDI A7
20+
'vxRr9chD', // Front Bumper Side Left
21+
'cDe2q69X', // Front Fender Left
22+
'R_f4g8MN', // Doors Left
23+
'vedHBC2n', // Front Roof Left
24+
'McR3TJK0', // Rear Lateral Left
25+
'7bTC-nGS', // Rear Fender Left
26+
'hhCBI9oZ', // Rear
27+
'e_QIW30o', // Rear Fender Right
28+
'fDo5M0Fp', // Rear Lateral Right
29+
'fDKWkHHp', // Doors Right
30+
'5CFsFvj7', // Front Fender Right
31+
'g30kyiVH', // Front Bumper Side Right
32+
'I0cOpT1e', // Front
1833
];
1934

2035
/**

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { View, StyleSheet, Text, Image, TouchableOpacity, ActivityIndicator } fr
44
import { MaterialCommunityIcons } from '@expo/vector-icons';
55

66
import { utils } from '@monkvision/toolkit';
7+
import texts from './texts';
78

89
const { spacing } = utils.styles;
910

@@ -59,6 +60,13 @@ const styles = StyleSheet.create({
5960
alignSelf: 'center',
6061
zIndex: 10,
6162
},
63+
retakeText: {
64+
color: '#fff',
65+
fontSize: 12,
66+
fontWeight: 'bold',
67+
textTransform: 'uppercase',
68+
textAlign: 'center',
69+
},
6270
});
6371

6472
function UploadCard({ compliance, id, label, onRetake, picture, upload }) {
@@ -92,19 +100,19 @@ function UploadCard({ compliance, id, label, onRetake, picture, upload }) {
92100
if (badQuality && iqa.reasons) {
93101
iqa.reasons.forEach((reason, index) => {
94102
const first = index === 0;
95-
reasons.push(first ? reason : `and ${reason}`);
103+
reasons.push(first ? texts[reason] : `and ${texts[reason]}`);
96104
});
97105
}
98106

99107
if (badCoverage && carCov.reasons) {
100108
carCov.reasons.forEach((reason, index) => {
101109
const first = index === 0 && !badQuality;
102-
reasons.push(first ? reason : `and ${reason}`);
110+
reasons.push(first ? texts[reason] : `and ${texts[reason]}`);
103111
});
104112
}
105113

106114
if (reasons.length > 0) {
107-
return `This image has ${reasons.join(' ')}`;
115+
return `This image ${reasons.join(' ')}`;
108116
}
109117
}
110118

@@ -134,6 +142,7 @@ function UploadCard({ compliance, id, label, onRetake, picture, upload }) {
134142
]}
135143
>
136144
<MaterialCommunityIcons name="camera-retake" size={24} color="#FFF" />
145+
<Text style={styles.retakeText}>Retake picture</Text>
137146
</View>
138147
<Image style={styles.image} source={{ uri }} />
139148
</TouchableOpacity>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default {
2+
blurriness: 'is blurry',
3+
underexposure: 'is underexposed (too dark)',
4+
overexposure: 'is overexposed (too bright)',
5+
'TOO_ZOOMED--too zoomed': 'is too zoomed',
6+
'NOT_ZOOMED_ENOUGH--not zoomed enough': 'is too far from vehicle',
7+
'WRONG_ANGLE--wrong angle': 'is taken from incorrect angle',
8+
'UNKNOWN_VIEWPOINT--unknown viewpoint': 'doesn\'t match photo guide',
9+
'WRONG_CENTER_PART--picture centered on the wrong parts': 'is not centered on the right part',
10+
'MISSING_PARTS--missing some parts': 'is missing important car parts',
11+
'HIDDEN_PARTS--some parts not visible enough': 'has some car parts not visible enough',
12+
'NO_CAR_BODY--no car body detected': 'has no car in it',
13+
};

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export default function UploadCenter({
137137
</Text>
138138
<Text style={styles.subtitle}>
139139
Improve image compliance will result to a better AI inspection.
140-
Thank you for your comprehension.
140+
Thank you for your understanding.
141141
</Text>
142142
{unionIds.map((id) => (
143143
<UploadCard
@@ -175,5 +175,5 @@ UploadCenter.defaultProps = {
175175
navigationOptions: {
176176
retakeMaxTry: 1,
177177
},
178-
submitButtonProps: { title: 'Next', onPress: null },
178+
submitButtonProps: { title: 'Skip Retaking', onPress: null },
179179
};

src/screens/InspectionCreate/index.js

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ import useScreen from 'screens/InspectionCreate/useScreen';
77

88
import { Capture, Controls, useUploads, UploadCenter } from '@monkvision/camera';
99

10+
const sightIds = [
11+
'WKJlxkiF', // Beauty Shot
12+
'vxRr9chD', // Front Bumper Side Left
13+
'cDe2q69X', // Front Fender Left
14+
'R_f4g8MN', // Doors Left
15+
'vedHBC2n', // Front Roof Left
16+
'McR3TJK0', // Rear Lateral Left
17+
'7bTC-nGS', // Rear Fender Left
18+
'hhCBI9oZ', // Rear
19+
'e_QIW30o', // Rear Fender Right
20+
'fDo5M0Fp', // Rear Lateral Right
21+
'fDKWkHHp', // Doors Right
22+
'5CFsFvj7', // Front Fender Right
23+
'g30kyiVH', // Front Bumper Side Right
24+
'I0cOpT1e', // Front
25+
'IqwSM3', // Front seats
26+
'rSvk2C', // Dashboard
27+
'rj5mhm', // Back seats
28+
'qhKA2z', // Trunk
29+
];
30+
1031
export default () => {
1132
const route = useRoute();
1233
const { inspectionId } = route.params;
@@ -58,18 +79,19 @@ export default () => {
5879
...Controls.CaptureButtonProps,
5980
}];
6081

61-
const uploads = useUploads({ sightIds: Capture.defaultSightIds });
82+
const uploads = useUploads({ sightIds });
6283

6384
return (
6485
<SafeAreaView>
6586
<Capture
87+
sightIds={sightIds}
6688
inspectionId={inspectionId}
6789
controls={controls}
6890
loading={loading}
6991
uploads={uploads}
7092
renderOnFinish={UploadCenter}
7193
submitButtonProps={{
72-
title: 'Next',
94+
title: 'Skip Retaking',
7395
onPress: handleSuccess,
7496
}}
7597
/>

0 commit comments

Comments
 (0)