@cometchat/chat-uikit-react-native 5.2.4 → 5.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -78,8 +78,7 @@ export function getLastSeenTime(timestamp: number | null | undefined): string {
|
|
|
78
78
|
try {
|
|
79
79
|
if (timestamp === null || timestamp === undefined) {
|
|
80
80
|
// Move the hook call inside the function, just like in functions.js
|
|
81
|
-
|
|
82
|
-
return t("LAST_SEEN_UNKNOWN");
|
|
81
|
+
return "";
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
// Convert to milliseconds if in seconds
|
package/src/theme/provider.tsx
CHANGED
|
@@ -66,15 +66,20 @@ export const CometChatThemeProvider = ({
|
|
|
66
66
|
const updatedSpacing = light.spacing
|
|
67
67
|
? CometChatThemeHelper.updateSpacing(light.spacing)
|
|
68
68
|
: {} as any;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
69
|
+
|
|
70
|
+
// Create a new object cause react native will know the theme has changed
|
|
71
|
+
const updatedLight = {
|
|
72
|
+
...light,
|
|
73
|
+
color: updatedColors,
|
|
74
|
+
spacing: updatedSpacing
|
|
75
|
+
};
|
|
76
|
+
const mergedTheme = deepMerge(parentProviderTheme.light, updatedLight);
|
|
72
77
|
const defaultLightThemeWithOverridesApplied = isColorAvailable ? lightThemeMaker(
|
|
73
78
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
74
79
|
mergedTheme.color as CometChatTheme["color"],
|
|
75
80
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
76
81
|
) : mergedTheme;
|
|
77
|
-
return deepMerge(defaultLightThemeWithOverridesApplied,
|
|
82
|
+
return deepMerge(defaultLightThemeWithOverridesApplied, updatedLight);
|
|
78
83
|
}
|
|
79
84
|
return parentProviderTheme.light;
|
|
80
85
|
}, [light, parentProviderTheme.light]);
|
|
@@ -91,15 +96,19 @@ export const CometChatThemeProvider = ({
|
|
|
91
96
|
const updatedSpacing = dark.spacing
|
|
92
97
|
? CometChatThemeHelper.updateSpacing(dark.spacing)
|
|
93
98
|
: {} as any;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
// Create a new object cause react native will know the theme has changed
|
|
100
|
+
const updatedDark = {
|
|
101
|
+
...dark,
|
|
102
|
+
color: updatedColors,
|
|
103
|
+
spacing: updatedSpacing
|
|
104
|
+
};
|
|
105
|
+
const mergedTheme = deepMerge(parentProviderTheme.dark, updatedDark);
|
|
97
106
|
const defaultDarkThemeWithOverridesApplied = isColorAvailable ? darkThemeMaker(
|
|
98
107
|
mergedTheme.spacing as CometChatTheme["spacing"],
|
|
99
108
|
mergedTheme.color as CometChatTheme["color"],
|
|
100
109
|
mergedTheme.typography as CometChatTheme["typography"]
|
|
101
110
|
) : mergedTheme;
|
|
102
|
-
return deepMerge(defaultDarkThemeWithOverridesApplied,
|
|
111
|
+
return deepMerge(defaultDarkThemeWithOverridesApplied, updatedDark);
|
|
103
112
|
}
|
|
104
113
|
return parentProviderTheme.dark;
|
|
105
114
|
}, [dark, parentProviderTheme.dark]);
|