Skip to content

Commit 643fe3f

Browse files
committed
Add appBarZDepth prop.
1 parent b58b8ff commit 643fe3f

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import FullscreenDialog from 'material-ui-fullscreen-dialog'
3434
| --- | --- | --- | --- |
3535
| actionButton | `node` | | A `FlatButton` or `IconButton` that is used as affirmative action button. |
3636
| appBarStyle | `object` | | Overrides the inline-styles of the app bar. |
37+
| appBarZDepth | `number` | 1 | Overrides the z-depth of the app bar, will affect its shadow. This is ignored if immersive is set to `true`. |
3738
| children | `node` | | Children elements. |
3839
| closeIcon | `node` | Close icon | Icon element used for the dismissive action. This is hidden if `onRequestClose` is not set. |
3940
| containerStyle | `object` | | Overrides the inline-styles of the dialog's children container. |

src/FullscreenDialog.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default function FullscreenDialog (props, { muiTheme }) {
3535
const {
3636
actionButton,
3737
appBarStyle,
38+
appBarZDepth,
3839
children,
3940
closeIcon,
4041
containerStyle,
@@ -62,7 +63,7 @@ export default function FullscreenDialog (props, { muiTheme }) {
6263
)}
6364
iconElementRight={actionButton}
6465
showMenuIconButton={onRequestClose != null}
65-
zDepth={immersive ? 0 : undefined}
66+
zDepth={immersive ? 0 : appBarZDepth}
6667
/>
6768
<div style={{ ...styles.container, ...containerStyle }}>
6869
{children}
@@ -74,6 +75,7 @@ export default function FullscreenDialog (props, { muiTheme }) {
7475
FullscreenDialog.propTypes = {
7576
actionButton: PropTypes.node,
7677
appBarStyle: PropTypes.object,
78+
appBarZDepth: PropTypes.oneOf([1, 2, 3, 4, 5]),
7779
children: PropTypes.node,
7880
closeIcon: PropTypes.node,
7981
containerStyle: PropTypes.object,
@@ -86,7 +88,8 @@ FullscreenDialog.propTypes = {
8688
}
8789

8890
FullscreenDialog.defaultProps = {
89-
immersive: false
91+
immersive: false,
92+
appBarZDepth: 1
9093
}
9194

9295
FullscreenDialog.contextTypes = {

stories/index.js

+10
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,13 @@ storiesOf('FullscreenDialog', module)
5555
<img src='https://lorempixel.com/1920/1080/cats/' style={{ width: '100%' }} />
5656
</FullscreenDialog>
5757
))
58+
.add('with custom z-depth', () => themed(
59+
<FullscreenDialog
60+
open
61+
title='Demo dialog'
62+
onRequestClose={action('onRequestClose')}
63+
appBarZDepth={2}
64+
>
65+
More shadow.
66+
</FullscreenDialog>
67+
))

0 commit comments

Comments
 (0)