mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
chore(ui): change counter badge background color to light for light theme
This commit is contained in:
@@ -20,11 +20,22 @@ const FilteringCounterBadge = observer(
|
||||
value: PropTypes.string.isRequired,
|
||||
counter: PropTypes.number.isRequired,
|
||||
themed: PropTypes.bool.isRequired,
|
||||
alwaysVisible: PropTypes.bool
|
||||
alwaysVisible: PropTypes.bool,
|
||||
defaultColor: PropTypes.oneOf(["light", "primary"])
|
||||
};
|
||||
static defaultProps = {
|
||||
defaultColor: "light"
|
||||
};
|
||||
|
||||
render() {
|
||||
const { name, value, counter, themed, alwaysVisible } = this.props;
|
||||
const {
|
||||
name,
|
||||
value,
|
||||
counter,
|
||||
themed,
|
||||
alwaysVisible,
|
||||
defaultColor
|
||||
} = this.props;
|
||||
|
||||
if (!alwaysVisible && counter === 0) return null;
|
||||
|
||||
@@ -44,7 +55,8 @@ const FilteringCounterBadge = observer(
|
||||
themed
|
||||
? cs.className
|
||||
: [
|
||||
"badge-primary badge-pill components-label-with-hover",
|
||||
`badge-${defaultColor}`,
|
||||
"badge-pill components-label-with-hover",
|
||||
...cs.baseClassNames
|
||||
].join(" ")
|
||||
}
|
||||
|
||||
@@ -66,8 +66,8 @@ describe("<FilteringCounterBadge />", () => {
|
||||
it("themed @state=suppressed counter badge should have className 'badge-secondary'", () => {
|
||||
validateClassName("suppressed", "badge-success", true);
|
||||
});
|
||||
it("unthemed @state=suppressed counter badge should have className 'badge-primary'", () => {
|
||||
validateClassName("suppressed", "badge-primary", false);
|
||||
it("unthemed @state=suppressed counter badge should have className 'badge-light'", () => {
|
||||
validateClassName("suppressed", "badge-light", false);
|
||||
});
|
||||
|
||||
it("@state=unprocessed counter badge should have empty style", () => {
|
||||
|
||||
@@ -85,6 +85,7 @@ const SilenceComment = ({
|
||||
counter={alertCount}
|
||||
themed={false}
|
||||
alwaysVisible={alertCountAlwaysVisible}
|
||||
defaultColor="primary"
|
||||
/>
|
||||
<FontAwesomeIcon
|
||||
icon={collapsed ? faChevronUp : faChevronDown}
|
||||
|
||||
Reference in New Issue
Block a user