-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [IOCOM-1133,IOCOM-1235,IOCOM-1372] Push Notification Opt In scr…
…een, new DS (#5734)⚠️ This PR depends on #5732⚠️ ⚠️ This PR depends on [io-app-design-system#253](pagopa/io-app-design-system#253)⚠️ ⚠️ This PR depends on [io-app-design-system#256](pagopa/io-app-design-system#256)⚠️ ## Short description This PR aligns the Push Notifications Opt In screen and the profile push notification settings to the new DS |Both on<br/>upper part|Both on<br/>scrolled down|Bottom sheet| |-|-|-| |![On1](https://github.com/pagopa/io-app/assets/5150343/66a756b4-9706-4cda-a20a-b5ebf92e6f1d)|![Simulator Screenshot - iPhone 15 - 2024-05-10 at 12 26 26](https://github.com/pagopa/io-app/assets/5150343/6e6c0ed5-c44c-4e81-ae9c-477ff6e22658)|![OnBS](https://github.com/pagopa/io-app/assets/5150343/9b079428-5262-4f79-b386-bc7e0b6af892)| |Preview Off<br/>Reminder On|Preview On<br/>Reminder Off|Both Off| |-|-|-| |![Pre](https://github.com/pagopa/io-app/assets/5150343/9955c886-ecf5-4401-8e86-7c11a6c7c486)|![Rem](https://github.com/pagopa/io-app/assets/5150343/ea87c7b0-3ca9-435d-993d-2a2994ff9741)|![Off](https://github.com/pagopa/io-app/assets/5150343/0de87ad0-824a-4eca-8251-67ed8ba58ef1)| |Profile<br/>Both on|Profile<br/>Bottom sheet| |-|-| |![ProfileOnPreOnRem](https://github.com/pagopa/io-app/assets/5150343/4bd1d77a-985f-4d8b-89b0-771cedf5ae8c)|![ProfileBS](https://github.com/pagopa/io-app/assets/5150343/a4ab71eb-e5b1-493a-9e4c-d487d1c0e0ec)| |Profile<br/>On Off|Profile<br/>Off On|Profile<br/>Off Off| |-|-|-| |![ProfileOnPreOffRem](https://github.com/pagopa/io-app/assets/5150343/f8fb2554-e94c-46c9-90da-198195d24f28)|![ProfileOffPreOnRem](https://github.com/pagopa/io-app/assets/5150343/4dc52f4a-8165-4495-90cd-771d1009ea63)|![ProfileOffPreOffRem](https://github.com/pagopa/io-app/assets/5150343/494f7064-d6e7-46a2-92c8-5782c161beda)| ## List of changes proposed in this pull request - All related onboarding screens have been ported to the new DS - A lot of test snapshot have been updated due to a change in margins on the DS library ## How to test Using the io-dev-api-server, configure the profile in order to have both `reminder_status` and `push_notifications_content_type` set to undefined. Perform a login and the opt-in screen should appear. Check that both values are properly set after tapping the "Continue" button. For the profile screen, navigate to it and change switches' values
- Loading branch information
Showing
41 changed files
with
210,600 additions
and
1,081 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
ts/features/pushNotifications/components/ProfileNotificationsSettings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
</> | ||
); | ||
}; |
Oops, something went wrong.