Skip to content

Commit 98ffc07

Browse files
authored
Fixed PhotoCapture tutorial portrait behavior (#903)
1 parent 68caf5a commit 98ffc07

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed

apps/demo-app/src/components/AppRouter.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
Page,
77
PhotoCapturePage,
88
VehicleTypeSelectionPage,
9+
CaptureSelectionPage,
10+
DamageDisclosurePage,
911
} from '../pages';
1012
import { App } from './App';
11-
import { CaptureSelectionPage } from '../pages/CaptureSelectionPage';
12-
import { DamageDisclosurePage } from '../pages/DamageDisclosurePage';
1313

1414
export function AppRouter() {
1515
return (

apps/demo-app/src/pages/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ export * from './LoginPage';
33
export * from './CreateInspectionPage';
44
export * from './PhotoCapturePage';
55
export * from './VehicleTypeSelectionPage';
6+
export * from './CaptureSelectionPage';
7+
export * from './DamageDisclosurePage';

packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDElementsSight/SightSlider/SightSlider.styles.ts

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const styles: Styles = {
1919
__media: { portrait: true },
2020
bottom: `${PHOTO_CAPTURE_HUD_BUTTONS_BAR_WIDTH * 1.5}px`,
2121
right: 0,
22+
paddingLeft: '30%',
2223
paddingRight: '45%',
2324
},
2425
button: {

packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.styles.ts

+7
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export const styles: Styles = {
2222
justifyContent: 'space-between',
2323
alignItems: 'center',
2424
},
25+
elementsContainerPortrait: {
26+
__media: { portrait: true },
27+
width: 'auto',
28+
right: '10px',
29+
left: '10px',
30+
bottom: `${PHOTO_CAPTURE_HUD_BUTTONS_BAR_WIDTH * 1.8}px`,
31+
},
2532
topContainer: {
2633
width: '100%',
2734
display: 'flex',

packages/inspection-capture-web/src/PhotoCapture/PhotoCaptureHUD/PhotoCaptureHUDTutorial/PhotoCaptureHUDTutorial.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { SightGuideline } from '../PhotoCaptureHUDElementsSight';
88
import { ArrowIcon } from './ArrowIcon';
99
import { DisplayText } from './DisplayText';
1010
import { useColorBackground } from '../../../hooks';
11+
import { usePhotoCaptureHUDTutorialStyle } from './hooks';
1112

1213
/**
1314
* Props of the PhotoCaptureHUDTutorial component.
@@ -50,10 +51,11 @@ export function PhotoCaptureHUDTutorial({
5051
}: PhotoCaptureHUDTutorialProps) {
5152
const { t } = useTranslation();
5253
const primaryColor = useColorBackground();
54+
const style = usePhotoCaptureHUDTutorialStyle();
5355

5456
return currentTutorialStep ? (
5557
<div style={styles['backdropContainer']} data-testid='backdrop'>
56-
<div style={styles['elementsContainer']}>
58+
<div style={style.elementsContainer}>
5759
<div style={styles['topContainer']}>
5860
<div style={styles['buttonsContainer']}>
5961
<div style={styles['closeButtonTwin']} />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { useResponsiveStyle } from '@monkvision/common';
2+
import { styles } from './PhotoCaptureHUDTutorial.styles';
3+
4+
export function usePhotoCaptureHUDTutorialStyle() {
5+
const { responsive } = useResponsiveStyle();
6+
7+
return {
8+
elementsContainer: {
9+
...styles['elementsContainer'],
10+
...responsive(styles['elementsContainerPortrait']),
11+
},
12+
};
13+
}

0 commit comments

Comments
 (0)