fix(ui): fix grid animations

Fade on mount wasn't working because it was placed at the wrong level.
Animate group moves around the grid.
This commit is contained in:
Łukasz Mierzwa
2019-04-13 00:43:38 +01:00
parent 2f243b8e16
commit 5836d72513
5 changed files with 14 additions and 10 deletions

View File

@@ -5,7 +5,7 @@
.components-animation-fade-appear-active,
.components-animation-fade-enter-active {
opacity: 1;
transition: opacity 0.15s ease-in;
transition: all 0.3s ease-in;
}
.components-animation-fade-exit {
@@ -13,5 +13,5 @@
}
.components-animation-fade-exit-active {
opacity: 0.01;
transition: opacity 0.15s ease-out;
transition: all 0.3s ease-out;
}

View File

@@ -8,7 +8,7 @@ import "./index.css";
const MountFade = ({ children, duration, ...props }) => (
<CSSTransition
classNames="components-animation-fade"
timeout={150}
timeout={300}
appear={true}
enter={true}
exit={true}

View File

@@ -177,11 +177,8 @@ const AlertGroup = observer(
}
return (
<MountFade>
<div
className="components-grid-alertgrid-alertgroup p-1"
style={style}
>
<div className="components-grid-alertgrid-alertgroup p-1" style={style}>
<MountFade in={true}>
<div className="card">
<GroupHeader
collapseStore={this.collapse}
@@ -240,8 +237,8 @@ const AlertGroup = observer(
/>
) : null}
</div>
</div>
</MountFade>
</MountFade>
</div>
);
}
}

View File

@@ -0,0 +1,5 @@
.components-grid-alertgrid-alertgroup {
transition-property: top, left;
transition-duration: 0.3s;
transition-timing-function: ease;
}

View File

@@ -23,6 +23,8 @@ import { SilenceFormStore } from "Stores/SilenceFormStore";
import { AlertGroup } from "./AlertGroup";
import { GridSizesConfig, GetGridElementWidth } from "./Constants";
import "./index.css";
const AlertGrid = observer(
class AlertGrid extends Component {
static propTypes = {