diff --git a/ui/src/Components/Animations/MountFade/index.css b/ui/src/Components/Animations/MountFade/index.css new file mode 100644 index 000000000..61752ab91 --- /dev/null +++ b/ui/src/Components/Animations/MountFade/index.css @@ -0,0 +1,23 @@ +.components-animation-fade-appear { + opacity: 0.01; +} +.components-animation-fade-appear-active { + opacity: 1; + transition: opacity 0.15s ease-in; +} + +.components-animation-fade-enter { + opacity: 0.01; +} +.components-animation-fade-enter-active { + opacity: 1; + transition: opacity 0.15s ease-in; +} + +.components-animation-fade-exit { + opacity: 1; +} +.components-animation-fade-exit-active { + opacity: 0.01; + transition: opacity 0.15s ease-in; +} diff --git a/ui/src/Components/Animations/MountFade/index.js b/ui/src/Components/Animations/MountFade/index.js new file mode 100644 index 000000000..7e46b21c6 --- /dev/null +++ b/ui/src/Components/Animations/MountFade/index.js @@ -0,0 +1,25 @@ +import React from "react"; +import PropTypes from "prop-types"; + +import { CSSTransition } from "react-transition-group"; + +import "./index.css"; + +const MountFade = ({ children, duration, ...props }) => ( + + {children} + +); +MountFade.propTypes = { + children: PropTypes.node.isRequired +}; + +export { MountFade }; diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.css b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.css deleted file mode 100644 index 0d46bb1de..000000000 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.css +++ /dev/null @@ -1,26 +0,0 @@ -.components-grid-alertgrid-alertgroup-fade-enter { - opacity: 0.01; -} - -.components-grid-alertgrid-alertgroup-fade-enter-active { - opacity: 1; - transition: opacity 0.4s ease-in; -} - -.components-grid-alertgrid-alertgroup-fade-exit { - opacity: 1; -} - -.components-grid-alertgrid-alertgroup-fade-exit-active { - opacity: 0.01; - transition: opacity 0.4s ease-in; -} - -.components-grid-alertgrid-alertgroup-fade-appear { - opacity: 0.01; -} - -.components-grid-alertgrid-alertgroup-fade-appear-active { - opacity: 1; - transition: opacity 0.4s ease-in; -} diff --git a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js index 99e334b9f..8287590be 100644 --- a/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js +++ b/ui/src/Components/Grid/AlertGrid/AlertGroup/index.js @@ -6,20 +6,17 @@ import { observable, action, toJS } from "mobx"; import hash from "object-hash"; -import { CSSTransition } from "react-transition-group"; - import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faPlus } from "@fortawesome/free-solid-svg-icons/faPlus"; import { faMinus } from "@fortawesome/free-solid-svg-icons/faMinus"; +import { MountFade } from "Components/Animations/MountFade"; import { Settings } from "Stores/Settings"; import { SilenceFormStore } from "Stores/SilenceFormStore"; import { GroupHeader } from "./GroupHeader"; import { Alert } from "./Alert"; import { GroupFooter } from "./GroupFooter"; -import "./index.css"; - const LoadButton = ({ icon, action }) => { return (