Skip to content

Commit 961deb8

Browse files
committed
added container class prop
1 parent dbcde1d commit 961deb8

8 files changed

Lines changed: 13 additions & 237 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
22
example/dist
33
.DS_Store
4+
dist

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
src
2+
tests
3+
.eslintrc
4+
mocha.opts
5+
circle.yml

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
</Modal>
1313
~~~
1414

15-
##New in 0.4
15+
##Transitions
1616

17-
CSS powered transitions! This took a lot of work but is so awesome :)
17+
CSS powered transitions!
1818

1919
In your css file have a transition for the opacity: `transition: 'opacity 1s ease-in'`, now all you do is add in the transition speed as a prop. In the css example I just gave, it's one second:
2020

@@ -57,6 +57,7 @@ export default class App extends React.Component{
5757
className="test-class" //this will completely overwrite the default css completely
5858
style={{background: 'red'}} //overwrites the default background
5959
containerStyle={{background: 'blue'}} //changes styling on the inner content area
60+
containerClassName="test"
6061
closeOnOuterClick={true}
6162
show={this.state.show}
6263
onClose={this.close.bind(this)}>
@@ -77,6 +78,8 @@ export default class App extends React.Component{
7778
- `show`: true or false
7879
- `onClose`: when the modal is sending the close event (only happens is `closeOnOuterClick` is true)
7980
- `className`: this will allow you to completely change the default css located in the component.
81+
- `containerClassName`: change the class on the containing div
82+
8083
- `containerStyle`: changes styles on the modal content area
8184

8285
Minimum required props would be `show` and `onClose`. You can optionally pull in `closeStyle` to use the default close button.

build/simple-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var Modal = (function (_React$Component) {
115115
_extends({}, this.props, { style: modalStyle, onClick: this.hideOnOuterClick, 'data-modal': "true" }),
116116
_react2['default'].createElement(
117117
'div',
118-
{ style: containerStyle },
118+
{ className: this.props.containerClassName, style: containerStyle },
119119
this.props.children
120120
)
121121
);

dist/modal.css

Lines changed: 0 additions & 46 deletions
This file was deleted.

dist/simple-react-modal.js

Lines changed: 0 additions & 186 deletions
This file was deleted.

dist/simple-react-modal.min.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/simple-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export default class Modal extends React.Component{
7979

8080
return (
8181
<div {...this.props} style={modalStyle} onClick={this.hideOnOuterClick} data-modal="true">
82-
<div style={containerStyle}>
82+
<div className={this.props.containerClassName} style={containerStyle}>
8383
{this.props.children}
8484
</div>
8585
</div>

0 commit comments

Comments
 (0)