Skip to content

Commit ce66f75

Browse files
authored
fix: 恢复icon,简化demo (#2725)
1 parent f9df8ff commit ce66f75

File tree

7 files changed

+21
-141
lines changed

7 files changed

+21
-141
lines changed

src/packages/hoverbutton/demo.taro.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,9 @@ import { Cell } from '@nutui/nutui-react-taro'
55
import { useTranslate } from '@/sites/assets/locale/taro'
66
import Header from '@/sites/components/header'
77
import Demo1 from './demos/taro/demo1'
8-
import Demo1Rn from './demos/taro/demo1-rn'
98
import Demo2 from './demos/taro/demo2'
10-
import Demo2Rn from './demos/taro/demo2-rn'
119
import Demo3 from './demos/taro/demo3'
12-
import Demo3Rn from './demos/taro/demo3-rn'
1310
import Demo4 from './demos/taro/demo4'
14-
import Demo4Rn from './demos/taro/demo4-rn'
1511
import { harmonyAndRn } from '@/utils/platform-taro'
1612
// import Demo5 from './demos/taro/demo5'
1713

@@ -97,10 +93,10 @@ const HoverDemo = () => {
9793
)} */}
9894
</ScrollView>
9995

100-
{curDemo === 'basic' && (isNative ? <Demo1Rn /> : <Demo1 />)}
101-
{curDemo === 'multiButtons' && (isNative ? <Demo2Rn /> : <Demo2 />)}
102-
{curDemo === 'hasTabbar' && (isNative ? <Demo3Rn /> : <Demo3 />)}
103-
{curDemo === 'customZIndex' && (isNative ? <Demo4Rn /> : <Demo4 />)}
96+
{curDemo === 'basic' && <Demo1 />}
97+
{curDemo === 'multiButtons' && <Demo2 />}
98+
{curDemo === 'hasTabbar' && <Demo3 />}
99+
{curDemo === 'customZIndex' && <Demo4 />}
104100
{/* {curDemo === 'customSpacing' && <Demo5 />} */}
105101
</View>
106102
)

src/packages/hoverbutton/demos/taro/demo1-rn.tsx

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/packages/hoverbutton/demos/taro/demo2-rn.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/packages/hoverbutton/demos/taro/demo3-rn.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
* 有底部导航栏的情况
33
*/
44
import React from 'react'
5-
// import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
6-
// import { HoverButton } from '@nutui/nutui-react-taro'
5+
import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
76
import { View } from '@tarojs/components'
8-
// import { Cart, Category, Find, Home, User } from '@nutui/icons-react-taro'
7+
import { Cart, Category, Find, Home, User } from '@nutui/icons-react-taro'
8+
import { harmonyAndRn } from '@/utils/platform-taro'
99

1010
const Demo3 = () => {
1111
return (
1212
<View>
13-
{/* <HoverButton icon={<Cart />} tabbarHeight={48} /> */}
14-
{/* {process.env.TARO_ENV !== 'rn' && process.env.TARO_ENV !== 'jdrn' && ( */}
15-
{/* <Tabbar fixed> */}
16-
{/* <Tabbar.Item title="首页" icon={<Home size={18} />} /> */}
17-
{/* <Tabbar.Item title="分类" icon={<Category size={18} />} /> */}
18-
{/* <Tabbar.Item title="发现" icon={<Find size={18} />} /> */}
19-
{/* <Tabbar.Item title="购物车" icon={<Cart size={18} />} /> */}
20-
{/* <Tabbar.Item title="我的" icon={<User size={18} />} /> */}
21-
{/* </Tabbar> */}
22-
{/* )} */}
13+
<HoverButton icon={<Cart />} tabbarHeight={48} />
14+
{harmonyAndRn() ? null : (
15+
<Tabbar fixed>
16+
<Tabbar.Item title="首页" icon={<Home size={18} />} />
17+
<Tabbar.Item title="分类" icon={<Category size={18} />} />
18+
<Tabbar.Item title="发现" icon={<Find size={18} />} />
19+
<Tabbar.Item title="购物车" icon={<Cart size={18} />} />
20+
<Tabbar.Item title="我的" icon={<User size={18} />} />
21+
</Tabbar>
22+
)}
2323
</View>
2424
)
2525
}

src/packages/hoverbutton/demos/taro/demo4-rn.tsx

Lines changed: 0 additions & 39 deletions
This file was deleted.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
* 自定义层级
33
*/
44
import React from 'react'
5-
// import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
65
import { HoverButton } from '@nutui/nutui-react-taro'
7-
import { View } from '@tarojs/components'
6+
import { View, Text } from '@tarojs/components'
87
import { Cart } from '@nutui/icons-react-taro'
98
import Taro, { pxTransform } from '@tarojs/taro'
109

@@ -25,11 +24,12 @@ const App = () => {
2524
<View
2625
style={{
2726
height: pxTransform(60),
28-
textAlign: 'center',
27+
display: 'flex',
28+
justifyContent: 'center',
2929
color: '#FFFFFF',
3030
}}
3131
>
32-
这个图层层级为 100
32+
<Text style={{ color: '#FFFFFF' }}>这个图层层级为 1000</Text>
3333
</View>
3434
{/* <SafeArea position="bottom" /> */}
3535
</View>

0 commit comments

Comments
 (0)