-
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.
fix(SendButton): Adjust disabled state
Adjusted disabled state and also added a demo for always-shown send button, with an explanation on how to use it.
- Loading branch information
1 parent
57da18a
commit f284910
Showing
5 changed files
with
57 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