Skip to content

Commit 8dfa848

Browse files
committed
v5.2.3
1 parent 9a60f01 commit 8dfa848

File tree

188 files changed

+5396
-955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+5396
-955
lines changed

examples/SampleApp/App.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ enableScreens();
1212
import {
1313
CometChatI18nProvider,
1414
CometChatIncomingCall,
15+
CometChatTheme,
1516
CometChatThemeProvider,
1617
CometChatUIEventHandler,
1718
CometChatUIEvents,
@@ -25,6 +26,9 @@ import RootStackNavigator from './src/navigation/RootStackNavigator';
2526
import { AppConstants } from './src/utils/AppConstants';
2627
import { requestAndroidPermissions } from './src/utils/helper';
2728
import AsyncStorage from '@react-native-async-storage/async-storage';
29+
import { useConfig } from './src/config/store';
30+
import { DeepPartial } from '@cometchat/chat-uikit-react-native/src/shared/helper/types';
31+
import { createTypography } from './src/utils/themeTypography';
2832

2933
// Listener ID for registering and removing CometChat listeners.
3034
const listenerId = 'app';
@@ -40,6 +44,26 @@ const App = (): React.ReactElement => {
4044
const [currentToken, setCurrentToken] = useState('');
4145
const [isTokenRegistered, setIsTokenRegistered] = useState(false);
4246
const [hasValidAppCredentials, setHasValidAppCredentials] = useState(false);
47+
const styleConfig = useConfig(state => state?.settings?.style);
48+
49+
const theme : { light: DeepPartial<CometChatTheme>; dark: DeepPartial<CometChatTheme> } = {
50+
light: {
51+
color: {
52+
primary: styleConfig.color.brandColor,
53+
textPrimary: styleConfig.color.primaryTextLight,
54+
textSecondary: styleConfig.color.secondaryTextLight,
55+
},
56+
typography: createTypography(styleConfig.typography.font),
57+
},
58+
dark: {
59+
color: {
60+
primary: styleConfig.color.brandColor,
61+
textPrimary: styleConfig.color.primaryTextDark,
62+
textSecondary: styleConfig.color.secondaryTextDark,
63+
},
64+
typography: createTypography(styleConfig.typography.font),
65+
},
66+
};
4367

4468
/**
4569
* Initialize CometChat UIKit and configure Google Sign-In.
@@ -246,7 +270,7 @@ const App = (): React.ReactElement => {
246270
return (
247271
<SafeAreaProvider>
248272
<SafeAreaView edges={['top', 'bottom']} style={{ flex: 1 }}>
249-
<CometChatThemeProvider>
273+
<CometChatThemeProvider theme={theme}>
250274
<CometChatI18nProvider>
251275
{/* Render the incoming call UI if the user is logged in and a call is received */}
252276
{isLoggedIn && callReceived && incomingCall.current ? (

examples/SampleApp/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ android {
8383
minSdkVersion rootProject.ext.minSdkVersion
8484
targetSdkVersion rootProject.ext.targetSdkVersion
8585
versionCode 1
86-
versionName "5.2.2"
86+
versionName "5.2.3"
8787
}
8888
signingConfigs {
8989
debug {
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)