-
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 #361 from rebeccaalpert/send
fix(SendButton): Adjust disabled state
- Loading branch information
Showing
5 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...dule/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarDisabled.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,26 @@ | ||
import React from 'react'; | ||
import { MessageBar } from '@patternfly/chatbot/dist/dynamic/MessageBar'; | ||
import { Checkbox } from '@patternfly/react-core'; | ||
|
||
export const ChatbotMessageBarDisabledExample: React.FunctionComponent = () => { | ||
const [isDisabled, setIsDisabled] = React.useState(false); | ||
const handleSend = (message) => alert(message); | ||
|
||
return ( | ||
<> | ||
<Checkbox | ||
label="Disable send button" | ||
isChecked={isDisabled} | ||
onChange={() => setIsDisabled(!isDisabled)} | ||
id="disabled" | ||
name="disabled" | ||
/> | ||
<MessageBar | ||
onSendMessage={handleSend} | ||
isSendButtonDisabled={isDisabled} | ||
alwayShowSendButton | ||
hasAttachButton={false} | ||
/> | ||
</> | ||
); | ||
}; |
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
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