Commit d6330a71 authored by Nikhil Bhargava's avatar Nikhil Bhargava Committed by 陈帅

Allow toggling to let upward trends be positive (instead of only negative)

- Update prop name to be `reverseColor`
parent 3cfbae3b
...@@ -3,11 +3,12 @@ import { Icon } from 'antd'; ...@@ -3,11 +3,12 @@ import { Icon } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './index.less'; import styles from './index.less';
const Trend = ({ colorful = true, flag, children, className, ...rest }) => { const Trend = ({ colorful = true, reverseColor = false, flag, children, className, ...rest }) => {
const classString = classNames( const classString = classNames(
styles.trendItem, styles.trendItem,
{ {
[styles.trendItemGrey]: !colorful, [styles.trendItemGrey]: !colorful,
[styles.reverseColor]: reverseColor && colorful,
}, },
className className
); );
......
...@@ -27,4 +27,11 @@ ...@@ -27,4 +27,11 @@
&.trendItemGrey .down { &.trendItemGrey .down {
color: @text-color; color: @text-color;
} }
&.reverseColor .up {
color: @green-6;
}
&.reverseColor .down {
color: @red-6;
}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment