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
Show file tree
Hide file tree
Changes from 8 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
19 changes: 19 additions & 0 deletions locales/en/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,25 @@ profile:
send_email_messages:
title: Forwarding messages by email
subtitle: Receive message previews
appearance:
title: Appearance
subtitle: Choose how to customise the interface
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
Expand Down
19 changes: 19 additions & 0 deletions locales/it/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,25 @@ profile:
send_email_messages:
title: Inoltro dei messaggi via email
subtitle: Ricevi un’anteprima dei messaggi
appearance:
title: Aspetto dell'app
subtitle: Scegli come personalizzare l’interfaccia
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
Expand Down
5 changes: 5 additions & 0 deletions ts/navigation/ProfileNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,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";

Expand Down Expand Up @@ -68,6 +69,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}
Expand Down
1 change: 1 addition & 0 deletions ts/navigation/params/ProfileParamsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions ts/navigation/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,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",
Expand Down
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 React, { 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
Expand Up @@ -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"),
Expand Down Expand Up @@ -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"),
Expand Down
Loading