| 1 |
import { Fragment } from 'react'; |
| 2 |
import { Banner, Card, CardBody, Flex, Gallery, GalleryItem, PageSection, Content } from '@patternfly/react-core'; |
| 3 |
|
| 4 |
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper'; |
| 5 |
import { css } from '@patternfly/react-styles'; |
| 6 |
import display from '@patternfly/react-styles/css/utilities/Display/display'; |
| 7 |
|
| 8 |
export const BannerBasicSticky: React.FunctionComponent = () => { |
| 9 |
const banner = ( |
| 10 |
<Banner isSticky> |
| 11 |
<Flex |
| 12 |
justifyContent={{ default: 'justifyContentCenter', lg: 'justifyContentSpaceBetween' }} |
| 13 |
flexWrap={{ default: 'nowrap' }} |
| 14 |
> |
| 15 |
<div className={css(display.displayNone, display.displayBlockOnLg)}>Localhost</div> |
| 16 |
|
| 17 |
<div className={css(display.displayNone, display.displayBlockOnLg)}> |
| 18 |
This message is sticky to the top of the page. |
| 19 |
</div> |
| 20 |
|
| 21 |
<div className={css(display.displayNoneOnLg)}>Drop some text on mobile, truncate if needed.</div> |
| 22 |
|
| 23 |
<div className={css(display.displayNone, display.displayBlockOnLg)}>Ned Username</div> |
| 24 |
</Flex> |
| 25 |
</Banner> |
| 26 |
); |
| 27 |
|
| 28 |
return ( |
| 29 |
<Fragment> |
| 30 |
<DashboardWrapper banner={banner} breadcrumb={null}> |
| 31 |
<PageSection aria-labelledby="main-title"> |
| 32 |
<Content> |
| 33 |
<h1 id="main-title">Main title</h1> |
| 34 |
<p> |
| 35 |
Body text should be Red Hat Text at 1rem (16px). It should have leading of 1.5rem (24px) because <br /> |
| 36 |
of its relative line height of 1.5. |
| 37 |
</p> |
| 38 |
</Content> |
| 39 |
</PageSection> |
| 40 |
|
| 41 |
<PageSection aria-label="Cards gallery"> |
| 42 |
<Gallery hasGutter> |
| 43 |
{Array.from({ length: 30 }).map((_value, index) => ( |
| 44 |
<GalleryItem key={index}> |
| 45 |
<Card> |
| 46 |
<CardBody>This is a card</CardBody> |
| 47 |
</Card> |
| 48 |
</GalleryItem> |
| 49 |
))} |
| 50 |
</Gallery> |
| 51 |
</PageSection> |
| 52 |
</DashboardWrapper> |
| 53 |
</Fragment> |
| 54 |
); |
| 55 |
}; |