| 1 |
import { Fragment } from 'react'; |
| 2 |
import { Alert, AlertActionCloseButton, AlertActionLink } from '@patternfly/react-core'; |
| 3 |
|
| 4 |
export const AlertVariations: React.FunctionComponent = () => ( |
| 5 |
<Fragment> |
| 6 |
<Alert |
| 7 |
variant="success" |
| 8 |
title="Success alert title" |
| 9 |
actionLinks={ |
| 10 |
<Fragment> |
| 11 |
<AlertActionLink component="a" href="#"> |
| 12 |
View details |
| 13 |
</AlertActionLink> |
| 14 |
<AlertActionLink // eslint-disable-next-line no-console |
| 15 |
onClick={() => console.log('Clicked on Ignore')} |
| 16 |
> |
| 17 |
Ignore |
| 18 |
</AlertActionLink> |
| 19 |
</Fragment> |
| 20 |
} |
| 21 |
> |
| 22 |
<p>Success alert description. This should tell the user more information about the alert.</p> |
| 23 |
</Alert> |
| 24 |
<Alert variant="success" title="Success alert title"> |
| 25 |
<p> |
| 26 |
Success alert description. This should tell the user more information about the alert.{' '} |
| 27 |
<a href="#">This is a link.</a> |
| 28 |
</p> |
| 29 |
</Alert> |
| 30 |
<Alert |
| 31 |
variant="success" |
| 32 |
title="Success alert title" |
| 33 |
// eslint-disable-next-line no-console |
| 34 |
actionClose={<AlertActionCloseButton onClose={() => console.log('Clicked the close button')} />} |
| 35 |
> |
| 36 |
<p>Short alert description.</p> |
| 37 |
</Alert> |
| 38 |
<Alert variant="success" title="div success alert title" component="div" /> |
| 39 |
<Alert variant="success" title="h6 Success alert title" component="h6"> |
| 40 |
<p>Short alert description.</p> |
| 41 |
</Alert> |
| 42 |
</Fragment> |
| 43 |
); |