From d6330a71ba2cf636ba9fca3b03e2094356b32ac1 Mon Sep 17 00:00:00 2001 From: Nikhil Bhargava Date: Fri, 27 Apr 2018 23:27:40 -0400 Subject: [PATCH] Allow toggling to let upward trends be positive (instead of only negative) - Update prop name to be `reverseColor` --- src/components/Trend/index.js | 3 ++- src/components/Trend/index.less | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Trend/index.js b/src/components/Trend/index.js index cde4ef60..1cdceb2e 100644 --- a/src/components/Trend/index.js +++ b/src/components/Trend/index.js @@ -3,11 +3,12 @@ import { Icon } from 'antd'; import classNames from 'classnames'; 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( styles.trendItem, { [styles.trendItemGrey]: !colorful, + [styles.reverseColor]: reverseColor && colorful, }, className ); diff --git a/src/components/Trend/index.less b/src/components/Trend/index.less index ea66fcf7..b14b802c 100644 --- a/src/components/Trend/index.less +++ b/src/components/Trend/index.less @@ -27,4 +27,11 @@ &.trendItemGrey .down { color: @text-color; } + + &.reverseColor .up { + color: @green-6; + } + &.reverseColor .down { + color: @red-6; + } } -- GitLab