@cometchat/chat-uikit-react-native 4.3.20 → 4.3.22-t1
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.
- package/package.json +1 -1
- package/src/AI/AIConversationSummary/AIConversationSummaryView.tsx +171 -167
- package/src/AI/CardView.tsx +55 -53
- package/src/CometChatCreateGroup/CometChatCreateGroup.tsx +8 -13
- package/src/CometChatGroups/CometChatGroups.tsx +545 -514
- package/src/CometChatJoinProtectedGroup/CometChatJoinProtectedGroup.tsx +5 -8
- package/src/CometChatMessageComposer/CometChatMessageComposer.tsx +544 -378
- package/src/CometChatMessageHeader/CometChatMessageHeader.tsx +103 -78
- package/src/CometChatThreadedMessages/CometChatThreadedMessages.tsx +3 -8
- package/src/CometChatTransferOwnership/CometChatTransferOwnership.tsx +11 -13
- package/src/CometChatUsers/CometChatUsers.tsx +24 -23
- package/src/extensions/CollaborativeBubble/CometChatCollaborativeBubble.tsx +24 -25
- package/src/extensions/Polls/Polls.tsx +8 -16
- package/src/extensions/Polls/PollsBubble.tsx +5 -10
- package/src/extensions/SmartReplies/SmartRepliesView.tsx +16 -22
- package/src/extensions/Stickers/CometChatStickerKeyboard/CometChatStickerKeyboard.tsx +51 -51
- package/src/shared/libs/datePickerModal/DateTimePickerModal.android.js +1 -7
- package/src/shared/utils/CometChatMessagePreview/CometChatMessagePreview.js +38 -46
- package/src/shared/views/CometChatActionSheet/CometChatActionSheet.tsx +19 -19
- package/src/shared/views/CometChatAvatar/CometChatAvatar.tsx +8 -20
- package/src/shared/views/CometChatBadge/CometChatBadge.tsx +8 -14
- package/src/shared/views/CometChatBottomSheet/CometChatBottomSheet.tsx +141 -140
- package/src/shared/views/CometChatConfirmDialog/CometChatConfirmDialog.tsx +47 -51
- package/src/shared/views/CometChatDate/CometChatDate.tsx +18 -17
- package/src/shared/views/CometChatDateTimePicker/CometChatDateTimePicker.tsx +65 -51
- package/src/shared/views/CometChatEmojiKeyboard/CometChatEmojiKeyboard.tsx +76 -72
- package/src/shared/views/CometChatFormBubble/CometChatFormBubble.tsx +3 -8
- package/src/shared/views/CometChatList/CometChatList.tsx +133 -134
- package/src/shared/views/CometChatListItem/CometChatListItem.tsx +65 -64
- package/src/shared/views/CometChatMediaRecorder/CometChatMediaRecorder.tsx +20 -10
- package/src/shared/views/CometChatMessageBubble/CometChatMessageBubble.tsx +3 -8
- package/src/shared/views/CometChatMessageInput/CometChatMessageInput.tsx +24 -23
- package/src/shared/views/CometChatReactions/CometChatReactions.tsx +107 -53
- package/src/shared/views/CometChatReceipt/CometChatReceipt.tsx +22 -14
- package/src/shared/views/CometChatStatusIndicator/CometChatStatusIndicator.tsx +15 -8
- package/src/shared/views/CometChatTextBubble/CometChatTextBubble.tsx +2 -6
- package/src/shared/views/SwipeRow/SwipeRow.tsx +6 -14
- package/android/.gradle/7.4/checksums/checksums.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.4/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.4/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/vcs-1/gc.properties +0 -0
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import React, { useContext, useEffect, useState } from 'react';
|
|
3
2
|
import { View } from 'react-native';
|
|
4
3
|
import { CometChatContext, CometChatTheme, localize } from '../../shared';
|
|
@@ -6,186 +5,191 @@ import { AIConversationSummaryConfiguration } from './configuration';
|
|
|
6
5
|
import { CometChatPanel } from '../../shared/views/CometChatPanel/CometChatPanel';
|
|
7
6
|
import CometChatAICard from '../../shared/views/CometChatAICard/CometChatAICard';
|
|
8
7
|
//@ts-ignore
|
|
9
|
-
import { CometChat } from
|
|
8
|
+
import { CometChat } from '@cometchat/chat-sdk-react-native';
|
|
10
9
|
interface IAIConversationSummaryProps {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const defaultProps: IAIConversationSummaryProps = {
|
|
19
|
-
getConversationSummaryCallback: undefined,
|
|
20
|
-
editReplyCallback: undefined,
|
|
21
|
-
configuration: undefined,
|
|
22
|
-
theme: new CometChatTheme({}),
|
|
23
|
-
onPanelClose: () => { }
|
|
10
|
+
getConversationSummaryCallback?: (theme?: CometChatTheme) => Promise<string>;
|
|
11
|
+
editReplyCallback?: (reply: string) => void;
|
|
12
|
+
configuration?: AIConversationSummaryConfiguration;
|
|
13
|
+
theme?: CometChatTheme;
|
|
14
|
+
onPanelClose: () => void;
|
|
24
15
|
}
|
|
25
16
|
|
|
26
17
|
const enum States {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
loading = 'loading',
|
|
19
|
+
error = 'error',
|
|
20
|
+
empty = 'empty',
|
|
21
|
+
loaded = 'loaded',
|
|
31
22
|
}
|
|
32
23
|
|
|
33
24
|
let inProgress = false;
|
|
34
25
|
const AIConversationSummaryView = (props: IAIConversationSummaryProps) => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
let res: JSX.Element | null = null;
|
|
83
|
-
switch (messageListState) {
|
|
84
|
-
case States.loading:
|
|
85
|
-
res = getLoadingView();
|
|
86
|
-
break;
|
|
87
|
-
case States.error:
|
|
88
|
-
res = getErrorView();
|
|
89
|
-
break;
|
|
90
|
-
case States.empty:
|
|
91
|
-
res = getEmptyView();
|
|
92
|
-
break;
|
|
93
|
-
case States.loaded:
|
|
94
|
-
break;
|
|
95
|
-
default:
|
|
96
|
-
const x: never = messageListState;
|
|
97
|
-
}
|
|
98
|
-
return res;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Creates the loading view
|
|
103
|
-
*/
|
|
104
|
-
function getLoadingView(): JSX.Element {
|
|
105
|
-
let LoadingView = props.configuration?.LoadingStateView;
|
|
106
|
-
return (
|
|
107
|
-
|
|
108
|
-
<CometChatAICard
|
|
109
|
-
state={States.loading}
|
|
110
|
-
style={props.configuration?.conversationSummaryStyle || {}}
|
|
111
|
-
loadingIconURL={props.configuration?.loadingIconURL}
|
|
112
|
-
loadingStateText={loadingStateText}
|
|
113
|
-
>
|
|
114
|
-
{LoadingView ? <LoadingView /> : null}
|
|
115
|
-
</CometChatAICard>
|
|
116
|
-
);
|
|
26
|
+
const {
|
|
27
|
+
getConversationSummaryCallback = undefined,
|
|
28
|
+
editReplyCallback = undefined,
|
|
29
|
+
configuration = undefined,
|
|
30
|
+
theme = useContext(CometChatContext)?.theme || new CometChatTheme({}),
|
|
31
|
+
onPanelClose = () => {},
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
const [messageListState, setMessageListState] = useState<States>(
|
|
35
|
+
States.loading
|
|
36
|
+
);
|
|
37
|
+
const [activeView, setActiveView] = useState<JSX.Element | null>(null);
|
|
38
|
+
|
|
39
|
+
const errorStateText: string = localize('SOMETHING_WRONG');
|
|
40
|
+
const emptyStateText: string = localize('NO_MESSAGES_FOUND');
|
|
41
|
+
const loadingStateText: string = localize('GENERATING_SUMMARY');
|
|
42
|
+
const titleText: string = localize('CONVERSATION_SUMMARY');
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
fetchButtonContent();
|
|
46
|
+
}, []);
|
|
47
|
+
|
|
48
|
+
function fetchButtonContent() {
|
|
49
|
+
setMessageListState(States.loading);
|
|
50
|
+
if (getConversationSummaryCallback) {
|
|
51
|
+
getConversationSummaryCallback(theme)
|
|
52
|
+
.then((response) => {
|
|
53
|
+
if (response) {
|
|
54
|
+
inProgress = true;
|
|
55
|
+
getLoadedView(response)
|
|
56
|
+
.then((res) => {
|
|
57
|
+
setMessageListState(States.loaded);
|
|
58
|
+
setActiveView(res);
|
|
59
|
+
})
|
|
60
|
+
.catch((err) => {
|
|
61
|
+
inProgress = false;
|
|
62
|
+
setMessageListState(States.empty);
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
inProgress = false;
|
|
66
|
+
setMessageListState(States.empty);
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
.catch((err) => {
|
|
70
|
+
inProgress = false;
|
|
71
|
+
setMessageListState(States.error);
|
|
72
|
+
});
|
|
117
73
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Create a view based on the value of the `state` prop.
|
|
78
|
+
*/
|
|
79
|
+
function getStateView(): JSX.Element | null {
|
|
80
|
+
let res: JSX.Element | null = null;
|
|
81
|
+
switch (messageListState) {
|
|
82
|
+
case States.loading:
|
|
83
|
+
res = getLoadingView();
|
|
84
|
+
break;
|
|
85
|
+
case States.error:
|
|
86
|
+
res = getErrorView();
|
|
87
|
+
break;
|
|
88
|
+
case States.empty:
|
|
89
|
+
res = getEmptyView();
|
|
90
|
+
break;
|
|
91
|
+
case States.loaded:
|
|
92
|
+
break;
|
|
93
|
+
default:
|
|
94
|
+
const x: never = messageListState;
|
|
134
95
|
}
|
|
96
|
+
return res;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Creates the loading view
|
|
101
|
+
*/
|
|
102
|
+
function getLoadingView(): JSX.Element {
|
|
103
|
+
let LoadingView = configuration?.LoadingStateView;
|
|
104
|
+
return (
|
|
105
|
+
<CometChatAICard
|
|
106
|
+
state={States.loading}
|
|
107
|
+
style={configuration?.conversationSummaryStyle || {}}
|
|
108
|
+
loadingIconURL={configuration?.loadingIconURL}
|
|
109
|
+
loadingStateText={loadingStateText}
|
|
110
|
+
>
|
|
111
|
+
{LoadingView ? <LoadingView /> : null}
|
|
112
|
+
</CometChatAICard>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
135
115
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Creates the loaded view
|
|
155
|
-
*/
|
|
156
|
-
async function getLoadedView(conversationSummary: string): Promise<JSX.Element> {
|
|
157
|
-
return new Promise((resolve, reject) => {
|
|
158
|
-
try {
|
|
159
|
-
let CustomView = props.configuration?.customView;
|
|
160
|
-
|
|
161
|
-
if (CustomView) {
|
|
162
|
-
props.configuration?.customView!(conversationSummary, props.onPanelClose).then((res: any) => {
|
|
163
|
-
return resolve(res);
|
|
164
|
-
})
|
|
165
|
-
.catch((err: CometChat.CometChatException) => {
|
|
166
|
-
return reject(err)
|
|
167
|
-
})
|
|
168
|
-
} else {
|
|
169
|
-
let conversationSummaryView = <CometChatPanel
|
|
170
|
-
title={titleText}
|
|
171
|
-
textContent={conversationSummary}
|
|
172
|
-
style={props.configuration?.conversationSummaryStyle}
|
|
173
|
-
onClose={props.onPanelClose}
|
|
174
|
-
/>
|
|
175
|
-
return resolve(conversationSummaryView);
|
|
176
|
-
}
|
|
177
|
-
} catch (e) {
|
|
178
|
-
reject(e);
|
|
179
|
-
}
|
|
180
|
-
})
|
|
181
|
-
}
|
|
116
|
+
/**
|
|
117
|
+
* Creates the error view
|
|
118
|
+
*/
|
|
119
|
+
function getErrorView(): JSX.Element | null {
|
|
120
|
+
let ErrorView = configuration?.ErrorStateView;
|
|
121
|
+
return (
|
|
122
|
+
<CometChatAICard
|
|
123
|
+
state={States.error}
|
|
124
|
+
style={configuration?.conversationSummaryStyle || {}}
|
|
125
|
+
errorIconURL={configuration?.errorIconURL}
|
|
126
|
+
errorStateText={errorStateText}
|
|
127
|
+
>
|
|
128
|
+
{ErrorView ? <ErrorView /> : null}
|
|
129
|
+
</CometChatAICard>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
182
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Creates the empty view
|
|
135
|
+
*/
|
|
136
|
+
function getEmptyView(): JSX.Element {
|
|
137
|
+
let EmptyView = configuration?.EmptyStateView;
|
|
183
138
|
return (
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
139
|
+
<CometChatAICard
|
|
140
|
+
state={States.empty}
|
|
141
|
+
style={configuration?.conversationSummaryStyle || {}}
|
|
142
|
+
emptyIconURL={configuration?.emptyIconURL}
|
|
143
|
+
emptyStateText={emptyStateText}
|
|
144
|
+
>
|
|
145
|
+
{EmptyView ? <EmptyView /> : null}
|
|
146
|
+
</CometChatAICard>
|
|
187
147
|
);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Creates the loaded view
|
|
152
|
+
*/
|
|
153
|
+
async function getLoadedView(
|
|
154
|
+
conversationSummary: string
|
|
155
|
+
): Promise<JSX.Element> {
|
|
156
|
+
return new Promise((resolve, reject) => {
|
|
157
|
+
try {
|
|
158
|
+
let CustomView = configuration?.customView;
|
|
159
|
+
|
|
160
|
+
if (CustomView) {
|
|
161
|
+
configuration?.customView!(
|
|
162
|
+
conversationSummary,
|
|
163
|
+
onPanelClose
|
|
164
|
+
)
|
|
165
|
+
.then((res: any) => {
|
|
166
|
+
return resolve(res);
|
|
167
|
+
})
|
|
168
|
+
.catch((err: CometChat.CometChatException) => {
|
|
169
|
+
return reject(err);
|
|
170
|
+
});
|
|
171
|
+
} else {
|
|
172
|
+
let conversationSummaryView = (
|
|
173
|
+
<CometChatPanel
|
|
174
|
+
title={titleText}
|
|
175
|
+
textContent={conversationSummary}
|
|
176
|
+
style={configuration?.conversationSummaryStyle}
|
|
177
|
+
onClose={onPanelClose}
|
|
178
|
+
/>
|
|
179
|
+
);
|
|
180
|
+
return resolve(conversationSummaryView);
|
|
181
|
+
}
|
|
182
|
+
} catch (e) {
|
|
183
|
+
reject(e);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<View style={{ marginTop: 10, overflow: 'hidden' }}>
|
|
190
|
+
{messageListState === States.loaded ? activeView : getStateView()}
|
|
191
|
+
</View>
|
|
192
|
+
);
|
|
188
193
|
};
|
|
189
194
|
|
|
190
|
-
AIConversationSummaryView.defaultProps = defaultProps
|
|
191
195
|
export default AIConversationSummaryView;
|
package/src/AI/CardView.tsx
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
contentContainerStyle,
|
|
4
|
+
getButtonStyles,
|
|
5
|
+
getPopoverStyle,
|
|
6
|
+
} from './style';
|
|
3
7
|
import { CardViewStyle } from './CardViewStyle';
|
|
4
8
|
import { CometChatTheme } from '../shared';
|
|
5
|
-
import { TouchableOpacity,Text,ScrollView, TextStyle } from 'react-native';
|
|
9
|
+
import { TouchableOpacity, Text, ScrollView, TextStyle } from 'react-native';
|
|
6
10
|
import React from 'react';
|
|
7
11
|
import { View } from 'react-native';
|
|
8
12
|
import { AIButtonsStyle } from './utils';
|
|
@@ -10,72 +14,70 @@ export type Card = {
|
|
|
10
14
|
title?: string;
|
|
11
15
|
id?: string;
|
|
12
16
|
onClick?: (id: string) => void;
|
|
13
|
-
style?:AIButtonsStyle;
|
|
17
|
+
style?: AIButtonsStyle;
|
|
14
18
|
};
|
|
15
|
-
interface CardProps
|
|
19
|
+
interface CardProps {
|
|
16
20
|
buttons?: Card[];
|
|
17
|
-
backCallback?:(callback:()=>void) => void;
|
|
18
|
-
cardViewStyle?:CardViewStyle;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const defaultProps:CardProps = {
|
|
22
|
-
buttons: undefined,
|
|
23
|
-
backCallback:undefined,
|
|
24
|
-
cardViewStyle:undefined
|
|
21
|
+
backCallback?: (callback: () => void) => void;
|
|
22
|
+
cardViewStyle?: CardViewStyle;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
export const CardView = (
|
|
26
|
+
{
|
|
27
|
+
buttons= undefined,
|
|
28
|
+
backCallback= undefined,
|
|
29
|
+
cardViewStyle= undefined,
|
|
30
|
+
}: CardProps
|
|
31
|
+
) => {
|
|
29
32
|
const [currentSection, setCurrentSection] = useState<string | null>(null);
|
|
30
33
|
|
|
31
|
-
function fetchButtonContent(button:Card){
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
button.onClick(button.id!)
|
|
34
|
+
function fetchButtonContent(button: Card) {
|
|
35
|
+
setCurrentSection(button?.id!);
|
|
36
|
+
if (button && button.onClick) {
|
|
37
|
+
button.onClick(button.id!);
|
|
38
|
+
}
|
|
37
39
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{props.buttons?.map(item => (
|
|
49
|
-
<TouchableOpacity
|
|
50
|
-
key={item.id} // Make sure to set a unique key for each item
|
|
51
|
-
onPress={() => fetchButtonContent(item)}
|
|
52
|
-
|
|
41
|
+
function getButtons(): JSX.Element | null {
|
|
42
|
+
return (
|
|
43
|
+
<View
|
|
44
|
+
style={{
|
|
45
|
+
width: '100%',
|
|
46
|
+
backgroundColor: 'transparent',
|
|
47
|
+
}}
|
|
53
48
|
>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
{buttons?.map((item) => (
|
|
50
|
+
<TouchableOpacity
|
|
51
|
+
key={item.id} // Make sure to set a unique key for each item
|
|
52
|
+
onPress={() => fetchButtonContent(item)}
|
|
53
|
+
>
|
|
54
|
+
<Text
|
|
55
|
+
style={
|
|
56
|
+
getButtonStyles(
|
|
57
|
+
new CometChatTheme({}),
|
|
58
|
+
item?.style || {}
|
|
59
|
+
) as TextStyle
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
{item.title}
|
|
63
|
+
</Text>
|
|
64
|
+
</TouchableOpacity>
|
|
65
|
+
))}
|
|
66
|
+
</View>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
61
69
|
|
|
62
70
|
return (
|
|
63
|
-
<View style={getPopoverStyle(
|
|
64
|
-
|
|
71
|
+
<View style={getPopoverStyle(cardViewStyle || {}) as TextStyle}>
|
|
65
72
|
<View style={contentContainerStyle as TextStyle}>
|
|
66
|
-
{!currentSection &&
|
|
67
|
-
<ScrollView
|
|
68
|
-
|
|
69
|
-
{ getButtons()}
|
|
73
|
+
{!currentSection && buttons && (
|
|
74
|
+
<ScrollView style={{ height: '100%', width: '100%' }}>
|
|
75
|
+
{getButtons()}
|
|
70
76
|
</ScrollView>
|
|
71
|
-
|
|
72
|
-
|
|
73
77
|
)}
|
|
74
|
-
|
|
75
78
|
</View>
|
|
76
79
|
</View>
|
|
77
80
|
);
|
|
78
81
|
};
|
|
79
82
|
|
|
80
|
-
|
|
81
|
-
export default CardView;
|
|
83
|
+
export default CardView;
|
|
@@ -117,13 +117,13 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
117
117
|
title = localize("NEW_GROUP"),
|
|
118
118
|
closeIcon,
|
|
119
119
|
createIcon,
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
namePlaceholderText= localize('NAME'),
|
|
121
|
+
passwordPlaceholderText= localize('ENTER_YOUR_PASSWORD'),
|
|
122
|
+
createGroupStyle= {},
|
|
122
123
|
disableCloseButton,
|
|
123
124
|
onCreatePress,
|
|
124
125
|
onError,
|
|
125
126
|
onBack,
|
|
126
|
-
createGroupStyle,
|
|
127
127
|
} = props;
|
|
128
128
|
const [password, setPassword] = useState('');
|
|
129
129
|
const [groupType, setGroupType] = React.useState(GroupTypeConstants.public);
|
|
@@ -160,7 +160,7 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
160
160
|
...(createGroupStyle?.tabTextStyle &&
|
|
161
161
|
createGroupStyle?.tabTextStyle),
|
|
162
162
|
},
|
|
163
|
-
] as TextStyle}
|
|
163
|
+
] as TextStyle[]}
|
|
164
164
|
>
|
|
165
165
|
{name}
|
|
166
166
|
</Text>
|
|
@@ -259,7 +259,7 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
259
259
|
styles.errorTextTitle,
|
|
260
260
|
theme.typography.body,
|
|
261
261
|
{ color: theme.palette.getError() },
|
|
262
|
-
] as TextStyle}
|
|
262
|
+
] as TextStyle[]}
|
|
263
263
|
>
|
|
264
264
|
{error?.length > 0 ? error : localize('ERROR_GROUP_CREATE')}
|
|
265
265
|
</Text>
|
|
@@ -268,7 +268,7 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
268
268
|
styles.errorText,
|
|
269
269
|
theme.typography.body,
|
|
270
270
|
{ color: theme.palette.getError() },
|
|
271
|
-
] as TextStyle}
|
|
271
|
+
] as TextStyle[]}
|
|
272
272
|
>
|
|
273
273
|
{localize('TRY_AGAIN_LATER')}
|
|
274
274
|
</Text>
|
|
@@ -354,7 +354,7 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
354
354
|
groupName?.length > 0
|
|
355
355
|
? createGroupStyle?.namePlaceholderTextStyle
|
|
356
356
|
: createGroupStyle?.nameInputTextStyle,
|
|
357
|
-
] as TextStyle}
|
|
357
|
+
] as TextStyle[]}
|
|
358
358
|
/>
|
|
359
359
|
{groupType === GroupTypeConstants.password && (
|
|
360
360
|
<TextInput
|
|
@@ -372,7 +372,7 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
372
372
|
password?.length > 0
|
|
373
373
|
? createGroupStyle?.passwordPlaceholderTextStyle
|
|
374
374
|
: createGroupStyle?.passwordInputTextStyle,
|
|
375
|
-
] as TextStyle}
|
|
375
|
+
] as TextStyle[]}
|
|
376
376
|
/>
|
|
377
377
|
)}
|
|
378
378
|
<ErrorView />
|
|
@@ -380,8 +380,3 @@ export const CometChatCreateGroup = (props: CometChatCreateGroupInterface) => {
|
|
|
380
380
|
);
|
|
381
381
|
};
|
|
382
382
|
|
|
383
|
-
CometChatCreateGroup.defaultProps = {
|
|
384
|
-
namePlaceholderText: localize('NAME'),
|
|
385
|
-
passwordPlaceholderText: localize('ENTER_YOUR_PASSWORD'),
|
|
386
|
-
createGroupStyle: {},
|
|
387
|
-
};
|