Skip to content

Commit

Permalink
fix other styling issues with toast being too high up on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
thaddmt committed Jan 9, 2024
1 parent 4e4252a commit 4bfea8e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,64 @@ export const LivenessCameraModule = (
>
{!isCameraReady && centeredLoader}

<Overlay
horizontal="center"
vertical={
isRecording && !isFlashingFreshness ? 'start' : 'space-between'
}
className={LivenessClassNames.InstructionOverlay}
>
{isRecording && (
<DefaultRecordingIcon
recordingIndicatorText={recordingIndicatorText}
/>
)}

{!isStartView && !isWaitingForCamera && !isCheckSucceeded && (
<DefaultCancelButton
cancelLivenessCheckText={cancelLivenessCheckText}
/>
)}

<Flex
className={classNames(
LivenessClassNames.Hint,
shouldShowFullScreenCamera && `${LivenessClassNames.Hint}--mobile`
)}
>
<Hint hintDisplayText={hintDisplayText} />
</Flex>

{errorState && (
<ErrorView
onRetry={() => {
send({ type: 'CANCEL' });
}}
displayText={errorDisplayText}
>
{renderErrorModal({
errorState,
overrideErrorDisplayText: errorDisplayText,
})}
</ErrorView>
)}

{/*
We only want to show the MatchIndicator when we're recording
and when the face is in either the too far state, or the
initial face identified state. Using the a memoized MatchIndicator here
so that even when this component re-renders the indicator is only
re-rendered if the percentage prop changes.
*/}
{isRecording &&
!isFlashingFreshness &&
showMatchIndicatorStates.includes(faceMatchState!) ? (
<MemoizedMatchIndicator
percentage={Math.ceil(faceMatchPercentage!)}
/>
) : null}
</Overlay>

<View
as="canvas"
ref={freshnessColorRef}
Expand Down Expand Up @@ -345,57 +403,6 @@ export const LivenessCameraModule = (
<View as="canvas" ref={canvasRef} />
</Flex>

{isRecording && (
<DefaultRecordingIcon
recordingIndicatorText={recordingIndicatorText}
/>
)}

{!isStartView && !isWaitingForCamera && !isCheckSucceeded && (
<DefaultCancelButton
cancelLivenessCheckText={cancelLivenessCheckText}
/>
)}

<Overlay
horizontal="center"
vertical={
isRecording && !isFlashingFreshness ? 'start' : 'space-between'
}
className={LivenessClassNames.InstructionOverlay}
>
<Hint hintDisplayText={hintDisplayText} />

{errorState && (
<ErrorView
onRetry={() => {
send({ type: 'CANCEL' });
}}
displayText={errorDisplayText}
>
{renderErrorModal({
errorState,
overrideErrorDisplayText: errorDisplayText,
})}
</ErrorView>
)}

{/*
We only want to show the MatchIndicator when we're recording
and when the face is in either the too far state, or the
initial face identified state. Using the a memoized MatchIndicator here
so that even when this component re-renders the indicator is only
re-rendered if the percentage prop changes.
*/}
{isRecording &&
!isFlashingFreshness &&
showMatchIndicatorStates.includes(faceMatchState!) ? (
<MemoizedMatchIndicator
percentage={Math.ceil(faceMatchPercentage!)}
/>
) : null}
</Overlay>

{isStartView &&
!isMobileScreen &&
selectableDevices &&
Expand Down
9 changes: 8 additions & 1 deletion packages/ui/src/theme/css/component/liveness.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
left: 0;
height: 100%;
width: 100%;
z-index: 2;
}

.amplify-liveness-video {
Expand Down Expand Up @@ -110,7 +111,7 @@
}

.amplify-liveness-instruction-overlay {
z-index: 1;
z-index: 2;
}

.amplify-liveness-countdown-container {
Expand All @@ -131,6 +132,7 @@
padding: var(--amplify-space-small);
max-width: 100%;
}

.amplify-liveness-toast__message {
color: var(--amplify-colors-font-primary);
text-align: center;
Expand Down Expand Up @@ -336,6 +338,10 @@
font-weight: var(--amplify-font-weights-bold);
}

.amplify-liveness-hint--mobile {
margin-top: var(--amplify-space-xxxl);
}

.amplify-liveness-hint__text {
align-items: center;
gap: var(--amplify-space-xs);
Expand Down Expand Up @@ -415,5 +421,6 @@
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
height: 480px;
}

0 comments on commit 4bfea8e

Please sign in to comment.