Skip to content

Commit 7a394c0

Browse files
committed
fix: review
1 parent 8b10703 commit 7a394c0

File tree

3 files changed

+26
-12
lines changed

3 files changed

+26
-12
lines changed

src/packages/skeleton/demos/taro/demo3.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import React from 'react'
22
import { Cell, Skeleton, Space } from '@nutui/nutui-react-taro'
3+
import pxTransform from '@/utils/px-transform'
34

45
const Demo3 = () => {
56
return (
67
<Cell>
78
<Space>
8-
<Skeleton width={60} height={60} />
9-
<Skeleton width={60} height={60} shape="circle" />
9+
<Skeleton width={pxTransform(60)} height={pxTransform(60)} />
10+
<Skeleton
11+
width={pxTransform(60)}
12+
height={pxTransform(60)}
13+
shape="circle"
14+
/>
1015
</Space>
1116
</Cell>
1217
)

src/packages/skeleton/demos/taro/demo4.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
import React from 'react'
22
import { Cell, Skeleton } from '@nutui/nutui-react-taro'
3+
import pxTransform from '@/utils/px-transform'
34

45
const Demo4 = () => {
56
return (
67
<Cell>
7-
<Skeleton width={132} height={132} />
8+
<Skeleton width={pxTransform(132)} height={pxTransform(132)} />
89
<div
910
style={{
1011
display: 'flex',
1112
flexGrow: 1,
1213
flexDirection: 'column',
13-
marginLeft: 10,
14+
marginLeft: pxTransform(10),
1415
}}
1516
>
16-
<Skeleton size="large" style={{ marginBottom: 5 }} />
17-
<Skeleton width="30%" style={{ marginBottom: 5 }} />
17+
<Skeleton size="large" style={{ marginBottom: pxTransform(5) }} />
18+
<Skeleton width="30%" style={{ marginBottom: pxTransform(5) }} />
1819
<Skeleton width="80%" size="small" rows={3} />
1920
</div>
2021
</Cell>

src/packages/skeleton/demos/taro/demo5.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Avatar, Cell, Skeleton, Switch } from '@nutui/nutui-react-taro'
22
import React, { useState } from 'react'
33
import { View, Text } from '@tarojs/components'
4+
import pxTransform from '@/utils/px-transform'
45

56
const Demo5 = () => {
67
const [checked, setChecked] = useState(false)
@@ -13,30 +14,37 @@ const Demo5 = () => {
1314
<Cell>
1415
<Switch
1516
onChange={(value, event) => changeStatus(value)}
16-
style={{ marginBottom: 8 }}
17+
style={{ marginBottom: pxTransform(8) }}
1718
/>
1819
</Cell>
1920
<Cell>
2021
<View style={{ width: '100%' }}>
2122
<View style={{ display: 'flex' }}>
22-
<Skeleton visible={checked} width={50} height={50} shape="circle">
23+
<Skeleton
24+
visible={checked}
25+
width={pxTransform(50)}
26+
height={pxTransform(50)}
27+
shape="circle"
28+
>
2329
<Avatar
2430
className="nut-skeleton-content-avatar"
2531
size="50"
2632
src="https://img14.360buyimg.com/imagetools/jfs/t1/167902/2/8762/791358/603742d7E9b4275e3/e09d8f9a8bf4c0ef.png"
2733
/>
2834
</Skeleton>
29-
<View style={{ flex: 1, marginLeft: 8 }}>
35+
<View style={{ flex: 1, marginLeft: pxTransform(8) }}>
3036
<Skeleton
3137
visible={checked}
3238
size="large"
3339
width="30%"
34-
style={{ marginBottom: 8 }}
40+
style={{ marginBottom: pxTransform(8) }}
3541
>
36-
<span>NutUI-React</span>
42+
<View style={{ lineHeight: 1, height: pxTransform(16) }}>
43+
NutUI-React
44+
</View>
3745
</Skeleton>
3846
<Skeleton visible={checked} size="small" rows={2}>
39-
<Text>
47+
<Text style={{ wordBreak: 'break-all' }}>
4048
一套京东风格的轻量级移动端React组件库,提供丰富的基础组件和业务组件,帮助开发者快速搭建移动应用。
4149
</Text>
4250
</Skeleton>

0 commit comments

Comments
 (0)