Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [IOAPPX-453] Add the new static Appearance profile screen #6573

Merged
merged 37 commits into from
Feb 25, 2025
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
46b4dcf
Add the new `Appearance` profile screen
dmnplb Dec 19, 2024
c6a70b4
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Dec 19, 2024
6a4e6c6
Update copy
dmnplb Dec 20, 2024
529f625
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
thisisjp Dec 26, 2024
7eb787e
Add missing I18n strings
dmnplb Jan 7, 2025
89472f7
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 8, 2025
6bf6667
Update I18n strings
dmnplb Jan 9, 2025
2323c0f
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 9, 2025
7201c4d
Changes proposed by UX Copy team
thisisjp Jan 9, 2025
271f4ba
Simplify the copy further
dmnplb Jan 10, 2025
22113c0
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 14, 2025
e982ff7
Test signed commit
dmnplb Jan 20, 2025
7b4b349
Restore locale after test
dmnplb Jan 20, 2025
caf095d
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 20, 2025
a9df52f
Remove unused `React` import
dmnplb Jan 20, 2025
6c82130
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 20, 2025
d825c73
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 21, 2025
d4059ad
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 24, 2025
12c8c96
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 27, 2025
3768a34
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 29, 2025
5c95e77
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 29, 2025
8272231
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Jan 31, 2025
b89f949
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 3, 2025
3d926b1
Change copy
dmnplb Feb 3, 2025
28cce55
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 3, 2025
2a953fd
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 3, 2025
585c032
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 4, 2025
dd3cee0
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 5, 2025
8761c86
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 6, 2025
7d4f8a7
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 6, 2025
85b30cb
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 7, 2025
8babdcb
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 10, 2025
a81c897
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 11, 2025
c8d00d6
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 12, 2025
6556e60
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 17, 2025
81d8c2c
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 18, 2025
c963e4f
Merge branch 'master' into IOAPPX-453-add-new-appearance-page
dmnplb Feb 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions locales/en/index.json
Original file line number Diff line number Diff line change
@@ -644,6 +644,31 @@
"title": "Forwarding messages by email",
"subtitle": "Receive message previews"
},
"appearance": {
"title": "Appearance",
"subtitle": "Customize the app to your needs",
"typefaceStyle": {
"title": "Typeface style",
"comfortable": {
"title": "Comfortable",
"description": "Designed for better text readability"
},
"standard": {
"title": "Standard",
"description": "The usual style with narrow, geometric shapes"
}
},
"theme": {
"title": "Theme",
"comingSoon": "Coming soon",
"automatic": {
"title": "Automatic",
"description": "Based on system settings"
},
"light": "Light",
"dark": "Dark"
}
},
"language": {
"title": "Language",
"subtitle": "Choose language"
25 changes: 25 additions & 0 deletions locales/it/index.json
Original file line number Diff line number Diff line change
@@ -644,6 +644,31 @@
"title": "Inoltro dei messaggi via email",
"subtitle": "Ricevi un’anteprima dei messaggi"
},
"appearance": {
"title": "Aspetto dell'app",
"subtitle": "Personalizza l'app in base alle tue esigenze",
"typefaceStyle": {
"title": "Stile carattere",
"comfortable": {
"title": "Confortevole",
"description": "Progettato per una migliore leggibilità dei testi"
},
"standard": {
"title": "Standard",
"description": "Lo stile di sempre, con forme strette e geometriche"
}
},
"theme": {
"title": "Tema",
"comingSoon": "In arrivo",
"automatic": {
"title": "Automatico",
"description": "Cambia in base alle impostazioni di sistema"
},
"light": "Chiaro",
"dark": "Scuro"
}
},
"language": {
"title": "Lingua",
"subtitle": "Scegli la lingua"
5 changes: 5 additions & 0 deletions ts/navigation/ProfileNavigator.tsx
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ import { isGestureEnabled } from "../utils/navigation";
import TrialSystemPlayground from "../screens/profile/TrialSystemPlayground";
import ProfileMainScreen from "../screens/profile/ProfileMainScreen";
import { IOMarkdownPlayground } from "../screens/profile/playgrounds/IOMarkdownPlayground";
import AppearancePreferenceScreen from "../screens/profile/AppearancePreferenceScreen";
import { ProfileParamsList } from "./params/ProfileParamsList";
import ROUTES from "./routes";

@@ -66,6 +67,10 @@ const ProfileStackNavigator = () => (
name={ROUTES.PROFILE_PREFERENCES_SERVICES}
component={ServicesPreferenceScreen}
/>
<Stack.Screen
name={ROUTES.PROFILE_PREFERENCES_APPEARANCE}
component={AppearancePreferenceScreen}
/>
<Stack.Screen
name={ROUTES.PROFILE_PREFERENCES_EMAIL_FORWARDING}
component={EmailForwardingScreen}
1 change: 1 addition & 0 deletions ts/navigation/params/ProfileParamsList.ts
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ export type ProfileParamsList = {
[ROUTES.PROFILE_DATA]: undefined;
[ROUTES.PROFILE_SECURITY]: undefined;
[ROUTES.PROFILE_PREFERENCES_SERVICES]: undefined;
[ROUTES.PROFILE_PREFERENCES_APPEARANCE]: undefined;
[ROUTES.PROFILE_PREFERENCES_EMAIL_FORWARDING]: undefined;
[ROUTES.PROFILE_PREFERENCES_CALENDAR]: undefined;
[ROUTES.PROFILE_PREFERENCES_LANGUAGE]: undefined;
1 change: 1 addition & 0 deletions ts/navigation/routes.ts
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ const ROUTES = {
PROFILE_PREFERENCES_EMAIL_FORWARDING: "PROFILE_PREFERENCES_EMAIL_FORWARDING",
PROFILE_PREFERENCES_CALENDAR: "PROFILE_PREFERENCES_CALENDAR",
PROFILE_PREFERENCES_LANGUAGE: "PROFILE_PREFERENCES_LANGUAGE",
PROFILE_PREFERENCES_APPEARANCE: "PROFILE_PREFERENCES_APPEARANCE",
PROFILE_ABOUT_APP: "PROFILE_ABOUT_APP",
PROFILE_LOGOUT: "PROFILE_LOGOUT",
PROFILE_FISCAL_CODE: "PROFILE_FISCAL_CODE",
124 changes: 124 additions & 0 deletions ts/screens/profile/AppearancePreferenceScreen.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import {
ListItemHeader,
RadioGroup,
VStack
} from "@pagopa/io-app-design-system";
import { ReactElement, useState } from "react";
import { View } from "react-native";
import { IOScrollViewWithLargeHeader } from "../../components/ui/IOScrollViewWithLargeHeader";
import I18n from "../../i18n";

type TypefaceChoice = "comfortable" | "standard";

type ColorModeChoice = "system" | "dark" | "light";

/**
* Display the appearance related settings
* @param props
* @constructor
*/
const AppearancePreferenceScreen = (): ReactElement => {
const [selectedTypeface, setSelectedTypeface] =
useState<TypefaceChoice>("comfortable");

const [selectedColorMode, setSelectedColorMode] =
useState<ColorModeChoice>("light");

// Options for typeface
const typefaceOptions = [
{
id: "comfortable" as TypefaceChoice,
value: I18n.t(
"profile.preferences.list.appearance.typefaceStyle.comfortable.title"
),
description: I18n.t(
"profile.preferences.list.appearance.typefaceStyle.comfortable.description"
)
},
{
id: "standard" as TypefaceChoice,
value: I18n.t(
"profile.preferences.list.appearance.typefaceStyle.standard.title"
),
description: I18n.t(
"profile.preferences.list.appearance.typefaceStyle.standard.description"
)
}
];

// Options for the color mode
const colorModeOptions = [
{
id: "system" as ColorModeChoice,
value: I18n.t(
"profile.preferences.list.appearance.theme.automatic.title"
),
description: I18n.t(
"profile.preferences.list.appearance.theme.automatic.description"
),
disabled: true
},
{
id: "light" as ColorModeChoice,
value: I18n.t("profile.preferences.list.appearance.theme.light"),
disabled: true
},
{
id: "dark" as ColorModeChoice,
value: I18n.t("profile.preferences.list.appearance.theme.dark"),
disabled: true
}
];

return (
<IOScrollViewWithLargeHeader
title={{
label: I18n.t("profile.preferences.list.appearance.title")
}}
description={I18n.t("profile.preferences.list.appearance.subtitle")}
headerActionsProp={{ showHelp: true }}
includeContentMargins
>
<VStack space={24}>
<View>
<ListItemHeader
iconName="gallery"
label={I18n.t(
"profile.preferences.list.appearance.typefaceStyle.title"
)}
/>
<RadioGroup<TypefaceChoice>
type="radioListItem"
items={typefaceOptions}
selectedItem={selectedTypeface}
onPress={setSelectedTypeface}
/>
</View>

<View>
<ListItemHeader
iconName="gallery"
label={I18n.t("profile.preferences.list.appearance.theme.title")}
endElement={{
type: "badge",
componentProps: {
text: I18n.t(
"profile.preferences.list.appearance.theme.comingSoon"
),
variant: "info"
}
}}
/>
<RadioGroup<ColorModeChoice>
type="radioListItem"
items={colorModeOptions}
selectedItem={selectedColorMode}
onPress={setSelectedColorMode}
/>
</View>
</VStack>
</IOScrollViewWithLargeHeader>
);
};

export default AppearancePreferenceScreen;
12 changes: 12 additions & 0 deletions ts/screens/profile/PreferencesScreen.tsx
Original file line number Diff line number Diff line change
@@ -63,6 +63,12 @@ const PreferencesScreen = () => {
});
}, [navigation]);

const navigateToAppearancePreferenceScreen = useCallback(() => {
navigation.navigate(ROUTES.PROFILE_NAVIGATOR, {
screen: ROUTES.PROFILE_PREFERENCES_APPEARANCE
});
}, [navigation]);

const checkPermissionThenGoCalendar = async () => {
await requestWriteCalendarPermission({
title: I18n.t("permissionRationale.calendar.title"),
@@ -109,6 +115,12 @@ const PreferencesScreen = () => {
description: I18n.t("profile.preferences.list.notifications.subtitle"),
onPress: navigateToNotificationPreferenceScreen
},
{
// Appearance
value: I18n.t("profile.preferences.list.appearance.title"),
description: I18n.t("profile.preferences.list.appearance.subtitle"),
onPress: navigateToAppearancePreferenceScreen
},
{
// Calendar
value: I18n.t("profile.preferences.list.preferred_calendar.title"),

Unchanged files with check annotations Beta

const getServiceT: GetServiceT = {
method: "get",
url: params => `/api/v1/services/${params.service_id}`,
query: _ => ({}),

Check warning on line 157 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
headers: tokenHeaderProducer,
response_decoder: getServiceDefaultDecoder()
};
const getServicePreferenceT: GetServicePreferencesT = {
method: "get",
url: params => `/api/v1/services/${params.service_id}/preferences`,
query: _ => ({}),

Check warning on line 165 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
headers: tokenHeaderProducer,
response_decoder: getServicePreferencesDefaultDecoder()
};
method: "post",
url: params => `/api/v1/services/${params.service_id}/preferences`,
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
query: _ => ({}),

Check warning on line 174 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
body: body => JSON.stringify(body.body),
response_decoder: upsertServicePreferencesDefaultDecoder()
};
const getMessagesT: GetUserMessagesT = {
method: "get",
url: _ => "/api/v1/messages",

Check warning on line 181 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
query: params => {
const {
maximum_id,
method: "get",
url: ({ id }) => `/api/v1/third-party-messages/${id}`,
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
query: _ => ({}),

Check warning on line 225 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
response_decoder: getThirdPartyMessageDefaultDecoder()
};
const getThirdPartyMessagePreconditionT: GetThirdPartyMessagePreconditionT = {
method: "get",
url: ({ id }) => `/api/v1/third-party-messages/${id}/precondition`,
query: _ => ({}),

Check warning on line 232 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
response_decoder: getThirdPartyMessagePreconditionDefaultDecoder()
};
const upsertMessageStatusAttributesT: UpsertMessageStatusAttributesT = {
method: "put",
url: params => `/api/v1/messages/${params.id}/message-status`,
query: _ => ({}),

Check warning on line 240 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
body: params => JSON.stringify(params.body),
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
response_decoder: upsertMessageStatusAttributesDefaultDecoder()
const getProfileT: GetUserProfileT = {
method: "get",
url: () => "/api/v1/profile",
query: _ => ({}),

Check warning on line 249 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
headers: tokenHeaderProducer,
response_decoder: getUserProfileDefaultDecoder()
};
method: "post",
url: () => "/api/v1/profile",
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
query: _ => ({}),

Check warning on line 258 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
body: p => JSON.stringify(p.body),
response_decoder: updateProfileDefaultDecoder()
};
const postStartEmailValidationProcessT: StartEmailValidationProcessT = {
method: "post",
url: () => "/api/v1/email-validation-process",
query: _ => ({}),

Check warning on line 266 in ts/api/backend.ts

GitHub Actions / static-checks

'_' is already declared in the upper scope on line 17 column 8
headers: composeHeaderProducers(tokenHeaderProducer, ApiHeaderJson),
body: _ => JSON.stringify({}),
response_decoder: startEmailValidationProcessDefaultDecoder()