Skip to content

Commit

Permalink
fix: [IOBP-332] Add correct pictograms to camera permission view in b…
Browse files Browse the repository at this point in the history
…arcode scan screen (#5188)

## Short description
This PR fixes the pictorgrams displayed in the camera permission
requests view in the Barcode scan screen

| Not determined | Denied |
| --- | --- |
| <img
src="https://github.com/pagopa/io-app/assets/6160324/2457c7d6-fadd-4b72-beea-36c1b9d12755"
width="200" /> | <img
src="https://github.com/pagopa/io-app/assets/6160324/e3decd8e-aead-49aa-8be3-a6e3273f6d54"
width="200" /> |

## List of changes proposed in this pull request
-
[ts/features/barcode/components/BarcodeScanBaseScreenComponent.tsx](https://github.com/pagopa/io-app/compare/IOBP-332-fix-barcode-scan-screen-camera-permission-pictograms?expand=1#diff-1e4e400edd0a8debdd16a6c728d260d849b977083ea5aa108a5ba43ce25ac4c2):
added correct pictograms for permission request and permission denied
views
-
[ts/features/barcode/components/CameraPermissionView.tsx](https://github.com/pagopa/io-app/compare/IOBP-332-fix-barcode-scan-screen-camera-permission-pictograms?expand=1#diff-052d138722206aca70841ca9fe25e4ab0c8cc2266e26bc7e1b872dd97208e689):
added `pictogram` in props and changed `pictogramStyle` to
`light-content`.

## How to test
Navigate to the barcode scan screen and check that the pictograms are
displayed correctly
  • Loading branch information
mastro993 authored Nov 3, 2023
1 parent d664ad1 commit db026c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ const BarcodeScanBaseScreenComponent = ({

return (
<CameraPermissionView
pictogram="cameraRequest"
title={I18n.t("barcodeScan.permissions.undefined.title")}
body={I18n.t("barcodeScan.permissions.undefined.label")}
action={{
Expand All @@ -230,6 +231,7 @@ const BarcodeScanBaseScreenComponent = ({

return (
<CameraPermissionView
pictogram="cameraDenied"
title={I18n.t("barcodeScan.permissions.denied.title")}
body={I18n.t("barcodeScan.permissions.denied.label")}
action={{
Expand Down
6 changes: 4 additions & 2 deletions ts/features/barcode/components/CameraPermissionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
ButtonSolid,
ButtonSolidProps,
VSpacer,
Pictogram
Pictogram,
IOPictograms
} from "@pagopa/io-app-design-system";
import { H3 } from "../../../components/core/typography/H3";
import { LabelSmall } from "../../../components/core/typography/LabelSmall";
Expand All @@ -13,11 +14,12 @@ type Props = {
title: string;
body: string;
action: Pick<ButtonSolidProps, "label" | "accessibilityLabel" | "onPress">;
pictogram: IOPictograms;
};

const CameraPermissionView = (props: Props) => (
<View style={styles.container}>
<Pictogram name="cameraRequest" />
<Pictogram name={props.pictogram} pictogramStyle="light-content" />
<VSpacer size={24} />
<H3 color="white" style={styles.text}>
{props.title}
Expand Down

0 comments on commit db026c4

Please sign in to comment.