Skip to content

Instantly share code, notes, and snippets.

@tristen
Created September 14, 2017 00:25
Show Gist options
  • Save tristen/3bb83da8c7c523b03abc6d627153f2ad to your computer and use it in GitHub Desktop.
Save tristen/3bb83da8c7c523b03abc6d627153f2ad to your computer and use it in GitHub Desktop.
import Modal from 'some-react-modal'
export class CoolModal extends React.Component {
render() {
const { title, size, onExit, children } = this.props;
const width = size === 'small' ? '360px' : '600px';
<Modal
onExit={onExit}
enableKeys={true}
closeOnOutsideClick={true}>
<div style={{width}}>
<h1>{title}</h1>
{children}
</div>
</Modal>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment