mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-05-15 15:22:22 -04:00
Refactor modal components
1. Split out base modal stylings from iframe modal stylings 2. Move iframe-specific stylings into a separate copmonent 3. Move width/height iframe stylings to scss 4. Change global stylings for modals to match #980 5. Update styles to use trello style guide
This commit is contained in:
parent
fa1b6c6c00
commit
c9de1d73d9
18 changed files with 280 additions and 149 deletions
src/components/modal/iframe
47
src/components/modal/iframe/modal.jsx
Normal file
47
src/components/modal/iframe/modal.jsx
Normal file
|
@ -0,0 +1,47 @@
|
|||
var classNames = require('classnames');
|
||||
var React = require('react');
|
||||
|
||||
var Modal = require('../base/modal.jsx');
|
||||
|
||||
require('./modal.scss');
|
||||
|
||||
Modal.setAppElement(document.getElementById('view'));
|
||||
|
||||
var IframeModal = React.createClass({
|
||||
propTypes: {
|
||||
componentKey: React.PropTypes.string,
|
||||
isOpen: React.PropTypes.bool,
|
||||
onRequestClose: React.PropTypes.func,
|
||||
className: React.PropTypes.string,
|
||||
componentRef: React.PropTypes.string,
|
||||
src: React.PropTypes.string
|
||||
},
|
||||
getDefaultProps: function () {
|
||||
return {
|
||||
className: '',
|
||||
iframeClassName: ''
|
||||
};
|
||||
},
|
||||
render: function () {
|
||||
var iframeClasses = classNames(
|
||||
'modal-content-iframe',
|
||||
this.props.className
|
||||
);
|
||||
return (
|
||||
<Modal
|
||||
key={this.props.componentKey}
|
||||
isOpen={this.props.isOpen}
|
||||
onRequestClose={this.props.onRequestClose}
|
||||
className={this.props.className}
|
||||
>
|
||||
<iframe
|
||||
ref={this.props.componentRef}
|
||||
src={this.props.src}
|
||||
className={iframeClasses}
|
||||
/>
|
||||
</Modal>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = IframeModal;
|
5
src/components/modal/iframe/modal.scss
Normal file
5
src/components/modal/iframe/modal.scss
Normal file
|
@ -0,0 +1,5 @@
|
|||
@import "../../../frameless";
|
||||
|
||||
.modal-content-iframe {
|
||||
border: 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue