-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ObjectPage): Collapse header on scroll (#104)
- Loading branch information
1 parent
43a4354
commit 6788b59
Showing
53 changed files
with
2,594 additions
and
1,115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import React from 'react'; | ||
import { render } from 'react-dom'; | ||
import { ObjectPage } from '@ui5/webcomponents-react/lib/ObjectPage'; | ||
import { Button } from '@ui5/webcomponents-react/lib/Button'; | ||
import { ButtonDesign } from '@ui5/webcomponents-react/lib/ButtonDesign'; | ||
import { Link } from '@ui5/webcomponents-react/lib/Link'; | ||
import { ObjectPageSection } from '@ui5/webcomponents-react/lib/ObjectPageSection'; | ||
import { ObjectPageSubSection } from '@ui5/webcomponents-react/lib/ObjectPageSubSection'; | ||
import { Text } from '@ui5/webcomponents-react/lib/Text'; | ||
import SampleImage from '@ui5/webcomponents-react/src/components/ObjectPage/DemoImage.png'; | ||
import { ThemeProvider } from '@ui5/webcomponents-react/lib/ThemeProvider'; | ||
|
||
const renderHeaderContent = () => ( | ||
<div style={{ display: 'flex', flexDirection: 'column' }}> | ||
<Link href="https://www.sap.com">www.myurl.com</Link> | ||
<Text>Address 1</Text> | ||
<Text>Address 2</Text> | ||
<Text>Address 3</Text> | ||
</div> | ||
); | ||
|
||
render( | ||
<ThemeProvider> | ||
<ObjectPage | ||
title={'Object Page Title'} | ||
subTitle={'Object Page Sub Title'} | ||
headerActions={[ | ||
<Button key="1" design={ButtonDesign.Emphasized}> | ||
Primary Action | ||
</Button>, | ||
<Button key="2">Action</Button> | ||
]} | ||
image={SampleImage} | ||
renderHeaderContent={renderHeaderContent} | ||
imageShapeCircle={false} | ||
showHideHeaderButton={true} | ||
style={{ height: '700px' }} | ||
> | ||
<ObjectPageSection title="Test 1" id="1"> | ||
<div style={{ height: '20px' }}>My Content 1</div> | ||
</ObjectPageSection> | ||
<ObjectPageSection title="Test 2" id="2"> | ||
<div style={{ height: '800px' }}>Test2</div> | ||
</ObjectPageSection> | ||
<ObjectPageSection title="Test 3" id="3"> | ||
Test1 | ||
</ObjectPageSection> | ||
<ObjectPageSection title="Test 4" id="4"> | ||
<h1>Section 4</h1> | ||
<ObjectPageSubSection title="SubSection 4.1" id="4.1"> | ||
Test 4 SubSection 1 | ||
</ObjectPageSubSection> | ||
<ObjectPageSubSection title="SubSection 4.2" id="4.2"> | ||
Test 4 SubSection 2 | ||
</ObjectPageSubSection> | ||
</ObjectPageSection> | ||
<ObjectPageSection title="Test 5" id="5"> | ||
<ObjectPageSubSection title="SubSection 5.1" id="5.1"> | ||
Content of SubSection 5.1 | ||
</ObjectPageSubSection> | ||
<ObjectPageSubSection title="SubSection 5.2" id="5.2"> | ||
Content of SubSection 5.2 | ||
</ObjectPageSubSection> | ||
</ObjectPageSection> | ||
</ObjectPage>{' '} | ||
</ThemeProvider>, | ||
document.querySelector('body') | ||
); |
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,55 @@ | ||
const PATHS = require('../config/paths'); | ||
const path = require('path'); | ||
|
||
const tsLoader = { | ||
test: /\.[tj]sx?$/, | ||
use: [ | ||
{ | ||
loader: require.resolve('babel-loader'), | ||
options: { | ||
presets: [[require.resolve('babel-preset-react-app'), { flow: false, typescript: true }]] | ||
} | ||
} | ||
] | ||
}; | ||
|
||
process.env.NODE_ENV = 'development'; | ||
process.env.BABEL_ENV = 'development'; | ||
|
||
const HtmlWebpackPlugin = require('html-webpack-plugin'); | ||
module.exports = { | ||
mode: 'development', | ||
entry: './index.js', | ||
module: { | ||
rules: [ | ||
tsLoader, | ||
{ | ||
test: /\.png$/, | ||
use: 'file-loader' | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ['style-loader', 'css-loader'], | ||
exclude: { | ||
test: [/test-resources/] | ||
} | ||
} | ||
] | ||
}, | ||
devServer: { | ||
contentBase: __dirname, | ||
compress: true, | ||
port: 9000 | ||
}, | ||
output: { | ||
path: __dirname + '/dist', | ||
filename: 'index_bundle.js' | ||
}, | ||
plugins: [new HtmlWebpackPlugin()], | ||
resolve: { | ||
extensions: ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.esm'], | ||
alias: { | ||
'@ui5/webcomponents-react/lib': path.join(PATHS.root, 'packages', 'main', 'src', 'lib') | ||
} | ||
} | ||
}; |
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
Empty file.
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
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
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
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
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
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
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
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
Oops, something went wrong.