Skip to content

Commit af002a1

Browse files
HoonBaekSravan S
andauthored
Hotfix: Add console for announcement of renderCustomMessage props (#54)
* Add console for announcement of renderCustomMessage props * Deprecate unused prop readStatus Co-authored-by: Sravan S <[email protected]>
1 parent 7970a8e commit af002a1

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

src/smart-components/App/stories/index.stories.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ const CustomApp = () => {
276276
setChannelSettings(false);
277277
setChannelSearch(true);
278278
}}
279+
renderCustomMessage={() => {
280+
return null;
281+
}}
279282
/>
280283
</div>
281284
{channelSearch && (

src/smart-components/Conversation/components/ConversationScroll.jsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ ConversationScroll.propTypes = {
238238
deleteMessage: PropTypes.func.isRequired,
239239
resendMessage: PropTypes.func.isRequired,
240240
updateMessage: PropTypes.func.isRequired,
241-
readStatus: PropTypes.shape({}).isRequired,
242241
currentGroupChannel: PropTypes.shape({
243242
markAsRead: PropTypes.func,
244243
members: PropTypes.arrayOf(PropTypes.shape({})),

src/smart-components/Conversation/index.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export const ConversationPanel = (props) => {
8686
console.warn('messageListQuery has been deprecated, please use messageListParams instead');
8787
}
8888

89+
useEffect(() => {
90+
if (renderCustomMessage) {
91+
// eslint-disable-next-line no-console
92+
console.info('The parameter type of renderCustomMessage will be changed to the object in the next minor update.');
93+
}
94+
}, []);
95+
8996
const [intialTimeStamp, setIntialTimeStamp] = useState(startingPoint);
9097
useEffect(() => {
9198
setIntialTimeStamp(startingPoint);

src/smart-components/OpenchannelConversation/hooks/useResendMessageCallback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback } from 'react';
22
import * as messageActionTypes from '../dux/actionTypes';
33

4-
interface StaticParams {
4+
interface DynamicParams {
55
currentOpenChannel: SendbirdUIKit.OpenChannelType;
66
}
77
interface StaticParams {
@@ -11,7 +11,7 @@ interface StaticParams {
1111
type CallbackReturn = (failedMessage: SendbirdUIKit.ClientUserMessage | SendbirdUIKit.ClientFileMessage) => void;
1212

1313
function useResendMessageCallback(
14-
{ currentOpenChannel }: StaticParams,
14+
{ currentOpenChannel }: DynamicParams,
1515
{ logger, messagesDispatcher }: StaticParams,
1616
): CallbackReturn {
1717
return useCallback((failedMessage) => {

src/smart-components/OpenchannelConversation/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ export const OpenchannelConversation = (props: Props): JSX.Element => {
144144
{ channelUrl, sdkInit, fetchingParticipants },
145145
{ sdk, logger, messagesDispatcher },
146146
);
147+
148+
useEffect(() => {
149+
if (renderCustomMessage) {
150+
// eslint-disable-next-line no-console
151+
console.info('The parameter type of renderCustomMessage will be changed to the object in the next minor update.');
152+
}
153+
}, []);
154+
147155
const checkScrollBottom = useCheckScrollBottom(
148156
{ conversationScrollRef },
149157
{ logger },

src/ui/ContextMenu/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ MenuItem.propTypes = {
5050
PropTypes.element,
5151
]).isRequired,
5252
onClick: PropTypes.func.isRequired,
53-
disable: PropTypes.func,
53+
disable: PropTypes.bool,
5454
};
5555

5656
MenuItem.defaultProps = {

0 commit comments

Comments
 (0)