|
| 1 | +import React from 'react'; |
| 2 | +import { render } from 'react-dom'; |
| 3 | +import { ObjectPage } from '@ui5/webcomponents-react/lib/ObjectPage'; |
| 4 | +import { Button } from '@ui5/webcomponents-react/lib/Button'; |
| 5 | +import { ButtonDesign } from '@ui5/webcomponents-react/lib/ButtonDesign'; |
| 6 | +import { Link } from '@ui5/webcomponents-react/lib/Link'; |
| 7 | +import { ObjectPageSection } from '@ui5/webcomponents-react/lib/ObjectPageSection'; |
| 8 | +import { ObjectPageSubSection } from '@ui5/webcomponents-react/lib/ObjectPageSubSection'; |
| 9 | +import { Text } from '@ui5/webcomponents-react/lib/Text'; |
| 10 | +import SampleImage from '@ui5/webcomponents-react/src/components/ObjectPage/DemoImage.png'; |
| 11 | +import { ThemeProvider } from '@ui5/webcomponents-react/lib/ThemeProvider'; |
| 12 | + |
| 13 | +const renderHeaderContent = () => ( |
| 14 | + <div style={{ display: 'flex', flexDirection: 'column' }}> |
| 15 | + <Link href="https://www.sap.com">www.myurl.com</Link> |
| 16 | + <Text>Address 1</Text> |
| 17 | + <Text>Address 2</Text> |
| 18 | + <Text>Address 3</Text> |
| 19 | + </div> |
| 20 | +); |
| 21 | + |
| 22 | +render( |
| 23 | + <ThemeProvider> |
| 24 | + <ObjectPage |
| 25 | + title={'Object Page Title'} |
| 26 | + subTitle={'Object Page Sub Title'} |
| 27 | + headerActions={[ |
| 28 | + <Button key="1" design={ButtonDesign.Emphasized}> |
| 29 | + Primary Action |
| 30 | + </Button>, |
| 31 | + <Button key="2">Action</Button> |
| 32 | + ]} |
| 33 | + image={SampleImage} |
| 34 | + renderHeaderContent={renderHeaderContent} |
| 35 | + imageShapeCircle={false} |
| 36 | + showHideHeaderButton={true} |
| 37 | + style={{ height: '700px' }} |
| 38 | + > |
| 39 | + <ObjectPageSection title="Test 1" id="1"> |
| 40 | + <div style={{ height: '20px' }}>My Content 1</div> |
| 41 | + </ObjectPageSection> |
| 42 | + <ObjectPageSection title="Test 2" id="2"> |
| 43 | + <div style={{ height: '800px' }}>Test2</div> |
| 44 | + </ObjectPageSection> |
| 45 | + <ObjectPageSection title="Test 3" id="3"> |
| 46 | + Test1 |
| 47 | + </ObjectPageSection> |
| 48 | + <ObjectPageSection title="Test 4" id="4"> |
| 49 | + <h1>Section 4</h1> |
| 50 | + <ObjectPageSubSection title="SubSection 4.1" id="4.1"> |
| 51 | + Test 4 SubSection 1 |
| 52 | + </ObjectPageSubSection> |
| 53 | + <ObjectPageSubSection title="SubSection 4.2" id="4.2"> |
| 54 | + Test 4 SubSection 2 |
| 55 | + </ObjectPageSubSection> |
| 56 | + </ObjectPageSection> |
| 57 | + <ObjectPageSection title="Test 5" id="5"> |
| 58 | + <ObjectPageSubSection title="SubSection 5.1" id="5.1"> |
| 59 | + Content of SubSection 5.1 |
| 60 | + </ObjectPageSubSection> |
| 61 | + <ObjectPageSubSection title="SubSection 5.2" id="5.2"> |
| 62 | + Content of SubSection 5.2 |
| 63 | + </ObjectPageSubSection> |
| 64 | + </ObjectPageSection> |
| 65 | + </ObjectPage>{' '} |
| 66 | + </ThemeProvider>, |
| 67 | + document.querySelector('body') |
| 68 | +); |
0 commit comments