Skip to content

Commit a56beac

Browse files
xiaoyatongxiaoyatong
andauthored
fix(configprovider): demo 适配 rn & harmony, 调整 cell rtl 样式 (#2347)
* fix: configprovider demo 适配rn & harmony,调整cell样式 * fix: nut-rtl * fix: harmony json * fix: harmony json --------- Co-authored-by: xiaoyatong <[email protected]>
1 parent 6cdb62f commit a56beac

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

packages/nutui-harmony/entry/src/main/resources/base/profile/main_pages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@
8888
"designWidth": 375,
8989
"autoDesignWidth": false
9090
}
91-
}
91+
}

packages/nutui-taro-demo-rn/scripts/taro/adapted.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ exports = module.exports = [
2626
'hoverbutton',
2727
'safearea',
2828
'hoverbuttonitem',
29+
'configprovider',
2930
]

src/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
"author": "songsong"
9494
},
9595
{
96-
"version": "2.0.0",
96+
"version": "3.0.0",
9797
"name": "ConfigProvider",
9898
"type": "component",
9999
"cName": "全局配置",

src/packages/cell/cell.harmony.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
.nut-cell-left {
2222
display: flex;
2323
flex-direction: column;
24+
align-items: flex-start;
2425
flex: 1;
2526
}
2627
.nut-cell-title {

src/packages/cell/cell.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
&-left {
2323
display: flex;
2424
flex-direction: column;
25+
align-items: flex-start;
2526
flex: 1;
2627
}
2728

src/packages/configprovider/demos/h5/demo5.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const Demo5 = () => {
77
<ConfigProvider direction="rtl">
88
<Cell
99
title={
10-
<div style={{ display: 'inline-flex', alignItems: 'center' }}>
11-
<span style={{ marginLeft: '5px' }}>我是标题</span>
10+
<div>
11+
<span>我是标题</span>
1212
</div>
1313
}
1414
description={<span>我是描述</span>}

src/packages/configprovider/demos/taro/demo1.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import React from 'react'
2-
import {
3-
ConfigProvider,
4-
Cell,
5-
// Rate,
6-
Button,
7-
} from '@nutui/nutui-react-taro'
2+
import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
3+
import { harmonyAndRn } from '@/utils/platform-taro'
84
// todo rate icon
95
const Demo1 = () => {
106
return (
117
<>
128
<ConfigProvider>
139
<Cell.Group>
14-
<Cell>{/* <Rate defaultValue={3} /> */}</Cell>
10+
<Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell>
1511
<Cell>
1612
<Button type="primary" block>
1713
提交

src/packages/configprovider/demos/taro/demo2.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import React from 'react'
2-
import {
3-
ConfigProvider,
4-
Cell,
5-
// Rate,
6-
Button,
7-
} from '@nutui/nutui-react-taro'
2+
import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
3+
import { harmonyAndRn } from '@/utils/platform-taro'
84

95
const Demo2 = () => {
106
const darkTheme = {
@@ -16,7 +12,7 @@ const Demo2 = () => {
1612
<>
1713
<ConfigProvider theme={darkTheme}>
1814
<Cell.Group>
19-
<Cell>{/* <Rate defaultValue={3} /> */}</Cell>
15+
<Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell>
2016
<Cell>
2117
<Button type="primary" block>
2218
提交

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
import React from 'react'
22
import { View, Text } from '@tarojs/components'
33
import { ConfigProvider, Cell } from '@nutui/nutui-react-taro'
4+
import pxTransform from '@/utils/px-transform'
45

56
const Demo5 = () => {
67
return (
78
<>
89
<ConfigProvider direction="rtl">
910
<Cell
1011
title={
11-
<View style={{ display: 'inline-flex', alignItems: 'center' }}>
12-
<Text style={{ marginLeft: 5 }}>我是标题</Text>
12+
<View>
13+
<Text style={{ fontSize: pxTransform(14) }}>我是标题</Text>
1314
</View>
1415
}
15-
description={<Text>我是描述</Text>}
16+
description={
17+
<Text style={{ fontSize: pxTransform(12), color: '#ccc' }}>
18+
我是描述
19+
</Text>
20+
}
1621
extra="描述文字"
1722
/>
1823
</ConfigProvider>

0 commit comments

Comments
 (0)