-
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 #9 from aferd/RHCLOUD-31243
RHCLOUD-31243 add system message entry
- Loading branch information
Showing
4 changed files
with
51 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
...nsions/virtual-assistant/examples/VirtualAssistant/VirtualAssistantSystemMessageEntry.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 SystemMessageEntry from '@patternfly/virtual-assistant/dist/esm/SystemMessageEntry' | ||
|
||
export const BasicExample: React.FunctionComponent = () => ( | ||
<VirtualAssistant > | ||
<SystemMessageEntry>End of conversation.</SystemMessageEntry> | ||
</VirtualAssistant> | ||
); |
28 changes: 28 additions & 0 deletions
28
packages/module/src/SystemMessageEntry/SystemMessageEntry.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,28 @@ | ||
import React from 'react'; | ||
import { Text, TextContent, TextVariants } from '@patternfly/react-core'; | ||
import { createUseStyles } from 'react-jss'; | ||
|
||
export interface SystemMessageEntryProps { | ||
/** Message rendered within the system message entry */ | ||
children: React.ReactNode; | ||
} | ||
|
||
const useStyles = createUseStyles({ | ||
systemMessageText: { | ||
paddingBottom: "var(--pf-v5-global--spacer--md)", | ||
textAlign: "center", | ||
} | ||
}) | ||
|
||
export const SystemMessageEntry: React.FunctionComponent<SystemMessageEntryProps> = (props) => { | ||
const classes = useStyles(); | ||
return ( | ||
<TextContent> | ||
<Text component={TextVariants.small} className={classes.systemMessageText}> | ||
{props.children} | ||
</Text> | ||
</TextContent> | ||
); | ||
}; | ||
|
||
export default SystemMessageEntry; |
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 './SystemMessageEntry'; | ||
|
||
export * from './SystemMessageEntry'; |