diff --git a/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap b/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap index 5d32ec69de..80701d06e4 100644 --- a/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap +++ b/src/packages/progress/__tests__/__snapshots__/progress.spec.tsx.snap @@ -10,7 +10,7 @@ exports[`should render progress when use props 1`] = ` >
diff --git a/src/packages/progress/__tests__/progress.spec.tsx b/src/packages/progress/__tests__/progress.spec.tsx index fde6ea03b2..81e0413f8b 100644 --- a/src/packages/progress/__tests__/progress.spec.tsx +++ b/src/packages/progress/__tests__/progress.spec.tsx @@ -13,9 +13,7 @@ test('should render different height and color when use color height props', asy ) const inner = container.querySelector('.nut-progress-inner') - expect(inner?.getAttribute('style')).toBe( - 'width: 50%; background-color: blue;' - ) + expect(inner?.getAttribute('style')).toBe('width: 50%; background: blue;') }) test('should show percent when use showText props', () => { diff --git a/src/packages/progress/demo.taro.tsx b/src/packages/progress/demo.taro.tsx index 05faffc8cf..a312bb199f 100644 --- a/src/packages/progress/demo.taro.tsx +++ b/src/packages/progress/demo.taro.tsx @@ -56,12 +56,8 @@ const ProgressDemo = () => { {translated.noShowPercentage} - {!harmonyAndRn() && ( - <> - {translated.customContent} - - - )} + {translated.customContent} + {translated.customSize} {translated.statusDisplay} diff --git a/src/packages/progress/demos/h5/demo4.tsx b/src/packages/progress/demos/h5/demo4.tsx index 393f2ec18b..d5251f632b 100644 --- a/src/packages/progress/demos/h5/demo4.tsx +++ b/src/packages/progress/demos/h5/demo4.tsx @@ -6,9 +6,9 @@ const Demo4 = () => { diff --git a/src/packages/progress/demos/h5/demo6.tsx b/src/packages/progress/demos/h5/demo6.tsx index 99a4c573b3..a3f94a16dc 100644 --- a/src/packages/progress/demos/h5/demo6.tsx +++ b/src/packages/progress/demos/h5/demo6.tsx @@ -8,7 +8,7 @@ const Demo6 = () => { diff --git a/src/packages/progress/demos/taro/demo4.tsx b/src/packages/progress/demos/taro/demo4.tsx index 24d6b7995d..2740c9fdf7 100644 --- a/src/packages/progress/demos/taro/demo4.tsx +++ b/src/packages/progress/demos/taro/demo4.tsx @@ -6,8 +6,8 @@ const Demo4 = () => { diff --git a/src/packages/progress/demos/taro/demo6.tsx b/src/packages/progress/demos/taro/demo6.tsx index 60ac132b88..57d07342bd 100644 --- a/src/packages/progress/demos/taro/demo6.tsx +++ b/src/packages/progress/demos/taro/demo6.tsx @@ -1,40 +1,34 @@ import React from 'react' import { Progress, Cell } from '@nutui/nutui-react-taro' import { Checked, Tips } from '@nutui/icons-react-taro' -import { harmonyAndRn } from '@/utils/platform-taro' +import pxTransform from '@/utils/px-transform' const Demo6 = () => { + const iconStyle = { + marginTop: 0, + marginLeft: pxTransform(5), + marginRight: pxTransform(5), + } return ( <> - {!harmonyAndRn() && ( - - )} + - - {!harmonyAndRn() && ( - - )} + + ) diff --git a/src/packages/progress/progress.scss b/src/packages/progress/progress.scss index b7d865ad3a..aaf0574783 100644 --- a/src/packages/progress/progress.scss +++ b/src/packages/progress/progress.scss @@ -29,7 +29,7 @@ justify-content: center; transition: all 0.4s; border-radius: $progress-border-radius; - background-color: $progress-color; + background: $progress-color; } &-text { @@ -39,7 +39,7 @@ top: $progress-text-position-top; bottom: $progress-text-position-bottom; transition: all 0.4s; - // transform: translate(-50%); + transform: translate(-50%); &-inner { display: flex; diff --git a/src/packages/progress/progress.taro.tsx b/src/packages/progress/progress.taro.tsx index b67949ab25..3a34fbd1f3 100644 --- a/src/packages/progress/progress.taro.tsx +++ b/src/packages/progress/progress.taro.tsx @@ -65,7 +65,7 @@ export const Progress: FunctionComponent< const stylesInner: React.CSSProperties = { width: `${displayPercent}%`, - backgroundColor: color || '#FF0F23', + background: color || '#FF0F23', } if (strokeWidth) { @@ -160,8 +160,7 @@ export const Progress: FunctionComponent< } }, []) const getTextStyle = () => { - const value = harmony() ? '93%' : '99%' - return rtl ? { right: value } : { left: value } + return rtl ? { right: '100%' } : { left: '100%' } } const computeRight = () => { if (children) { diff --git a/src/packages/progress/progress.tsx b/src/packages/progress/progress.tsx index 902d6c3553..deba21e7de 100644 --- a/src/packages/progress/progress.tsx +++ b/src/packages/progress/progress.tsx @@ -61,7 +61,7 @@ export const Progress: FunctionComponent< const stylesInner: React.CSSProperties = { width: `${displayPercent}%`, - backgroundColor: color || '#FF0F23', + background: color || '#FF0F23', } useEffect(() => { diff --git a/src/styles/variables.scss b/src/styles/variables.scss index e00ca3545b..7cf2b897c1 100644 --- a/src/styles/variables.scss +++ b/src/styles/variables.scss @@ -1634,7 +1634,10 @@ $popover-menu-item-padding: var( //progress(✅) $progress-height: var(--nutui-progress-height, 10px) !default; -$progress-color: var(--nutui-progress-color, #ff0f23) !default; +$progress-color: var( + --nutui-progress-color, + $color-primary-gradient-1 +) !default; $progress-background: var( --nutui-progress-background, $color-background @@ -1646,7 +1649,7 @@ $progress-text-color: var( ) !default; $progress-text-background: var( --nutui-progress-text-background, - #ff0f23 + $color-primary-gradient-1 ) !default; $progress-text-padding: var(--nutui-progress-text-padding, 0 5px) !default; $progress-text-font-size: var(--nutui-progress-text-font-size, 9px) !default;