This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding media and modal * Fix envs * Moving docker env closer * return dockerfile as is * fixes * give it a try * try again * desparate times * desparate times * host * sidebar * fix
- Loading branch information
Showing
17 changed files
with
192 additions
and
131 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
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,46 @@ | ||
import React, { PropTypes, Component } from 'react'; | ||
|
||
const styles = require('./style.scss'); | ||
|
||
class Sidebar extends Component { | ||
static propTypes = { | ||
open: PropTypes.bool.isRequired, | ||
onSetOpen: PropTypes.func.isRequired, | ||
children: PropTypes.node | ||
}; | ||
|
||
static defaultProps = { | ||
open: false | ||
}; | ||
|
||
componentWillReceiveProps(nextProps) { | ||
if (__CLIENT__ && nextProps.open) { | ||
document.body.removeEventListener('click', this.onBodyClick.bind(this), true); | ||
document.body.addEventListener('click', this.onBodyClick.bind(this), true); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
onBodyClick = (event) => { | ||
const { onSetOpen } = this.props; | ||
|
||
if (!this.refs.container.contains(event.target)) { | ||
return onSetOpen(); | ||
} | ||
|
||
return false; | ||
} | ||
|
||
render() { | ||
const { open, children } = this.props; | ||
|
||
return ( | ||
<div ref="container" className={`${styles.container} ${open && styles.open}`}> | ||
{children} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Sidebar; |
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,26 @@ | ||
@import '../../styles/variables.scss'; | ||
|
||
$width: 20%; | ||
|
||
.container{ | ||
position: fixed; | ||
right: 100%; | ||
top: 0px; | ||
bottom: 0px; | ||
background: #fff; | ||
z-index: 9999; | ||
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15); | ||
|
||
background: #fff; | ||
width: $width; | ||
|
||
transition: right 0.3s; | ||
|
||
@media(max-width: $screen-sm) { | ||
width: 100% - $width; | ||
} | ||
|
||
&.open{ | ||
right: 100% - $width; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
.container{ | ||
margin: 0px; | ||
width: 80%; | ||
width: 100%; | ||
margin-left: 15px; | ||
display: inline-block; | ||
} | ||
|
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
Oops, something went wrong.