Skip to content

Commit ae7f12a

Browse files
committed
Add interior sight masks
1 parent 8b864fb commit ae7f12a

File tree

54 files changed

+605
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+605
-203
lines changed

packages/react-native-views/src/components/ActivityIndicatorView/index.jsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import PropTypes from 'prop-types';
23

34
import { utils } from '@monkvision/react-native';
45

@@ -14,10 +15,18 @@ const styles = StyleSheet.create({
1415
},
1516
});
1617

17-
export default function ActivityIndicatorView() {
18+
export default function ActivityIndicatorView({ hideIndicator }) {
1819
return (
1920
<View style={styles.root}>
20-
<ActivityIndicator color="white" />
21+
{!hideIndicator && <ActivityIndicator color="white" />}
2122
</View>
2223
);
2324
}
25+
26+
ActivityIndicatorView.propTypes = {
27+
hideIndicator: PropTypes.bool,
28+
};
29+
30+
ActivityIndicatorView.defaultProps = {
31+
hideIndicator: false,
32+
};

packages/react-native-views/src/components/CameraView/index.jsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,21 @@ export default function CameraView({
7979

8080
const { activeSight, count, nextSightProps } = useSights(sights);
8181

82+
const handleFakeActivity = useCallback((onEnd = noop) => {
83+
const fakeActivityId = setTimeout(() => {
84+
setFakeActivity(null);
85+
onEnd();
86+
}, 500);
87+
88+
setFakeActivity(fakeActivityId);
89+
90+
return () => { clearTimeout(fakeActivityId); };
91+
}, []);
92+
8293
// PICTURES
8394
const handleTakePicture = useCallback(async () => {
95+
handleFakeActivity();
96+
8497
if (camera) {
8598
const options = { quality: 1 };
8699
const picture = await camera.takePictureAsync(options);
@@ -99,7 +112,7 @@ export default function CameraView({
99112
nextSightProps.onPress();
100113
}
101114
}
102-
}, [activeSight, camera, nextSightProps, onTakePicture, pictures]);
115+
}, [activeSight, camera, handleFakeActivity, nextSightProps, onTakePicture, pictures]);
103116

104117
// UI
105118
const { colors } = useTheme();
@@ -108,17 +121,6 @@ export default function CameraView({
108121
onShowAdvice(pictures);
109122
};
110123

111-
const handleFakeActivity = useCallback((onEnd = noop) => {
112-
const fakeActivityId = setTimeout(() => {
113-
setFakeActivity(null);
114-
onEnd();
115-
}, 500);
116-
117-
setFakeActivity(fakeActivityId);
118-
119-
return () => { clearTimeout(fakeActivityId); };
120-
}, []);
121-
122124
const [visibleSnack, setVisibleSnack] = useState(false);
123125

124126
const toggleSnackBar = () => setVisibleSnack((prev) => !prev);
@@ -132,10 +134,6 @@ export default function CameraView({
132134
const handleCameraReady = useCallback(setCamera, [setCamera]);
133135

134136
// EFFECTS
135-
useEffect(() => {
136-
handleFakeActivity();
137-
}, [activeSight.id, handleFakeActivity]);
138-
139137
useEffect(() => {
140138
const picturesTaken = Object.values(pictures).filter((p) => Boolean(p.source)).length;
141139
if (count === picturesTaken) {
@@ -233,5 +231,10 @@ CameraView.defaultProps = {
233231
['abstractMiddleLateralLeft', [null, 90, null], 'middle side left'],
234232
['abstractFrontLateralLeft', [null, 60, null], 'front side left'],
235233
['abstractFrontLeft', [null, 30, null], 'front left'],
234+
['vin', [null, null, null], 'VIN'],
235+
['abstractInteriorFront', [null, null, null], 'interior front'],
236+
['abstractBoard', [null, null, null], 'board'],
237+
['abstractInteriorBack', [null, null, null], 'interior back'],
238+
['abstractTrunk', [null, null, null], 'trunk'],
236239
],
237240
};

packages/react-native/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
"lodash.isboolean": "^3.0.3",
5151
"lodash.isempty": "^4.4.0",
5252
"lodash.isplainobject": "^4.0.6",
53-
"lodash.kebabcase": "^4.1.1",
5453
"lodash.noop": "^3.0.1",
55-
"lodash.upperfirst": "^4.3.1",
5654
"react-native-animation-library": "^0.0.8",
5755
"react-native-xml2js": "^1.0.3",
5856
"tinycolor2": "^1.4.2",

packages/react-native/src/assets/sightMasks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ export { default as abstractRearLateralRight } from './sightMasks/abstract-rear-
1111
export { default as abstractRearLeft } from './sightMasks/abstract-rear-left.png';
1212
export { default as abstractRearRight } from './sightMasks/abstract-rear-right.png';
1313
export { default as vin } from './sightMasks/vin.png';
14+
export { default as abstractInteriorFront } from './sightMasks/abstract-interior-front.png';
15+
export { default as abstractInteriorBack } from './sightMasks/abstract-interior-back.png';
16+
export { default as abstractTrunk } from './sightMasks/abstract-trunk.png';
17+
export { default as abstractBoard } from './sightMasks/abstract-board.png';

packages/react-native/src/assets/sightMasks.native.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ export const abstractRearLateralRight = require('./sightMasks/abstract-rear-late
1212
export const abstractRearLeft = require('./sightMasks/abstract-rear-left.png');
1313
export const abstractRearRight = require('./sightMasks/abstract-rear-right.png');
1414
export const vin = require('./sightMasks/vin.png');
15+
export const abstractInteriorFront = require('./sightMasks/abstract-interior-front.png');
16+
export const abstractInteriorBack = require('./sightMasks/abstract-interior-front.png');
17+
export const abstractTrunk = require('./sightMasks/abstract-interior-front.png');
18+
export const abstractBoard = require('./sightMasks/abstract-interior-front.png');
19.3 KB
Loading
Lines changed: 33 additions & 0 deletions
Loading
18.3 KB
Loading
Lines changed: 12 additions & 0 deletions
Loading
21.5 KB
Loading

0 commit comments

Comments
 (0)