-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored overlay into own component
- Loading branch information
Hai Nguyen
committed
Dec 6, 2014
1 parent
49b84ea
commit 767499f
Showing
5 changed files
with
50 additions
and
27 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
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,29 @@ | ||
var React = require('react'), | ||
Classable = require('./mixins/classable.js'); | ||
|
||
var Overlay = React.createClass({ | ||
|
||
mixins: [Classable], | ||
|
||
propTypes: { | ||
show: React.PropTypes.bool | ||
}, | ||
|
||
render: function() { | ||
var | ||
{ | ||
className, | ||
...other | ||
} = this.props, | ||
classes = this.getClasses('mui-overlay', { | ||
'mui-is-shown': this.props.show | ||
}); | ||
|
||
return ( | ||
<div {...other} className={classes} /> | ||
); | ||
} | ||
|
||
}); | ||
|
||
module.exports = Overlay; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.mui-overlay { | ||
position: fixed; | ||
height: 100%; | ||
width: 100%; | ||
z-index: 9; | ||
top: 0px; | ||
|
||
left: -100%; | ||
background-color: rgba(0, 0, 0, 0); | ||
.lh-transition(left 0ms @ease-out-function 400ms, background-color 400ms @ease-out-function 0ms); | ||
|
||
&.mui-is-shown { | ||
left: 0px; | ||
background-color: @light-black; | ||
.lh-transition(left 0ms @ease-out-function 0ms, background-color 400ms @ease-out-function 0ms); | ||
} | ||
} |