Skip to content

Commit 59a6f0d

Browse files
authored
fix: Fixed a bug where horizontal suggested reply items contents are not wrapping to multiple lines. (#1115)
Fixes: [AC-2521](https://sendbird.atlassian.net/browse/AC-2521) ### Changelogs - Fixed a bug where horizontal suggested reply items contents are not wrapping to multiple lines. ### After ![Screenshot 2024-05-30 at 1 16 39 PM](https://github.com/sendbird/sendbird-uikit-react/assets/16806397/da2a9172-c188-4ca0-a701-b6be4dd5072b) ![Screenshot 2024-05-30 at 1 08 47 PM](https://github.com/sendbird/sendbird-uikit-react/assets/16806397/d8d717cd-a59c-49de-8430-d9a0a995c017) ### Figma https://www.figma.com/design/SVbXU00FhjztekD8AiVukK/UIKit_Work-file_React?node-id=2393-13688&t=cyEn8F21R1sNrdNx-0 [AC-2521]: https://sendbird.atlassian.net/browse/AC-2521?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent eb3d500 commit 59a6f0d

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/modules/GroupChannel/components/SuggestedReplies/index.scss

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@
4747
}
4848

4949
.sendbird-suggested-replies__option {
50-
white-space: nowrap;
51-
height: 32px;
50+
white-space: pre-wrap;
5251
font-size: 12px;
53-
padding: 0 14px;
52+
padding: 8px 14px;
5453
display: flex;
5554
align-items: center;
5655
border-radius: 18px;
5756
cursor: pointer;
57+
word-break: break-word;
5858
@include themed() {
5959
color: t(primary--3-2);
6060
border: 1px solid t(primary--3-2);
@@ -71,4 +71,10 @@
7171
color: t(bg-0);
7272
}
7373
}
74+
&.horizontal {
75+
white-space: nowrap;
76+
}
77+
&.vertical {
78+
white-space: pre-wrap;
79+
}
7480
}

src/modules/GroupChannel/components/SuggestedReplies/index.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ export interface SuggestedRepliesProps {
1111
export interface ReplyItemProps {
1212
value: string;
1313
onClickReply: (event: React.MouseEvent<HTMLDivElement>, option: string) => void;
14+
type?: 'vertical' | 'horizontal';
1415
}
1516

1617
export const ReplyItem = ({
1718
value,
1819
onClickReply,
20+
type = 'vertical',
1921
}: ReplyItemProps) => {
2022
return (
2123
<div
22-
className="sendbird-suggested-replies__option"
24+
className={`sendbird-suggested-replies__option ${type}`}
2325
id={value}
2426
onClick={(e) => onClickReply(e, value)}
2527
>
@@ -46,7 +48,7 @@ const SuggestedReplies = ({ replyOptions, onSendMessage, type = 'vertical' }: Su
4648

4749
const children = replyOptions.map((option: string, index: number) => {
4850
return (
49-
<ReplyItem key={index} value={option} onClickReply={onClickReply}/>
51+
<ReplyItem key={index} value={option} onClickReply={onClickReply} type={type} />
5052
);
5153
});
5254

0 commit comments

Comments
 (0)