-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
57 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
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 { useChatbotContext } from 'mongodb-chatbot-ui'; | ||
import { css, cx } from '@leafygreen-ui/emotion'; | ||
import Button from '@leafygreen-ui/button'; | ||
import Icon from '@leafygreen-ui/icon'; | ||
import IconButton from '@leafygreen-ui/icon-button'; | ||
import { reportAnalytics } from '../../utils/report-analytics'; | ||
import { displayNone } from '../../utils/display-none'; | ||
import { SparkleIcon } from './SparkIcon'; | ||
|
||
const buttonStyling = css` | ||
text-wrap-mode: nowrap; | ||
${displayNone.onMobileAndTablet} | ||
`; | ||
|
||
const iconStyling = css` | ||
${displayNone.onLargerThanTablet} | ||
`; | ||
|
||
const ChatbotButton = () => { | ||
const { openChat } = useChatbotContext(); | ||
const onClick = () => { | ||
reportAnalytics('Chatbot button clicked'); | ||
openChat(); | ||
}; | ||
return ( | ||
<> | ||
<Button | ||
className={cx(buttonStyling)} | ||
leftGlyph={<Icon glyph="Sparkle" />} | ||
aria-label={'Ask MongoDB AI'} | ||
variant={'primaryOutline'} | ||
onClick={onClick} | ||
> | ||
Ask Mongodb AI | ||
</Button> | ||
<IconButton className={iconStyling} variant={'primaryOutline'} aria-label="Ask MongoDB AI" onClick={onClick}> | ||
<SparkleIcon /> | ||
</IconButton> | ||
</> | ||
); | ||
}; | ||
|
||
export default ChatbotButton; |
This file was deleted.
Oops, something went wrong.
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