Skip to content

Commit 3e2b337

Browse files
authored
Merge pull request #6 from chrisloarryn/feat-placeholder
feat: custom placeholder
2 parents 921542f + 66f8cff commit 3e2b337

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Components/FloatingWhatsapp.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface FloatingWhatsAppProps {
1111
darkMode?: boolean
1212
styles?: React.CSSProperties
1313
className?: string
14+
placeholder?: string
1415
}
1516

1617
const time = new Date().toTimeString().split(`:`).slice(0, 2).join(`:`)
@@ -25,7 +26,8 @@ function FloatingWhatsApp({
2526
chatMessage = 'Hello there! 🤝 \nHow can we help?',
2627
darkMode = false,
2728
styles = {},
28-
className = ''
29+
className = '',
30+
placeholder = 'Type a message..'
2931
}: FloatingWhatsAppProps): JSX.Element {
3032
const [isOpen, setOpen] = useState(false)
3133
const [message, setMessage] = useState('')
@@ -70,7 +72,7 @@ function FloatingWhatsApp({
7072
<form onSubmit={handleSubmit}>
7173
<input
7274
className={`${css.input} ${isArabic(message) ? css.arabic : ''}`}
73-
placeholder='Type a message..'
75+
placeholder={placeholder}
7476
onChange={handleChange}
7577
value={message}
7678
dir='auto'

src/styles.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
height: 0;
7070
opacity: 0;
7171
transition: height 0.2s ease-out;
72-
box-shadow: 0 4px 12px 0 rgb(0 0 0 / 15%);
72+
box-shadow: 0 4px 12px 0 rgb(0 0 0 / 50%);
7373
}
7474

7575
.whatsappChatBox.open {
@@ -180,6 +180,7 @@
180180
}
181181

182182
.chatBody {
183+
height: inherit;
183184
padding: 20px;
184185
background-size: cover;
185186
background-repeat: repeat;

0 commit comments

Comments
 (0)