Skip to content

Commit

Permalink
Merge pull request #9 from saiteja13427/main
Browse files Browse the repository at this point in the history
Adding Default Message Option to the Whatsapp Button
  • Loading branch information
awran5 authored Mar 1, 2022
2 parents 87d3e9c + 235cee4 commit 0dced8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function App() {
notificationSound
notificationDelay={30000}
darkMode
defaultMessage={`Hello, I have a query`}
/>
)
}
Expand Down
4 changes: 3 additions & 1 deletion src/Components/FloatingWhatsapp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface FloatingWhatsAppProps {
avatar?: string
statusMessage?: string
chatMessage?: string
defaultMessage?: string
darkMode?: boolean
allowClickAway?: boolean
allowEsc?: boolean
Expand Down Expand Up @@ -81,6 +82,7 @@ export default function FloatingWhatsApp({
height = 320,
avatar = dummyAvatar,
statusMessage = 'Typically replies within 1 hour',
defaultMessage = "Hi, I have a query",
chatMessage = 'Hello there! 🤝 \nHow can we help?',
darkMode = false,
allowClickAway = false,
Expand All @@ -96,7 +98,7 @@ export default function FloatingWhatsApp({
isOpen: false,
isDelay: true,
isNotification: false,
message: ''
message: defaultMessage
})

if (notificationDelay < 30000) throw new Error('notificationDelay prop value must be at least 30 seconds (30000 ms)')
Expand Down

0 comments on commit 0dced8d

Please sign in to comment.