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

sagar-gavhane commented Jan 8, 2019

.fake-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(0, 0, 0); /* Fallback color */
  background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}

.fake-modal-content {
  margin: 15px auto;
  padding: 15px 25px;
  width: 90%;
  height: auto;
  border: 2px solid var(--secondary);
  background-color: #fefefe;
  @media screen and (min-width: 767px) {
    padding: 15px 25px;
    margin: 15px auto;
  }
  @media screen and (min-width: 991px) {
    width: 70%;
    padding: 25px 50px;
    margin: 8% auto;
  }
}

.fake-modal-body {
  display: block;
}

.fake-modal-close {
  color: #aaaaaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  display: block;
}

.fake-modal-close:hover,
.fake-modal-close:focus {
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.transact-label {
  width: 100%;
  color: var(--secondary);
  margin: 0.25rem auto;
  display: block;
}

.transact-label-sm {
  width: 100%;
  color: var(--secondary);
  margin: 0.25rem auto;
  font-size: 80%;
}

.transaction-overview-item {
  margin: 0.5rem 0;
  padding: 0 0.5rem;
}

.transact-value {
  font-weight: bold;
  display: block;
}

.transact-scheme-name {
  width: 100%;
  font-weight: bold;
  font-size: 1rem;
  margin: 0.25rem auto;
}

.transact-draw-line {
  border-bottom: 2px solid #e9ecef;
  width: 100%;
  margin: 0.25rem;
  @media screen and (min-width: 767px) {
    margin: 1rem auto;
  }
}

.transact-btn-box {
  margin: 15px auto;
  @media screen and (min-width: 767px) {
    float: left;
    width: 18%;
    margin: auto 1%;
    .btn {
      height: 60px;
    }
  }
}

.transact-modal-title{
  color: var(--primary);
  font-size: 1rem;
  margin: 0.5rem auto;
}

@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