-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #274 from rebeccaalpert/quick-response
feat(QuickResponse): Add quick response buttons
- Loading branch information
Showing
5 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...ontent/extensions/virtual-assistant/examples/ChatbotMessage/MessageWithQuickResponses.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import Message from '@patternfly/virtual-assistant/dist/dynamic/Message'; | ||
import patternflyAvatar from './patternfly_avatar.jpg'; | ||
|
||
export const MessageWithQuickResponsesExample: React.FunctionComponent = () => ( | ||
<> | ||
<Message | ||
name="Bot" | ||
role="bot" | ||
avatar={patternflyAvatar} | ||
content="Did you clear your cache?" | ||
quickResponses={[ | ||
{ id: '1', content: 'Yes', onClick: () => alert('Clicked yes') }, | ||
{ id: '2', content: 'No', onClick: () => alert('Clicked no') } | ||
]} | ||
/> | ||
<Message | ||
name="Bot" | ||
role="bot" | ||
avatar={patternflyAvatar} | ||
content="What browser are you noticing the issue in?" | ||
quickResponses={[ | ||
{ id: '1', content: 'Microsoft Edge', onClick: () => alert('Clicked Edge') }, | ||
{ id: '2', content: 'Google Chrome', onClick: () => alert('Clicked Chrome') }, | ||
{ id: '3', content: 'Mozilla Firefox', onClick: () => alert('Clicked Firefox') }, | ||
{ id: '4', content: 'Apple Safari', onClick: () => alert('Clicked Safari') }, | ||
{ id: '5', content: 'Internet Explorer', onClick: () => alert('Clicked Internet Explorer') } | ||
]} | ||
/> | ||
<Message | ||
name="Bot" | ||
role="bot" | ||
avatar={patternflyAvatar} | ||
content="Welcome back! How can I help?" | ||
quickResponses={[ | ||
{ id: '1', content: 'Help me with an access issue', onClick: () => alert('Clicked id 1') }, | ||
{ id: '2', content: 'Show my critical vulnerabilities', onClick: () => alert('Clicked id 2') }, | ||
{ id: '3', content: 'Create new integrations', onClick: () => alert('Clicked id 3') }, | ||
{ id: '4', content: 'Get recommendations from an advisor', onClick: () => alert('Clicked id 4') }, | ||
{ id: '5', content: 'Something else', onClick: () => alert('Clicked id 5') } | ||
]} | ||
/> | ||
</> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters