Skip to content

Commit

Permalink
Merge pull request #1497 from onfido/hotfix/camera-permissions-screen…
Browse files Browse the repository at this point in the history
…-mobile-layout

Hotfix/camera permissions screen mobile layout
  • Loading branch information
SherBhachuOnFido committed Jul 8, 2021
2 parents 7f69a5a + c06a57b commit b926d49
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ This project adheres to the Node [default version scheme](https://docs.npmjs.com

## [next-version]

### Fixed

- UI: Fixed Camera Permissions Primer screen rendering issue on Safari 14.1 (desktop) without changing existing SDK layout structure.

## [6.10.1] - 2021-07-05

### Changed
Expand Down
30 changes: 13 additions & 17 deletions src/components/CameraPermissions/Primer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { h, FunctionComponent } from 'preact'
import classNames from 'classnames'
import ScreenLayout from 'components/Theme/ScreenLayout'
import PageTitle from 'components/PageTitle'
import { Button } from '@onfido/castor-react'
import { trackComponent } from 'Tracker'
Expand All @@ -17,8 +16,18 @@ type PermissionsProps = {
type Props = PermissionsProps & WithLocalisedProps & WithTrackingProps

const Permissions: FunctionComponent<Props> = ({ onNext, translate }) => (
<ScreenLayout
actions={
<div className={theme.fullHeightContainer}>
<PageTitle
title={translate('permission.title_cam')}
subTitle={translate('permission.subtitle_cam')}
/>
<div className={classNames(style.bodyWrapper, theme.scrollableContent)}>
<div className={style.image}>
<div className={style.graphic} />
</div>
<p className={style.instructions}>{translate('permission.body_cam')}</p>
</div>
<div className={classNames(theme.contentMargin, style.actions)}>
<Button
variant="primary"
className={classNames(theme['button-centered'], theme['button-lg'])}
Expand All @@ -27,21 +36,8 @@ const Permissions: FunctionComponent<Props> = ({ onNext, translate }) => (
>
{translate('permission.button_primary_cam')}
</Button>
}
>
<div className={theme.fullHeightContainer}>
<PageTitle
title={translate('permission.title_cam')}
subTitle={translate('permission.subtitle_cam')}
/>
<div className={classNames(style.bodyWrapper)}>
<div className={style.image}>
<div className={style.graphic} />
</div>
<p className={style.instructions}>{translate('permission.body_cam')}</p>
</div>
</div>
</ScreenLayout>
</div>
)

export default trackComponent(localised(Permissions))
13 changes: 13 additions & 0 deletions src/components/CameraPermissions/Primer/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,27 @@
height: auto;
width: 100%;
font-size: var(--font-size-small);
display: flex;
flex-direction: column;
flex: 2 1 32 * $unit-x-small;
min-height: 32 * $unit-x-small;
max-width: 105.01 * $unit-x-small;
width: 100%;
padding: 10 * $unit-small;
margin: auto;

// To fix Safari flexbox rendering issue by forcing the div to be rendered in a new composite layer,
// see https://stackoverflow.com/questions/65524383/flexbox-bug-on-safari -> https://stackoverflow.com/questions/19169089/weird-css-stretching-issue-in-ios7-safari-and-chrome
transform: translateZ(0);

@media (--small-viewport) {
max-width: 79 * $unit-x-small;
}
}

.reasons {
font-size: var(--font-size-small);

text-align: center;
min-height: 42 * $unit-small;
}
Expand All @@ -46,6 +58,7 @@
@media (--small-viewport) {
background-size: contain;
flex-grow: 1; // prevents container height collapsing on iOS devices
height: 100%;
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/PageTitle/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
.titleWrapper {
margin: 32 * $unit 0 16 * $unit;
flex-shrink: 0;

// To fix Safari flexbox rendering issue by forcing the div to be rendered in a new composite layer,
// see https://stackoverflow.com/questions/65524383/flexbox-bug-on-safari -> https://stackoverflow.com/questions/19169089/weird-css-stretching-issue-in-ios7-safari-and-chrome
transform: translateZ(0);

@media (--small-viewport) {
margin: 0 0 16 * $unit;
}
Expand Down

0 comments on commit b926d49

Please sign in to comment.