Skip to content

Commit

Permalink
feat(Modal): Pass through props in Modal (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielleHuisman authored and eddywashere committed Dec 18, 2016
1 parent 72d9a0d commit a783308
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/Modal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { PropTypes } from 'react';
import ReactDOM from 'react-dom';
import classNames from 'classnames';
import omit from 'lodash.omit';
import TransitionGroup from 'react-addons-transition-group';
import Fade from './Fade';
import {
Expand Down Expand Up @@ -161,9 +162,19 @@ class Modal extends React.Component {
}

renderChildren() {
const {
className,
cssModule,
isOpen,
size,
backdrop,
children,
...attributes
} = omit(this.props, ['toggle', 'keyboard', 'onEnter', 'onExit', 'zIndex']);

return (
<TransitionGroup component="div">
{this.props.isOpen && (
{isOpen && (
<Fade
key="modal-dialog"
onEnter={this.onEnter}
Expand All @@ -178,19 +189,20 @@ class Modal extends React.Component {
tabIndex="-1"
>
<div
className={mapToCssModules(classNames('modal-dialog', this.props.className, {
[`modal-${this.props.size}`]: this.props.size
}), this.props.cssModule)}
className={mapToCssModules(classNames('modal-dialog', className, {
[`modal-${size}`]: size
}), cssModule)}
role="document"
ref={(c) => (this._dialog = c)}
{...attributes}
>
<div className="modal-content">
{this.props.children}
{children}
</div>
</div>
</Fade>
)}
{this.props.isOpen && this.props.backdrop && (
{isOpen && backdrop && (
<Fade
key="modal-backdrop"
transitionAppearTimeout={150}
Expand Down

0 comments on commit a783308

Please sign in to comment.