Skip to content

Commit e7e2e09

Browse files
authored
feat: Added feedbackEnabled in UIKitOptions (#918)
Fixes: [AC-984](https://sendbird.atlassian.net/browse/AC-984) ### Changelogs - Added `feedbackEnabled` in `UIKitOptions` [AC-984]: https://sendbird.atlassian.net/browse/AC-984?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 9de1844 commit e7e2e09

File tree

7 files changed

+14
-9
lines changed

7 files changed

+14
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
"dependencies": {
7070
"@sendbird/chat": "^4.10.6",
71-
"@sendbird/uikit-tools": "0.0.1-alpha.43",
71+
"@sendbird/uikit-tools": "0.0.1-alpha.52",
7272
"css-vars-ponyfill": "^2.3.2",
7373
"date-fns": "^2.16.1",
7474
"dompurify": "^3.0.1"

src/lib/Sendbird.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ const SendbirdSDK = ({
372372
enableDocument: configs.groupChannel.channel.input.enableDocument,
373373
threadReplySelectType: getCaseResolvedThreadReplySelectType(configs.groupChannel.channel.threadReplySelectType).lowerCase,
374374
typingIndicatorTypes: configs.groupChannel.channel.typingIndicatorTypes,
375+
enableFeedback: configs.groupChannel.channel.enableFeedback,
375376
},
376377
openChannel: {
377378
enableOgtag:

src/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export interface SendBirdStateConfig {
101101
enableDocument: SBUConfig['groupChannel']['channel']['input']['enableDocument'];
102102
threadReplySelectType: SBUConfig['groupChannel']['channel']['threadReplySelectType'];
103103
typingIndicatorTypes: SBUConfig['groupChannel']['channel']['typingIndicatorTypes'];
104+
enableFeedback: SBUConfig['groupChannel']['channel']['enableFeedback'];
104105
},
105106
openChannel: {
106107
enableOgtag: SBUConfig['openChannel']['channel']['enableOgtag'];

src/lib/utils/uikitConfigMapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export function uikitConfigMapper({
3535
enableDocument: uikitOptions.groupChannel?.input?.enableDocument,
3636
},
3737
typingIndicatorTypes: uikitOptions.groupChannel?.typingIndicatorTypes,
38+
enableFeedback: uikitOptions.groupChannel?.enableFeedback,
3839
},
3940
groupChannelList: {
4041
enableTypingIndicator: uikitOptions.groupChannelList?.enableTypingIndicator ?? isTypingIndicatorEnabledOnChannelList,

src/modules/App/stories/integrated.stories.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ export const GroupChannel = () => {
350350
groupChannel: {
351351
// enableTypingIndicator: false,
352352
typingIndicatorTypes: new Set([TypingIndicatorType.Bubble, TypingIndicatorType.Text]),
353+
// enableFeedback: false, // This disables feedback message feature.
353354
}
354355
}}
355356
imageCompression={{ compressionRate: sampleOptions.imageCompression ? 0.7 : 1 }}

src/ui/MessageContent/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ export default function MessageContent(props: MessageContentProps): ReactElement
163163
const isFeedbackMessage = !isByMe
164164
&& message?.myFeedbackStatus
165165
&& message.myFeedbackStatus !== SbFeedbackStatus.NOT_APPLICABLE;
166-
const feedbackMessageClassName = isFeedbackMessage ? 'sendbird-message-content__feedback' : '';
166+
const isFeedbackEnabled = config?.groupChannel?.enableFeedback && isFeedbackMessage;
167+
const feedbackMessageClassName = isFeedbackEnabled ? 'sendbird-message-content__feedback' : '';
167168

168169
// onMouseDown: (e: React.MouseEvent<T>) => void;
169170
// onTouchStart: (e: React.TouchEvent<T>) => void;
@@ -319,7 +320,7 @@ export default function MessageContent(props: MessageContentProps): ReactElement
319320
)}
320321
{/* Feedback buttons */}
321322
{
322-
isFeedbackMessage && <div
323+
isFeedbackEnabled && <div
323324
className='sendbird-message-content__middle__body-container__feedback-buttons-container'
324325
>
325326
<FeedbackIconButton

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,7 +2679,7 @@ __metadata:
26792679
"@rollup/plugin-replace": ^5.0.4
26802680
"@rollup/plugin-typescript": ^11.1.5
26812681
"@sendbird/chat": ^4.10.6
2682-
"@sendbird/uikit-tools": 0.0.1-alpha.43
2682+
"@sendbird/uikit-tools": 0.0.1-alpha.52
26832683
"@storybook/addon-actions": ^6.5.10
26842684
"@storybook/addon-docs": ^6.5.10
26852685
"@storybook/addon-links": ^6.5.10
@@ -2744,13 +2744,13 @@ __metadata:
27442744
languageName: unknown
27452745
linkType: soft
27462746

2747-
"@sendbird/uikit-tools@npm:0.0.1-alpha.43":
2748-
version: 0.0.1-alpha.43
2749-
resolution: "@sendbird/uikit-tools@npm:0.0.1-alpha.43"
2747+
"@sendbird/uikit-tools@npm:0.0.1-alpha.52":
2748+
version: 0.0.1-alpha.52
2749+
resolution: "@sendbird/uikit-tools@npm:0.0.1-alpha.52"
27502750
peerDependencies:
2751-
"@sendbird/chat": ^4.9.2
2751+
"@sendbird/chat": ^4.10.5
27522752
react: ">=16.8.6"
2753-
checksum: 7aa888a2888faf7295dbdfca91cf60e70e2933e52b3158a7b4b6de8b01f406bbf429ce83ee44133e636ce8e4f1157ee6c885f3ca802780fa22e6ac5e24bf563c
2753+
checksum: d2081bb7610110e32ef655bcb7e90116215e9b647905f5e7264f5d7dcd2862ba15727e58103b70e09e37b36c2526ae7227b03df8d24ba01759beef782da913e8
27542754
languageName: node
27552755
linkType: hard
27562756

0 commit comments

Comments
 (0)