Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(progress): fix style & support icon demo #2729

Merged
merged 11 commits into from
Nov 20, 2024
8 changes: 2 additions & 6 deletions src/packages/progress/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ const ProgressDemo = () => {
<Demo2 />
<View className="h2">{translated.noShowPercentage}</View>
<Demo3 />
{!harmonyAndRn() && (
<>
<View className="h2">{translated.customContent}</View>
<Demo4 />
</>
)}
<View className="h2">{translated.customContent}</View>
<Demo4 />
<View className="h2">{translated.customSize}</View>
<Demo5 />
<View className="h2">{translated.statusDisplay}</View>
Expand Down
4 changes: 2 additions & 2 deletions src/packages/progress/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const Demo4 = () => {
<Cell>
<Progress percent={60} showText>
<Image
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
width="30px"
height="30px"
width={20}
height={20}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么改变了值?

src="https://img12.360buyimg.com/imagetools/jfs/t1/229362/18/22746/11607/669f8bfeF5fcbeaab/d4162bbf29bb1b00.png"
/>
</Progress>
Expand Down
21 changes: 8 additions & 13 deletions src/packages/progress/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ 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 (
<>
<Cell>
Expand All @@ -19,22 +25,11 @@ const Demo6 = () => {
</Cell>
<Cell align="center">
<Progress percent={100} />
{!harmonyAndRn() && (
<Checked color="green" style={{ margin: '0 5px' }} />
)}
<Checked color="green" style={iconStyle} />
</Cell>
<Cell align="center">
<Progress percent={100} color="#AAFF00" strokeWidth="15" />
{!harmonyAndRn() && (
<Tips
color={
harmonyAndRn()
? 'red'
: 'linear-gradient(90deg, rgba(180,236,81,1) 0%,rgba(66,147,33,1) 100%)'
}
style={{ margin: '0 5px' }}
/>
)}
<Tips color="#FF0000" style={iconStyle} />
</Cell>
</>
)
Expand Down
2 changes: 1 addition & 1 deletion src/packages/progress/progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions src/packages/progress/progress.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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%' }
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
}
const computeRight = () => {
if (children) {
Expand Down
Loading