Skip to content

Commit 2ec7571

Browse files
authored
Fixed wrong vehicle part labels (#904)
* Fixed wrong vehicle part labels * Fixed orientation translation => DamageDisclosure
1 parent 98ffc07 commit 2ec7571

File tree

3 files changed

+16
-33
lines changed

3 files changed

+16
-33
lines changed

packages/common/src/i18n/translations/vehicleParts.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@ export const vehiclePartLabels: Record<VehiclePart, TranslationObject> = {
2424
},
2525
[VehiclePart.DOOR_BACK_LEFT]: {
2626
en: 'Rear Door Left',
27-
fr: 'Portière arrière droite',
28-
de: 'Tür hinten rechts',
27+
fr: 'Portière arrière gauche',
28+
de: 'Tür hinten links',
2929
nl: 'Achterdeur links',
3030
},
3131
[VehiclePart.DOOR_BACK_RIGHT]: {
3232
en: 'Rear Door Right',
33-
fr: 'Portière arrière gauche',
34-
de: 'Tür hinten links',
33+
fr: 'Portière arrière droite',
34+
de: 'Tür hinten rechts',
3535
nl: 'Achterdeur rechts',
3636
},
3737
[VehiclePart.DOOR_FRONT_LEFT]: {
3838
en: 'Front Door Left',
39-
fr: 'Portière avant droite',
40-
de: 'Vordertür rechts',
39+
fr: 'Portière avant gauche',
40+
de: 'Tür vorne links',
4141
nl: 'Voordeur links',
4242
},
4343
[VehiclePart.DOOR_FRONT_RIGHT]: {
4444
en: 'Front Door Right',
45-
fr: 'Portière avant gauche',
46-
de: 'Tür vorne links',
45+
fr: 'Portière avant droite',
46+
de: 'Tür vorne rechts',
4747
nl: 'Voordeur rechts',
4848
},
4949
[VehiclePart.FENDER_BACK_LEFT]: {

packages/inspection-capture-web/src/DamageDisclosure/DamageDisclosure.tsx

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
import { useAnalytics } from '@monkvision/analytics';
22
import { Camera, CameraHUDProps, CameraProps } from '@monkvision/camera-web';
3-
import {
4-
useI18nSync,
5-
useLoadingState,
6-
useObjectMemo,
7-
useWindowDimensions,
8-
} from '@monkvision/common';
9-
import { BackdropDialog, Icon, InspectionGallery } from '@monkvision/common-ui-web';
3+
import { useI18nSync, useLoadingState, useObjectMemo } from '@monkvision/common';
4+
import { BackdropDialog, InspectionGallery } from '@monkvision/common-ui-web';
105
import { MonkApiConfig } from '@monkvision/network';
116
import {
127
AddDamage,
138
CameraConfig,
149
PhotoCaptureAppConfig,
1510
ComplianceOptions,
1611
CompressionOptions,
17-
DeviceOrientation,
1812
ImageType,
1913
MonkPicture,
2014
VehicleType,
@@ -115,7 +109,6 @@ export function DamageDisclosure({
115109
});
116110
const { t } = useTranslation();
117111
const [currentScreen, setCurrentScreen] = useState(CaptureScreen.CAMERA);
118-
const dimensions = useWindowDimensions();
119112
const analytics = useAnalytics();
120113
const loading = useLoadingState();
121114
const handleOpenGallery = () => {
@@ -161,9 +154,6 @@ export function DamageDisclosure({
161154
const handleGalleryBack = () => {
162155
setCurrentScreen(CaptureScreen.CAMERA);
163156
};
164-
const isViolatingEnforcedOrientation =
165-
enforceOrientation &&
166-
(enforceOrientation === DeviceOrientation.PORTRAIT) !== dimensions.isPortrait;
167157
const hudProps: Omit<DamageDisclosureHUDProps, keyof CameraHUDProps> = {
168158
inspectionId,
169159
mode: addDamageHandle.mode,
@@ -181,22 +171,12 @@ export function DamageDisclosure({
181171
addDamage,
182172
onValidateVehicleParts: addDamageHandle.handleValidateVehicleParts,
183173
vehicleType,
174+
enforceOrientation,
184175
};
185176

186177
return (
187178
<div style={styles['container']}>
188-
{currentScreen === CaptureScreen.CAMERA && isViolatingEnforcedOrientation && (
189-
<div style={styles['orientationErrorContainer']}>
190-
<div style={styles['orientationErrorTitleContainer']}>
191-
<Icon icon='rotate' primaryColor='text-primary' size={30} />
192-
<div style={styles['orientationErrorTitle']}>{t('photo.orientationError.title')}</div>
193-
</div>
194-
<div style={styles['orientationErrorDescription']}>
195-
{t('photo.orientationError.description')}
196-
</div>
197-
</div>
198-
)}
199-
{currentScreen === CaptureScreen.CAMERA && !isViolatingEnforcedOrientation && (
179+
{currentScreen === CaptureScreen.CAMERA && (
200180
<Camera
201181
HUDComponent={DamageDisclosureHUD}
202182
onPictureTaken={handlePictureTaken}

packages/inspection-capture-web/src/DamageDisclosure/DamageDisclosureHUD/DamageDisclosureHUD.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@ import { CaptureMode } from '../../types';
1717
import { HUDButtons } from '../../components/HUDButtons';
1818
import { DamageDisclosureHUDElements } from './DamageDisclosureHUDElements';
1919
import { HUDOverlay } from '../../components/HUDOverlay';
20+
import { OrientationEnforcer } from '../../components';
2021

2122
/**
2223
* Props of the DamageDisclosureHUD component.
2324
*/
2425
export interface DamageDisclosureHUDProps
2526
extends CameraHUDProps,
26-
Pick<PhotoCaptureAppConfig, 'addDamage' | 'showCloseButton'> {
27+
Pick<PhotoCaptureAppConfig, 'addDamage' | 'showCloseButton' | 'enforceOrientation'> {
2728
/**
2829
* The inspection ID.
2930
*/
@@ -105,6 +106,7 @@ export function DamageDisclosureHUD({
105106
loading,
106107
handle,
107108
cameraPreview,
109+
enforceOrientation,
108110
images,
109111
vehicleType,
110112
}: DamageDisclosureHUDProps) {
@@ -179,6 +181,7 @@ export function DamageDisclosureHUD({
179181
onCancel={() => setShowCloseModal(false)}
180182
onConfirm={handleCloseConfirm}
181183
/>
184+
<OrientationEnforcer orientation={enforceOrientation} />
182185
</div>
183186
);
184187
}

0 commit comments

Comments
 (0)