-
Notifications
You must be signed in to change notification settings - Fork 26
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 #8 from aferd/RHCLOUD-31244
RHCLOUD-31244 add conversation alert
- Loading branch information
Showing
4 changed files
with
61 additions
and
0 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
9 changes: 9 additions & 0 deletions
9
...ensions/virtual-assistant/examples/VirtualAssistant/VirtualAssistantConversationAlert.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,9 @@ | ||
import React from 'react'; | ||
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant'; | ||
import ConversationAlert from '@patternfly/virtual-assistant/dist/esm/ConversationAlert' | ||
|
||
export const BasicExample: React.FunctionComponent = () => ( | ||
<VirtualAssistant > | ||
<ConversationAlert title="You can start a new conversation at any time by typing below." /> | ||
</VirtualAssistant> | ||
); |
38 changes: 38 additions & 0 deletions
38
packages/module/src/ConversationAlert/ConversationAlert.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,38 @@ | ||
import React from 'react'; | ||
import { Alert, TextContent } from '@patternfly/react-core'; | ||
|
||
import { createUseStyles } from 'react-jss'; | ||
|
||
export interface ConversationAlertProps { | ||
/** Text for conversation alert */ | ||
title: string; | ||
/** Variant type for conversation alert */ | ||
variant?: 'success' | 'danger' | 'warning' | 'info' | 'custom'; | ||
} | ||
|
||
const useStyles = createUseStyles({ | ||
banner: { | ||
paddingTop: "0", | ||
paddingBottom: "var(--pf-v5-global--spacer--md)", | ||
}, | ||
bannerAlert: { | ||
"& .pf-v5-c-alert__title": { | ||
marginTop: "0", | ||
fontSize: "var(--pf-v5-global--FontSize--sm)", | ||
} | ||
} | ||
}) | ||
|
||
export const ConversationAlert:React.FunctionComponent<ConversationAlertProps> = ({ | ||
variant= 'info', | ||
title | ||
}: ConversationAlertProps) => { | ||
const classes = useStyles(); | ||
return ( | ||
<TextContent className={classes.banner}> | ||
<Alert className={classes.bannerAlert} variant={variant} isInline title={title} component="h6" /> | ||
</TextContent> | ||
); | ||
}; | ||
|
||
export default ConversationAlert; |
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,3 @@ | ||
export { default } from './ConversationAlert'; | ||
|
||
export * from './ConversationAlert'; |