Skip to content

Commit 163a360

Browse files
committed
fix: fullTextView 관련 프롭스 추가
1 parent 8bc0fba commit 163a360

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

packages/tds-widget/src/chat/bubble/bubble-ui.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@ export type BubbleUIProps = (
8181
mediaUrlBase?: string
8282
hasArrow?: boolean
8383
alteredTextColor?: string
84-
fullTextViewAvailable?: boolean
84+
8585
onOpenMenu?: () => void
86-
}
86+
} & Pick<
87+
TextBubbleProp,
88+
| 'fullTextViewAvailable'
89+
| 'isFullTextViewOpen'
90+
| 'openFullTextView'
91+
| 'closeFullTextView'
92+
>
8793

8894
export default function BubbleUI({
8995
type,
@@ -109,6 +115,9 @@ export default function BubbleUI({
109115
hasArrow,
110116
alteredTextColor,
111117
fullTextViewAvailable = false,
118+
isFullTextViewOpen,
119+
openFullTextView,
120+
closeFullTextView,
112121
onOpenMenu,
113122
...props
114123
}: BubbleUIProps) {
@@ -145,6 +154,9 @@ export default function BubbleUI({
145154
onOpenMenu={onOpenMenu}
146155
hasArrow={hasArrow}
147156
fullTextViewAvailable={fullTextViewAvailable}
157+
isFullTextViewOpen={isFullTextViewOpen}
158+
openFullTextView={openFullTextView}
159+
closeFullTextView={closeFullTextView}
148160
onParentMessageClick={onParentMessageClick}
149161
{...props}
150162
/>

packages/tds-widget/src/chat/bubble/text.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ export function TextBubble({
3939
}: TextBubbleProp) {
4040
const aTagNavigator = useATagNavigator(onLinkClick)
4141
const isEllipsis =
42-
fullTextViewAvailable && message.length > MAX_VIEWABLE_TEXT_LENGTH
42+
fullTextViewAvailable &&
43+
openFullTextView &&
44+
message.length > MAX_VIEWABLE_TEXT_LENGTH
4345

4446
return (
4547
<>
@@ -64,7 +66,7 @@ export function TextBubble({
6466
onClick={(e) => aTagNavigator(e)}
6567
/>
6668
{isEllipsis ? (
67-
<FullTextViewButton my={my} onClick={openFullTextView}>
69+
<FullTextViewButton my={my} onClick={() => openFullTextView?.(id)}>
6870
전체보기
6971
<ArrowRight
7072
color={my ? 'var(--color-white900)' : 'var(--color-gray500)'}
@@ -74,7 +76,9 @@ export function TextBubble({
7476
) : null}
7577
</Bubble>
7678

77-
{isFullTextViewOpen && closeFullTextView ? (
79+
{fullTextViewAvailable &&
80+
closeFullTextView &&
81+
isFullTextViewOpen?.(id) ? (
7882
<FullTextMessageView
7983
open
8084
onClose={closeFullTextView}

packages/tds-widget/src/chat/bubble/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export type TextBubbleProp = {
7575
created?: boolean
7676
fullTextViewAvailable?: boolean
7777
onOpenMenu?: () => void
78-
isFullTextViewOpen?: boolean
79-
openFullTextView?: () => void
78+
isFullTextViewOpen?: (id: string) => boolean
79+
openFullTextView?: (id: string) => void
8080
closeFullTextView?: () => void
8181
onParentMessageClick?: (id: string) => void
8282
onLinkClick?: (href: string) => void

0 commit comments

Comments
 (0)