فهرست منبع

Allow toggling to let upward trends be positive (instead of only negative)
- Update prop name to be `reverseColor`

Nikhil Bhargava 7 سال پیش
والد
کامیت
d6330a71ba
2فایلهای تغییر یافته به همراه9 افزوده شده و 1 حذف شده
  1. 2 1
      src/components/Trend/index.js
  2. 7 0
      src/components/Trend/index.less

+ 2 - 1
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
   );

+ 7 - 0
src/components/Trend/index.less

@@ -27,4 +27,11 @@
   &.trendItemGrey .down {
     color: @text-color;
   }
+
+  &.reverseColor .up {
+    color: @green-6;
+  }
+  &.reverseColor .down {
+    color: @red-6;
+  }
 }