Skip to content

Commit 88623f4

Browse files
committed
Add class to placeholder button
1 parent 971fd07 commit 88623f4

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

src/components/Messenger/index.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ interface Props {
3434
greetingDialogDelay?: string
3535
greetingDialogDisplay?: string
3636
color?: string
37+
className?: string
3738
}
3839

3940
interface ChatProps extends Props {
@@ -67,7 +68,13 @@ const CustomerChat = memo(
6768
}
6869
)
6970

70-
const Widget = ({ color }: { color: string }): JSX.Element | null => {
71+
const Widget = ({
72+
color,
73+
className
74+
}: {
75+
color: string
76+
className: string
77+
}): JSX.Element | null => {
7178
const [state, loadChat] = useChat({ loadWhenIdle: true })
7279

7380
if (state === 'complete') {
@@ -76,6 +83,7 @@ const Widget = ({ color }: { color: string }): JSX.Element | null => {
7683

7784
return (
7885
<div
86+
className={className}
7987
style={styles}
8088
role="button"
8189
aria-label="Load Chat"
@@ -104,13 +112,17 @@ const Widget = ({ color }: { color: string }): JSX.Element | null => {
104112
)
105113
}
106114

107-
const Messenger = ({ color = '', ...props }: Props): JSX.Element => {
115+
const Messenger = ({
116+
color = '',
117+
className = 'live-chat-loader-placeholder',
118+
...props
119+
}: Props): JSX.Element => {
108120
const { providerKey } = useProvider()
109121

110122
return (
111123
<>
112124
<CustomerChat color={color} providerKey={providerKey} {...props} />
113-
<Widget color={color} />
125+
<Widget color={color} className={className} />
114126
</>
115127
)
116128
}

0 commit comments

Comments
 (0)