Remove modal fade animations

pull/41/head
Uku Taht 7 years ago
parent 9ce1c1f30b
commit f892562a92

@ -35,17 +35,6 @@
overflow-y: auto;
}
.modal__loader {
margin: 300px auto 0 auto;
animation: loaderFadein .4s ease-in;
}
@keyframes loaderFadein {
0% { opacity: 0; }
50% { opacity: 0; }
100% { opacity: 1; }
}
.modal__container {
background-color: #fff;
padding: 1rem 2rem;

@ -30,7 +30,11 @@ class CountriesModal extends React.Component {
}
renderBody() {
if (this.state.countries) {
if (this.state.loading) {
return (
<div className="loading mt-32 mx-auto"><div></div></div>
)
} else if (this.state.countries) {
return (
<React.Fragment>
<header className="modal__header">

@ -93,7 +93,11 @@ class GoogleKeywordsModal extends React.Component {
}
renderBody() {
if (!this.state.loading) {
if (this.state.loading) {
return (
<div className="loading mt-32 mx-auto"><div></div></div>
)
} else {
return (
<React.Fragment>
<header className="modal__header">

@ -2,12 +2,6 @@ import React from "react";
import { createPortal } from "react-dom";
import { withRouter } from 'react-router-dom';
function SlideIn({show, children}) {
const className = show ? "modal-enter-active" : "modal-enter"
return <div className={className}>{children}</div>
}
class Modal extends React.Component {
constructor(props) {
super(props)
@ -53,15 +47,9 @@ class Modal extends React.Component {
<div className="modal is-open" onClick={this.props.onClick}>
<div className="modal__overlay">
<button className="modal__close"></button>
{ !this.props.show &&
<div className="modal__loader loading"><div></div></div>
}
<SlideIn show={this.props.show}>
<div ref={this.node} className="modal__container">
{this.props.children}
</div>
</SlideIn>
<div ref={this.node} className="modal__container">
{this.props.children}
</div>
</div>
</div>,

@ -45,7 +45,11 @@ class PagesModal extends React.Component {
}
renderBody() {
if (this.state.pages) {
if (this.state.loading) {
return (
<div className="loading mt-32 mx-auto"><div></div></div>
)
} else if (this.state.pages) {
return (
<React.Fragment>
<header className="modal__header">
@ -74,7 +78,7 @@ class PagesModal extends React.Component {
render() {
return (
<Modal site={this.props.site} show={!this.state.loading}>
<Modal site={this.props.site}>
{ this.renderBody() }
</Modal>
)

@ -113,7 +113,11 @@ class ReferrerDrilldownModal extends React.Component {
}
renderBody() {
if (this.state.referrers) {
if (this.state.loading) {
return (
<div className="loading mt-32 mx-auto"><div></div></div>
)
} else if (this.state.referrers) {
return (
<React.Fragment>
<header className="modal__header">

@ -54,7 +54,11 @@ class ReferrersModal extends React.Component {
}
renderBody() {
if (this.state.referrers) {
if (this.state.loading) {
return (
<div className="loading mt-32 mx-auto"><div></div></div>
)
} else if (this.state.referrers) {
return (
<React.Fragment>
<header className="modal__header">
@ -83,7 +87,7 @@ class ReferrersModal extends React.Component {
render() {
return (
<Modal site={this.props.site} show={!this.state.loading}>
<Modal site={this.props.site}>
{ this.renderBody() }
</Modal>
)

Loading…
Cancel
Save