Skip to content

Instantly share code, notes, and snippets.

@sagar-gavhane
Created January 8, 2019 12:29
Show Gist options
  • Save sagar-gavhane/67a9d57f4107287d2b85b72512853ea8 to your computer and use it in GitHub Desktop.
Save sagar-gavhane/67a9d57f4107287d2b85b72512853ea8 to your computer and use it in GitHub Desktop.
const FakeModal = ({ children, show }) => (
<Fragment>
<div className="modal" style={{ display: show ? 'block' : 'none' }}>
<div className="modal-content">
<span className="close">&times;</span>
<div className="clearfix" />
<div className="modal-body">{children}</div>
</div>
</div>
</Fragment>
);
// stylesheets
/*
.modal {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.modal-content {
background-color: #fefefe;
margin: auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
}
.close {
color: #aaaaaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
*/
@sagar-gavhane
Copy link
Author

const FakeModal = ({ children, show }) => (
  <Fragment>
    <div className="fake-modal" style={{ display: show ? 'block' : 'none' }}>
      <div className="fake-modal-content">
        <span className="fake-modal-close">&times;</span>
        <div className="clearfix" />
        <div className="fake-modal-body">{children}</div>
      </div>
    </div>
  </Fragment>
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment