11import { useAnalytics } from '@monkvision/analytics' ;
22import { 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' ;
105import { MonkApiConfig } from '@monkvision/network' ;
116import {
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 }
0 commit comments