Merge pull request #880 from prymitive/flash-badge

chore(ui): flash counter badge on value change
This commit is contained in:
Łukasz Mierzwa
2019-08-17 11:40:33 +01:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -3,6 +3,8 @@ import PropTypes from "prop-types";
import { inject, observer } from "mobx-react";
import Flash from "react-reveal/Flash";
import { AlertStore } from "Stores/AlertStore";
import { TooltipWrapper } from "Components/TooltipWrapper";
import { BaseLabel } from "Components/Labels/BaseLabel";
@@ -36,6 +38,7 @@ const FilteringCounterBadge = inject("alertStore")(
<TooltipWrapper
title={`Click to only show ${value} alerts or Alt+Click to hide them`}
>
<Flash spy={counter}>
<span
className={
themed
@@ -50,6 +53,7 @@ const FilteringCounterBadge = inject("alertStore")(
>
{counter}
</span>
</Flash>
</TooltipWrapper>
);
}

View File

@@ -35,7 +35,8 @@ const validateStyle = (value, themed) => {
themed={themed}
/>
);
expect(tree.find("span").prop("style")).toEqual({});
// opacity=>1 is set by react-reveal/Flash
expect(tree.find("span").prop("style")).toEqual({"opacity": 1});
};
const validateOnClick = (value, themed) => {