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(hoverbutton): 恢复icon,简化demo #2725

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 4 additions & 8 deletions src/packages/hoverbutton/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import { Cell } from '@nutui/nutui-react-taro'
import { useTranslate } from '@/sites/assets/locale/taro'
import Header from '@/sites/components/header'
import Demo1 from './demos/taro/demo1'
import Demo1Rn from './demos/taro/demo1-rn'
import Demo2 from './demos/taro/demo2'
import Demo2Rn from './demos/taro/demo2-rn'
import Demo3 from './demos/taro/demo3'
import Demo3Rn from './demos/taro/demo3-rn'
import Demo4 from './demos/taro/demo4'
import Demo4Rn from './demos/taro/demo4-rn'
import { harmonyAndRn } from '@/utils/platform-taro'
// import Demo5 from './demos/taro/demo5'

Expand Down Expand Up @@ -97,10 +93,10 @@ const HoverDemo = () => {
)} */}
</ScrollView>

{curDemo === 'basic' && (isNative ? <Demo1Rn /> : <Demo1 />)}
{curDemo === 'multiButtons' && (isNative ? <Demo2Rn /> : <Demo2 />)}
{curDemo === 'hasTabbar' && (isNative ? <Demo3Rn /> : <Demo3 />)}
{curDemo === 'customZIndex' && (isNative ? <Demo4Rn /> : <Demo4 />)}
{curDemo === 'basic' && <Demo1 />}
{curDemo === 'multiButtons' && <Demo2 />}
{curDemo === 'hasTabbar' && <Demo3 />}
{curDemo === 'customZIndex' && <Demo4 />}
{/* {curDemo === 'customSpacing' && <Demo5 />} */}
</View>
)
Expand Down
23 changes: 0 additions & 23 deletions src/packages/hoverbutton/demos/taro/demo1-rn.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/packages/hoverbutton/demos/taro/demo2-rn.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions src/packages/hoverbutton/demos/taro/demo3-rn.tsx

This file was deleted.

26 changes: 13 additions & 13 deletions src/packages/hoverbutton/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@
* 有底部导航栏的情况
*/
import React from 'react'
// import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
// import { HoverButton } from '@nutui/nutui-react-taro'
import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
// import { Cart, Category, Find, Home, User } from '@nutui/icons-react-taro'
import { Cart, Category, Find, Home, User } from '@nutui/icons-react-taro'
import { harmonyAndRn } from '@/utils/platform-taro'

const Demo3 = () => {
return (
<View>
{/* <HoverButton icon={<Cart />} tabbarHeight={48} /> */}
{/* {process.env.TARO_ENV !== 'rn' && process.env.TARO_ENV !== 'jdrn' && ( */}
{/* <Tabbar fixed> */}
{/* <Tabbar.Item title="首页" icon={<Home size={18} />} /> */}
{/* <Tabbar.Item title="分类" icon={<Category size={18} />} /> */}
{/* <Tabbar.Item title="发现" icon={<Find size={18} />} /> */}
{/* <Tabbar.Item title="购物车" icon={<Cart size={18} />} /> */}
{/* <Tabbar.Item title="我的" icon={<User size={18} />} /> */}
{/* </Tabbar> */}
{/* )} */}
<HoverButton icon={<Cart />} tabbarHeight={48} />
{harmonyAndRn() ? null : (
<Tabbar fixed>
<Tabbar.Item title="首页" icon={<Home size={18} />} />
<Tabbar.Item title="分类" icon={<Category size={18} />} />
<Tabbar.Item title="发现" icon={<Find size={18} />} />
<Tabbar.Item title="购物车" icon={<Cart size={18} />} />
<Tabbar.Item title="我的" icon={<User size={18} />} />
</Tabbar>
)}
</View>
)
}
Expand Down
39 changes: 0 additions & 39 deletions src/packages/hoverbutton/demos/taro/demo4-rn.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions src/packages/hoverbutton/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
* 自定义层级
*/
import React from 'react'
// import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
import { HoverButton } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
import { View, Text } from '@tarojs/components'
import { Cart } from '@nutui/icons-react-taro'
import Taro, { pxTransform } from '@tarojs/taro'

Expand All @@ -25,11 +24,12 @@ const App = () => {
<View
style={{
height: pxTransform(60),
textAlign: 'center',
display: 'flex',
justifyContent: 'center',
color: '#FFFFFF',
}}
>
这个图层层级为 100
<Text style={{ color: '#FFFFFF' }}>这个图层层级为 1000</Text>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

文本内容与实际 z-index 值不匹配

文本显示层级为1000,但实际代码中设置的 z-index 是100,这可能会让使用者产生误解。

建议修改为:

-          <Text style={{ color: '#FFFFFF' }}>这个图层层级为 1000</Text>
+          <Text style={{ color: '#FFFFFF' }}>这个图层层级为 100</Text>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Text style={{ color: '#FFFFFF' }}>这个图层层级为 1000</Text>
<Text style={{ color: '#FFFFFF' }}>这个图层层级为 100</Text>

</View>
{/* <SafeArea position="bottom" /> */}
</View>
Expand Down
Loading