Skip to content

Commit e35cc9c

Browse files
committed
Add align prop to Modal to vertical align
1 parent 0c03eb2 commit e35cc9c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/SLDSModal/index.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ const customStyles = {
4141
module.exports = React.createClass( {
4242

4343
propTypes: {
44+
align: React.PropTypes.oneOf(['top', 'center']),
4445
size: React.PropTypes.oneOf(['medium', 'large']),
4546
prompt: React.PropTypes.oneOf(['', 'success', 'warning', 'error', 'wrench', 'offline', 'info'])
4647
},
4748

4849
getDefaultProps () {
4950
return {
51+
align:'center',
5052
title:'',
5153
tagline:'',
5254
isOpen:false,
@@ -124,6 +126,7 @@ module.exports = React.createClass( {
124126
'slds-modal--large':this.props.size === 'large',
125127
'slds-modal--prompt':this.isPrompt()
126128
};
129+
const modalStyle = this.props.align === "top"?{ "justify-content": "flex-start" }:null;
127130

128131
return <div
129132
className={cx(modalClass)}
@@ -134,6 +137,7 @@ module.exports = React.createClass( {
134137
role='dialog'
135138
className='slds-modal__container'
136139
onClick={this.handleModalClick}
140+
style={modalStyle}
137141
>
138142

139143
{this.headerComponent()}

0 commit comments

Comments
 (0)