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

chore(Cross): [IOAPPX-442] Fix dark mode text on light backgrounds + Fix overflow text on cards + Extend dark mode support #6473

Merged
merged 97 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
7bb1ba1
Remove `Chip` typographic style, replace it with `LabelMini`
dmnplb Nov 19, 2024
f78464f
Replace `Label` with `Body` (with appropriate weight value)
dmnplb Nov 19, 2024
06516fd
Update `jest` snapshots
dmnplb Nov 19, 2024
5d80f72
Update the subtitle weight in the `ServicesHeader` component
dmnplb Nov 19, 2024
036548f
Fix `tsc` errors
dmnplb Nov 19, 2024
16fd16f
Decrease size of content in the `MessageListItem`
dmnplb Nov 19, 2024
1de6fb0
Update `jest` snapshot
dmnplb Nov 19, 2024
3b9669e
Replace `Bold` with `Semibold` in the `IOMarkdown`
dmnplb Nov 19, 2024
605083b
Update `jest` snapshot
dmnplb Nov 19, 2024
24cab21
Update `jest` snapshots
dmnplb Nov 19, 2024
7dd3ef4
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 20, 2024
5d637db
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 20, 2024
8d07888
Update `jest` snapshot
dmnplb Nov 20, 2024
fe166d5
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 20, 2024
5096bad
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 20, 2024
16a8ae5
Replace `LabelSmall` with `BodySmall`
dmnplb Nov 20, 2024
939e578
Fix `tsc` errors, except for `ClaimLabel`
dmnplb Nov 20, 2024
6ea3329
Update `jest` snapshots
dmnplb Nov 20, 2024
6bed362
Update `io-app-design-system` to `4.0.1` to fix TS errors
dmnplb Nov 21, 2024
060fcba
Update `jest` snapshots
dmnplb Nov 21, 2024
2378b27
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 21, 2024
d34efa7
Update `jest` snapshots
dmnplb Nov 21, 2024
729b317
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 21, 2024
c439706
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 21, 2024
c305ae1
Fix wrong font in the `TabNavigator`
dmnplb Nov 21, 2024
df15cca
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 21, 2024
6711264
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 21, 2024
1302e2a
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 22, 2024
b2b617d
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 22, 2024
7a91f91
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 22, 2024
0a8e95a
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 22, 2024
73762ef
Update `jest` snapshots
dmnplb Nov 22, 2024
4705374
Fix typo in the english locale + Update `jest` snapshots
dmnplb Nov 25, 2024
a0a4b21
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 25, 2024
b58f176
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 25, 2024
14bae03
Fix `tsc` error
dmnplb Nov 25, 2024
6e5a1e5
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 25, 2024
ed8f7ef
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 25, 2024
d707cfb
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 25, 2024
c6fccc5
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
LeleDallas Nov 26, 2024
405f0d8
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 26, 2024
7cf30ae
Remove `LabelSmall` from `ItwPresentationCredentialFiscalCodeModal`
dmnplb Nov 26, 2024
182ba24
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 26, 2024
717e6a6
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 27, 2024
eeb7226
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 27, 2024
20702e1
Update `jest` snapshots
dmnplb Nov 27, 2024
17cb8fa
Merge branch 'master' into IOAPPX-435-improve-typography-new-UI
dmnplb Nov 28, 2024
1340db9
Update `jest` snapshot
dmnplb Nov 28, 2024
f0eaa97
Fix `CgnCard` dark mode appearance
dmnplb Nov 28, 2024
2e919e8
Remove unused `PaymentCardBig` component
dmnplb Nov 28, 2024
71fb3c7
Force light mode on `Tag` in the `ItwCredentialCard` component
dmnplb Nov 28, 2024
f1ed794
Fix `PaymentCard` dark mode appearance and overflow elements
dmnplb Nov 28, 2024
fcfe179
Update `io-app-design-system` to `4.1.0`
dmnplb Nov 28, 2024
868ed2d
Update `jest` snapshot
dmnplb Nov 28, 2024
89af047
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Nov 28, 2024
8aa19f8
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Nov 29, 2024
d4da05d
Enable larger and bolder text in the `ItwCredentialCard`
dmnplb Nov 29, 2024
1ea5e1e
Remove preview prop from `ItwCredentialCard`
dmnplb Nov 29, 2024
a34ec77
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 2, 2024
37be840
Update `jest` snapshots
dmnplb Dec 2, 2024
ead2e1f
Replace `FooterWithButtons` in the `FciDocumentsScreen`
dmnplb Dec 2, 2024
a9f6b6d
Remove preview from `ItwCredentialCard` test
dmnplb Dec 2, 2024
fdecfc7
Update `jest` snapshot
dmnplb Dec 2, 2024
5e04cef
Remove obsolete snapshot
dmnplb Dec 2, 2024
86ee62e
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 2, 2024
f35e8d0
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 5, 2024
624ac1e
Update `jest` snapshots
dmnplb Dec 5, 2024
48b2e67
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 6, 2024
881eb20
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 6, 2024
e5f7143
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 6, 2024
3ceebd6
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
mastro993 Dec 7, 2024
afcd99b
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 9, 2024
0a9e7f2
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
LeleDallas Dec 9, 2024
8259c1a
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 9, 2024
6f47984
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 10, 2024
f41a123
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 10, 2024
0f1740d
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 11, 2024
6ec7513
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 11, 2024
11eb2f3
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 12, 2024
7485fb6
Update `jest` snapshots
dmnplb Dec 12, 2024
2a12c36
Update `jest` snapshots
dmnplb Dec 12, 2024
06b0c4e
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 12, 2024
4d0e3f1
Update `jest` snapshots
dmnplb Dec 12, 2024
07f95e7
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 12, 2024
545f4ca
Disable bolder text in the `ItwSkeumorphicCard` component
dmnplb Dec 12, 2024
645a800
Restore original `ItwDigitalVersionBadge`
dmnplb Dec 13, 2024
b86812f
Update `jest` snapshots
dmnplb Dec 13, 2024
55ad05c
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 13, 2024
f5bc110
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
LeleDallas Dec 13, 2024
ddc0e0d
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 13, 2024
6092faf
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
LeleDallas Dec 13, 2024
da42cbe
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 13, 2024
e1b4dd6
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 16, 2024
39debe2
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
LeleDallas Dec 16, 2024
72885c5
fix: itw digital version badge corners rounding
mastro993 Dec 16, 2024
cda616b
Update `jest` snapshot
dmnplb Dec 16, 2024
e222a1c
Merge branch 'master' into IOAPPX-442-fix-dark-mode-text-on-light-bac…
dmnplb Dec 16, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
"dependencies": {
"@babel/plugin-transform-regenerator": "^7.18.6",
"@gorhom/bottom-sheet": "^4.1.5",
"@pagopa/io-app-design-system": "4.0.2",
"@pagopa/io-app-design-system": "4.2.0",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-cieid": "^0.3.5",
"@pagopa/io-react-native-crypto": "^0.3.0",
Expand Down
9 changes: 8 additions & 1 deletion ts/features/bonus/cgn/components/CgnCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const CgnCard = ({ expireDate, withEycaLogo }: CgnCardProps) => {
const expiredTag = (
<View>
<Tag
forceLightMode
testID="cgnExpiredTagTestID"
variant="error"
text={I18n.t("bonus.cgn.detail.status.badge.expired")}
Expand All @@ -58,7 +59,13 @@ export const CgnCard = ({ expireDate, withEycaLogo }: CgnCardProps) => {
</View>
<View style={styles.content}>
<View style={styles.header}>
<H6>{I18n.t("bonus.cgn.name")}</H6>
<H6
color="blueItalia-850"
style={{ flexShrink: 1 }}
numberOfLines={1}
>
{I18n.t("bonus.cgn.name")}
</H6>
{isExpired && expiredTag}
</View>
<BodySmall
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import {
VSpacer,
HSpacer,
IOSpacer,
SpacerOrientation,
useIOTheme
} from "@pagopa/io-app-design-system";

type DSSpacerViewerBoxProps = {
size: IOSpacer;
orientation?: SpacerOrientation;
orientation?: "horizontal" | "vertical";
};

type DSSpacerLabelProps = {
Expand Down
62 changes: 0 additions & 62 deletions ts/features/design-system/core/DSCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
ItwStoredCredentialsMocks
} from "../../itwallet/common/utils/itwMocksUtils";
import { PaymentCard } from "../../payments/common/components/PaymentCard";
import { PaymentCardBig } from "../../payments/common/components/PaymentCardBig";
import { PaymentCardSmall } from "../../payments/common/components/PaymentCardSmall";
import {
PaymentCardsCarousel,
Expand Down Expand Up @@ -208,49 +207,6 @@ const PaymentCards = () => (
</HStack>
</ScrollView>
</DSComponentViewerBox>
<DSComponentViewerBox name="PaymentCardBig (Pre ITW)">
<ScrollView
horizontal={true}
showsHorizontalScrollIndicator={false}
style={{ marginHorizontal: -IOVisualCostants.appMarginDefault }}
contentContainerStyle={{
paddingHorizontal: IOVisualCostants.appMarginDefault
}}
>
<HStack space={cardHorizontalScrollGap}>
<PaymentCardBig
cardType={"PAGOBANCOMAT"}
expirationDate={new Date()}
holderName="A very very very long citizen name"
abiCode="03069"
/>
<PaymentCardBig
cardType={"PAYPAL"}
holderEmail="userPaypalEmail@email.com"
/>
<PaymentCardBig
cardType={"COBADGE"}
holderName="Mario Rossi"
abiCode="08509"
expirationDate={new Date()}
cardIcon="visa"
/>
<PaymentCardBig
cardType={"COBADGE"}
holderName="Mario Rossi"
abiCode="08508"
expirationDate={new Date()}
cardIcon="visa"
/>
<PaymentCardBig
cardType={"BANCOMATPAY"}
holderName="Mario Rossi"
phoneNumber="+39 1234567890"
/>
<PaymentCardBig isLoading={true} />
</HStack>
</ScrollView>
</DSComponentViewerBox>
</VStack>
</DesignSystemSection>
<DesignSystemSection title="PaymentCardSmall">
Expand Down Expand Up @@ -389,12 +345,6 @@ const ItwCards = () => (
<VStack space={blockMargin}>
<DesignSystemSection title="Driving License">
<VStack space={componentMargin}>
<DSComponentViewerBox name="Preview">
<ItwCredentialCard
credentialType={CredentialType.DRIVING_LICENSE}
isPreview={true}
/>
</DSComponentViewerBox>
<DSComponentViewerBox name="Valid">
<ItwCredentialCard credentialType={CredentialType.DRIVING_LICENSE} />
</DSComponentViewerBox>
Expand Down Expand Up @@ -442,12 +392,6 @@ const ItwCards = () => (
</DesignSystemSection>
<DesignSystemSection title="Disability Card">
<VStack space={componentMargin}>
<DSComponentViewerBox name="Preview">
<ItwCredentialCard
credentialType={CredentialType.EUROPEAN_DISABILITY_CARD}
isPreview={true}
/>
</DSComponentViewerBox>
<DSComponentViewerBox name="Valid">
<ItwCredentialCard
credentialType={CredentialType.EUROPEAN_DISABILITY_CARD}
Expand Down Expand Up @@ -479,12 +423,6 @@ const ItwCards = () => (
</DesignSystemSection>
<DesignSystemSection title="Health Insurance Card">
<VStack space={componentMargin}>
<DSComponentViewerBox name="Preview">
<ItwCredentialCard
credentialType={CredentialType.EUROPEAN_HEALTH_INSURANCE_CARD}
isPreview={true}
/>
</DSComponentViewerBox>
<DSComponentViewerBox name="Valid">
<ItwCredentialCard
credentialType={CredentialType.EUROPEAN_HEALTH_INSURANCE_CARD}
Expand Down
81 changes: 36 additions & 45 deletions ts/features/itwallet/common/components/ItwCredentialCard.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import {
HStack,
IOColors,
makeFontStyleObject,
Tag
} from "@pagopa/io-app-design-system";
import { HStack, IOColors, IOText, Tag } from "@pagopa/io-app-design-system";
import React from "react";
import { ImageSourcePropType, StyleSheet, Text, View } from "react-native";
import { ImageSourcePropType, StyleSheet, View } from "react-native";
import { AnimatedImage } from "../../../../components/AnimatedImage";
import {
borderColorByStatus,
Expand All @@ -21,13 +16,11 @@ import { ItwDigitalVersionBadge } from "./ItwDigitalVersionBadge";
export type ItwCredentialCard = {
credentialType: string;
status?: ItwCredentialStatus;
isPreview?: boolean;
};

export const ItwCredentialCard = ({
status = "valid",
credentialType,
isPreview = false
credentialType
}: ItwCredentialCard) => {
const isValid = validCredentialStatuses.includes(status);
const theme = getThemeColorByCredentialType(credentialType);
Expand All @@ -38,35 +31,41 @@ export const ItwCredentialCard = ({
const statusTagProps = tagPropsByStatus[status];

return (
<View style={isPreview && styles.previewContainer}>
<View style={styles.cardContainer}>
<View style={styles.card}>
<AnimatedImage
source={cardBackgroundSource}
style={styles.cardBackground}
/>
</View>
<View style={styles.header}>
<HStack space={16}>
<Text
style={[
styles.label,
{ color: theme.textColor, opacity: labelOpacity }
]}
>
{getCredentialNameFromType(credentialType, "").toUpperCase()}
</Text>
{statusTagProps && <Tag {...statusTagProps} />}
</HStack>
</View>
<ItwDigitalVersionBadge
credentialType={credentialType}
isFaded={!isValid}
/>
<View
style={[styles.border, { borderColor: borderColorByStatus[status] }]}
<View style={styles.cardContainer}>
<View style={styles.card}>
<AnimatedImage
source={cardBackgroundSource}
style={styles.cardBackground}
/>
</View>
<View style={styles.header}>
<HStack space={16}>
<IOText
size={16}
lineHeight={20}
font="TitilliumSansPro"
weight="Semibold"
maxFontSizeMultiplier={1.25}
style={{
letterSpacing: 0.25,
color: theme.textColor,
opacity: labelOpacity,
flex: 1,
flexShrink: 1
}}
>
{getCredentialNameFromType(credentialType, "").toUpperCase()}
</IOText>
{statusTagProps && <Tag forceLightMode {...statusTagProps} />}
</HStack>
</View>
<ItwDigitalVersionBadge
credentialType={credentialType}
isFaded={!isValid}
/>
<View
style={[styles.border, { borderColor: borderColorByStatus[status] }]}
/>
</View>
);
};
Expand All @@ -89,10 +88,6 @@ const credentialCardBackgrounds: {
};

const styles = StyleSheet.create({
previewContainer: {
aspectRatio: 9 / 2,
overflow: "hidden"
},
cardContainer: {
aspectRatio: 16 / 10,
borderRadius: 8,
Expand All @@ -116,10 +111,6 @@ const styles = StyleSheet.create({
borderRadius: 8,
borderWidth: 2
},
label: {
flex: 1,
...makeFontStyleObject(16, "TitilliumSansPro", 20, "Semibold")
},
header: {
display: "flex",
flexDirection: "row",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,11 @@ const styles = StyleSheet.create({
}
}),
borderCurve: "continuous",
borderTopLeftRadius: IOBadgeRadius,
borderBottomLeftRadius: IOBadgeRadius,
borderRadius: IOBadgeRadius,
paddingHorizontal: IOBadgeHSpacing,
paddingVertical: IOBadgeVSpacing
paddingVertical: IOBadgeVSpacing,
paddingEnd: IOBadgeHSpacing + 8,
marginEnd: -IOBadgeHSpacing
},
faded: {
...StyleSheet.absoluteFillObject,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { IOFontWeight, IOText } from "@pagopa/io-app-design-system";
import {
IOFontWeight,
makeFontStyleObject
} from "@pagopa/io-app-design-system";
import React from "react";
import { TextStyle, useWindowDimensions } from "react-native";
import { Text, TextStyle, useWindowDimensions } from "react-native";

export type ClaimLabelProps = {
fontSize?: number;
Expand All @@ -27,21 +30,27 @@ export const ClaimLabel: React.FunctionComponent<
const fontScale = width / 360;

return (
<IOText
<Text
{...props}
allowFontScaling={false}
weight={fontWeight}
font="TitilliumSansPro"
color="black"
lineBreakMode="head"
numberOfLines={1}
style={{ textTransform }}
size={fontSize * fontScale}
// This text should not be read by the voiceover.
// If you want to make it accessible use the parent components
accessible={false}
style={{
...makeFontStyleObject(
fontSize * fontScale,
"TitilliumSansPro",
undefined,
fontWeight,
undefined,
false
),
textTransform
}}
>
{props.children}
</IOText>
</Text>
);
};
Loading
Loading