Skip to content

Commit

Permalink
Fixed PhotoCapture tutorial portrait behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
dlymonkai committed Jan 16, 2025
1 parent 68caf5a commit 57b8229
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
4 changes: 2 additions & 2 deletions apps/demo-app/src/components/AppRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
Page,
PhotoCapturePage,
VehicleTypeSelectionPage,
CaptureSelectionPage,
DamageDisclosurePage,
} from '../pages';
import { App } from './App';
import { CaptureSelectionPage } from '../pages/CaptureSelectionPage';
import { DamageDisclosurePage } from '../pages/DamageDisclosurePage';

export function AppRouter() {
return (
Expand Down
2 changes: 2 additions & 0 deletions apps/demo-app/src/pages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export * from './LoginPage';
export * from './CreateInspectionPage';
export * from './PhotoCapturePage';
export * from './VehicleTypeSelectionPage';
export * from './CaptureSelectionPage';
export * from './DamageDisclosurePage';
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const styles: Styles = {
__media: { portrait: true },
bottom: `${PHOTO_CAPTURE_HUD_BUTTONS_BAR_WIDTH * 1.5}px`,
right: 0,
paddingLeft: '30%',
paddingRight: '45%',
},
button: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export const styles: Styles = {
justifyContent: 'space-between',
alignItems: 'center',
},
elementsContainerPortrait: {
__media: { portrait: true },
width: 'auto',
right: '10px',
left: '10px',
bottom: `${PHOTO_CAPTURE_HUD_BUTTONS_BAR_WIDTH * 1.8}px`,
},
topContainer: {
width: '100%',
display: 'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { SightGuideline } from '../PhotoCaptureHUDElementsSight';
import { ArrowIcon } from './ArrowIcon';
import { DisplayText } from './DisplayText';
import { useColorBackground } from '../../../hooks';
import { usePhotoCaptureHUDTutorialStyle } from './hooks';

/**
* Props of the PhotoCaptureHUDTutorial component.
Expand Down Expand Up @@ -50,10 +51,11 @@ export function PhotoCaptureHUDTutorial({
}: PhotoCaptureHUDTutorialProps) {
const { t } = useTranslation();
const primaryColor = useColorBackground();
const style = usePhotoCaptureHUDTutorialStyle();

return currentTutorialStep ? (
<div style={styles['backdropContainer']} data-testid='backdrop'>
<div style={styles['elementsContainer']}>
<div style={style.elementsContainer}>
<div style={styles['topContainer']}>
<div style={styles['buttonsContainer']}>
<div style={styles['closeButtonTwin']} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { useResponsiveStyle } from '@monkvision/common';
import { styles } from './PhotoCaptureHUDTutorial.styles';

export function usePhotoCaptureHUDTutorialStyle() {
const { responsive } = useResponsiveStyle();

return {
elementsContainer: {
...styles['elementsContainer'],
...responsive(styles['elementsContainerPortrait']),
},
};
}

0 comments on commit 57b8229

Please sign in to comment.