Skip to content

Commit

Permalink
Merge branch 'master' into IOCOM-824-825-messageList
Browse files Browse the repository at this point in the history
  • Loading branch information
Vangaorth committed May 23, 2024
2 parents e73ff16 + 45d20bc commit 3f40dbb
Show file tree
Hide file tree
Showing 57 changed files with 213,210 additions and 1,384 deletions.
2 changes: 0 additions & 2 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ PREMIUM_MESSAGES_OPT_IN_ENABLED=YES
CDC_ENABLED = YES
# Scan additional barcodes (E.g. Data Matrix) in the payment section
SCAN_ADDITIONAL_BARCODES_ENABLED = YES
# Opt-in for reminder push notifications
REMINDERS_OPT_IN_ENABLED=YES
# FCI (Firma con IO) feature
FCI_ENABLED=YES
# IDPay
Expand Down
2 changes: 0 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ PREMIUM_MESSAGES_OPT_IN_ENABLED=YES
CDC_ENABLED = YES
# Scan additional barcodes (E.g. Data Matrix) in the payment section
SCAN_ADDITIONAL_BARCODES_ENABLED = YES
# Opt-in for reminder push notifications
REMINDERS_OPT_IN_ENABLED=YES
# FCI (Firma con IO) feature
FCI_ENABLED=YES
# IDPay
Expand Down
Binary file removed img/onboarding/notification_blue.png
Binary file not shown.
Binary file removed img/onboarding/notification_blue@2x.png
Binary file not shown.
Binary file removed img/onboarding/notification_blue@3x.png
Binary file not shown.
Binary file modified img/onboarding/notification_white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/onboarding/notification_white@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified img/onboarding/notification_white@3x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,11 @@ services:
emptyListMessage: There are no services available at this time, pull down to refresh
new: New
home:
featured:
services:
title: Featured
institutions:
title: Featured Institutions
institutions:
title: National
institution:
Expand Down
21 changes: 13 additions & 8 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ profile:
additionalInformation:
description: "Per maggiori informazioni, leggi "
cta: "l’Informativa Privacy e i Termini e Condizioni d’uso"
profileSettings: "Potrai modificare questa scelta in ogni momento andando su Profilo > Preferenze"
profileSettings: "Puoi modificare la tua scelta in ogni momento da Profilo > Preferenze"
cta:
shareData: "Condividi"
dontShareData: "Non condividere dati"
Expand Down Expand Up @@ -522,19 +522,19 @@ profile:
contextualHelpContent: !include profile/profile_preferences_notifications.md
header: Notifiche push
title: Personalizza le notifiche
subtitle: Scegli come ricevere aggiornamenti sui messaggi e promemoria.
subtitle: Scegli se mostrare le anteprime e ricevere promemoria, come in questo esempio.
titleExistingUser: Personalizza le notifiche
subtitleExistingUser: Ora puoi vedere subito chi ti ha scritto o ricevere promemoria da messaggi importanti, come in questo esempio.
reminders:
title: Consenti i promemoria
title: Consenti promemoria
description: Su richiesta dell'ente, ricevi notifiche push in prossimità di scadenze o quando hai dei messaggi non letti
preview:
title: Mostra un'anteprima
description: Includi nella notifica push il mittente e l’oggetto del messaggio
link: Più info
title: Mostra anteprime
description: Includi nella notifica push il mittente e l’oggetto del messaggio.
link: Scopri di più
bottomSheet:
title: Mostra un'anteprima
content: Se l’opzione è attiva le notifiche push mostrano il mittente e l’oggetto dei messaggi, anche quando lo schermo è bloccato. Queste informazioni vengono trattate dal gestore del tuo sistema operativo e da app di terze parti eventualmente in esecuzione.
title: Mostra anteprime
content: "Una notifica push è un messaggio che ricevi sul tuo dispositivo anche quando non usi l'app. Se attivi questa opzione, riceverai notifiche push che ti mostreranno il mittente e l'oggetto del messaggio.\nQueste informazioni sono gestite dal sistema operativo del tuo dispositivo e dalle eventuali app di terze parti che stai utilizzando."
cta: Ho capito!
error: Si è verificato un errore con la tua richiesta
userMetadata:
Expand Down Expand Up @@ -2104,6 +2104,11 @@ services:
emptyListMessage: Non ci sono servizi disponibili al momento, trascina in basso per aggiornare
new: Nuovo
home:
featured:
services:
title: In primo piano
institutions:
title: Enti in evidenza
institutions:
title: Nazionali
institution:
Expand Down
2 changes: 1 addition & 1 deletion ts/components/ui/RNavScreenWithLargeHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const RNavScreenWithLargeHeader = ({

{description && (
<ContentWrapper>
<VSpacer size={4} />
<VSpacer size={16} />
<Body color="grey-700">{description}</Body>
</ContentWrapper>
)}
Expand Down
3 changes: 0 additions & 3 deletions ts/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ export const cieLoginFlowWithDevServerEnabled =
// Native Login Feature Flag
export const nativeLoginEnabled = Config.NATIVE_LOGIN_ENABLED === "YES";

// Opt-in for reminder push notifications
export const remindersOptInEnabled = Config.REMINDERS_OPT_IN_ENABLED === "YES";

export const isNewServicesEnabled = Config.NEW_SERVICES_ENABLED === "YES";

export const fetchTimeout = pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,16 @@ import {
Icon,
HSpacer,
IOSpacingScale,
IOVisualCostants
Label,
IOStyles,
H6
} from "@pagopa/io-app-design-system";
import { H4 } from "../../../components/core/typography/H4";
import { H5 } from "../../../components/core/typography/H5";
import customVariables from "../../../theme/variables";
import I18n from "../../../i18n";
import { TranslationKeys } from "../../../../locales/locales";
import { IOStyles } from "../../../components/core/variables/IOStyles";

const notificationMarginVertical: IOSpacingScale = 4;
const notificationPaddingVertical: IOSpacingScale = 8;
const notificationPaddingHorizontal: IOSpacingScale = 16;
const notificationPaddingHorizontal: IOSpacingScale = 24;

const styles = StyleSheet.create({
notification: {
Expand All @@ -25,10 +23,9 @@ const styles = StyleSheet.create({
backgroundColor: IOColors.white,
borderWidth: 1,
borderColor: IOColors.bluegreyLight,
borderRadius: customVariables.borderRadiusBase,
minHeight: 72,
borderRadius: 8,
minHeight: 90,
marginVertical: notificationMarginVertical,
marginHorizontal: IOVisualCostants.appMarginDefault,
paddingVertical: notificationPaddingVertical,
paddingHorizontal: notificationPaddingHorizontal
}
Expand Down Expand Up @@ -77,15 +74,13 @@ export const NotificationPreviewSample = ({

return (
<View style={styles.notification}>
<Icon name="productIOAppBlueBg" />
<Icon color="blueIO-450" name="productIOApp" />
<HSpacer />
<View style={IOStyles.flex}>
<H4 weight="SemiBold" color="bluegreyDark">
{I18n.t(titleKey)}
</H4>
<H5 weight="Regular" color="bluegrey">
<H6 weight="SemiBold">{I18n.t(titleKey)}</H6>
<Label fontSize="small" weight="Regular">
{I18n.t(messageKey)}
</H5>
</Label>
</View>
</View>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import { StyleSheet, ImageBackground } from "react-native";
import NotificationBlueBg from "../../../../img/onboarding/notification_blue.png";
import NotificationWhiteBg from "../../../../img/onboarding/notification_white.png";
import { NotificationPreviewSample } from "./NotificationPreviewSample";

Expand All @@ -14,16 +13,14 @@ const styles = StyleSheet.create({
type Props = {
previewEnabled: boolean;
remindersEnabled: boolean;
isFirstOnboarding: boolean;
};

export const NotificationsPreferencesPreview = ({
previewEnabled,
remindersEnabled,
isFirstOnboarding
remindersEnabled
}: Props) => (
<ImageBackground
source={isFirstOnboarding ? NotificationWhiteBg : NotificationBlueBg}
source={NotificationWhiteBg}
resizeMode="contain"
style={styles.container}
>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import {
Banner,
Divider,
ListItemSwitch,
VSpacer
} from "@pagopa/io-app-design-system";
import React from "react";
import I18n from "../../../i18n";
import { usePreviewMoreInfo } from "../hooks/usePreviewMoreInfo";
import { NotificationsPreferencesPreview } from "./NotificationsPreferencesPreview";

type ProfileNotificationSettingsProps = {
disablePreviewSetting: boolean;
disableRemindersSetting: boolean;
isUpdatingPreviewSetting: boolean;
isUpdatingRemindersSetting: boolean;
onPreviewValueChanged?: (value: boolean) => void;
onReminderValueChanged?: (value: boolean) => void;
previewSwitchValue: boolean;
remindersSwitchValue: boolean;
showSettingsPath: boolean;
};

export const ProfileNotificationSettings = ({
disablePreviewSetting,
disableRemindersSetting,
isUpdatingPreviewSetting,
isUpdatingRemindersSetting,
onPreviewValueChanged,
onReminderValueChanged,
previewSwitchValue,
remindersSwitchValue,
showSettingsPath
}: ProfileNotificationSettingsProps) => {
const { present, bottomSheet } = usePreviewMoreInfo();
return (
<>
<VSpacer size={24} />
<NotificationsPreferencesPreview
previewEnabled={previewSwitchValue}
remindersEnabled={remindersSwitchValue}
/>
<VSpacer size={24} />
<ListItemSwitch
label={I18n.t("profile.preferences.notifications.preview.title")}
description={I18n.t(
"profile.preferences.notifications.preview.description"
)}
action={{
label: I18n.t("profile.preferences.notifications.preview.link"),
onPress: present
}}
value={previewSwitchValue}
disabled={disablePreviewSetting}
isLoading={isUpdatingPreviewSetting}
onSwitchValueChange={onPreviewValueChanged}
switchTestID={"previewsPreferenceSwitch"}
/>
<Divider />
<ListItemSwitch
label={I18n.t("profile.preferences.notifications.reminders.title")}
description={I18n.t(
"profile.preferences.notifications.reminders.description"
)}
value={remindersSwitchValue}
disabled={disableRemindersSetting}
isLoading={isUpdatingRemindersSetting}
onSwitchValueChange={onReminderValueChanged}
switchTestID={"remindersPreferenceSwitch"}
/>
{showSettingsPath && <VSpacer size={40} />}
{showSettingsPath && (
<Banner
pictogramName="reactivate"
content={I18n.t(
"profile.main.privacy.shareData.screen.profileSettings"
)}
size="small"
color="neutral"
/>
)}
<VSpacer size={32} />
{bottomSheet}
</>
);
};

0 comments on commit 3f40dbb

Please sign in to comment.