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

Open
wants to merge 8 commits into
base: V3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 40 additions & 46 deletions packages/nutui-taro-demo/src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@

const subPackages = [
{
"root": "base",
"pages": [
root: "base",
pages: [
"pages/button/index",
"pages/cell/index",
"pages/configprovider/index",
"pages/icon/index",
"pages/image/index",
"pages/overlay/index"
]
"pages/overlay/index",
],
},
{
"root": "layout",
"pages": [
root: "layout",
pages: [
"pages/divider/index",
"pages/grid/index",
"pages/layout/index",
"pages/safearea/index",
"pages/space/index",
"pages/sticky/index"
]
"pages/sticky/index",
],
},
{
"root": "nav",
"pages": [
root: "nav",
pages: [
"pages/backtop/index",
"pages/elevator/index",
"pages/fixednav/index",
"pages/hoverbutton/index",
"pages/navbar/index",
"pages/sidenavbar/index",
"pages/tabbar/index",
"pages/tabs/index"
]
"pages/tabs/index",
],
},
{
"root": "dentry",
"pages": [
root: "dentry",
pages: [
"pages/address/index",
"pages/calendar/index",
"pages/calendarcard/index",
Expand All @@ -46,12 +44,12 @@ const subPackages = [
"pages/datepicker/index",
"pages/form/index",
"pages/input/index",
"pages/inputnumber/index"
]
"pages/inputnumber/index",
],
},
{
"root": "dataentry",
"pages": [
root: "dentry1",
pages: [
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个不大对~

"pages/menu/index",
"pages/numberkeyboard/index",
"pages/picker/index",
Expand All @@ -63,12 +61,12 @@ const subPackages = [
"pages/signature/index",
"pages/switch/index",
"pages/textarea/index",
"pages/uploader/index"
]
"pages/uploader/index",
],
},
{
"root": "feedback",
"pages": [
root: "feedback",
pages: [
"pages/actionsheet/index",
"pages/badge/index",
"pages/dialog/index",
Expand All @@ -81,15 +79,14 @@ const subPackages = [
"pages/popover/index",
"pages/popup/index",
"pages/pulltorefresh/index",
"pages/resultpage/index",
"pages/skeleton/index",
"pages/swipe/index",
"pages/toast/index"
]
"pages/toast/index",
],
},
{
"root": "exhibition",
"pages": [
root: "exhibition",
pages: [
"pages/animate/index",
"pages/animatingnumbers/index",
"pages/avatar/index",
Expand All @@ -108,32 +105,29 @@ const subPackages = [
"pages/tag/index",
"pages/tour/index",
"pages/video/index",
"pages/virtuallist/index"
]
"pages/virtuallist/index",
],
},
{
"root": "business",
"pages": [
root: "business",
pages: [
"pages/avatarcropper/index",
"pages/barrage/index",
"pages/card/index",
"pages/timeselect/index",
"pages/trendarrow/index",
"pages/watermark/index"
]
}
];
"pages/watermark/index",
],
},
]

export default defineAppConfig({
pages: ['pages/index/index'],
pages: ["pages/index/index"],
subPackages,
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'NutUI-React',
navigationBarTextStyle: 'black'
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
navigationBarTitleText: "NutUI-React",
navigationBarTextStyle: "black",
},
components: ['pages/index/index', ...(subPackages.map(subPackage => {
return subPackage.pages.map(page => `${subPackage.root}/${page}`)
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
}).flat())]
})
})
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
5 changes: 3 additions & 2 deletions src/packages/progress/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { Progress, Image, Cell } from '@nutui/nutui-react-taro'
import pxTransform from '@/utils/px-transform'

const Demo4 = () => {
return (
<Cell>
<Progress percent={60} showText>
<Image
Alex-huxiyang marked this conversation as resolved.
Show resolved Hide resolved
width="30px"
height="30px"
width={pxTransform(20)}
height={pxTransform(20)}
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