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

chore: 删除有依赖的 demo #2401

Merged
merged 1 commit into from
Jul 2, 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
15 changes: 8 additions & 7 deletions src/packages/avatar/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react'
import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
// import { Avatar, Badge, Cell } from '@nutui/nutui-react-taro'
import { Avatar, Cell } from '@nutui/nutui-react-taro'
import { User } from '@nutui/icons-react-taro'
import { harmonyAndRn } from '@/utils/platform-taro'

Expand All @@ -8,12 +9,12 @@ const Demo5 = () => {
<Cell className="cell-avatar">
{harmonyAndRn() ? null : (
<>
<Badge value="8">
<Avatar icon={<User />} shape="square" />
</Badge>
<Badge dot>
<Avatar icon={<User />} shape="square" />
</Badge>
{/* <Badge value="8"> */}
<Avatar icon={<User />} shape="square" />
{/* </Badge> */}
{/* <Badge dot> */}
<Avatar icon={<User />} shape="square" />
{/* </Badge> */}
</>
)}
</Cell>
Expand Down
7 changes: 4 additions & 3 deletions src/packages/configprovider/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React from 'react'
import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
import { harmonyAndRn } from '@/utils/platform-taro'
// import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
import { ConfigProvider, Cell, Button } from '@nutui/nutui-react-taro'
// import { harmonyAndRn } from '@/utils/platform-taro'
// todo rate icon
const Demo1 = () => {
return (
<>
<ConfigProvider>
<Cell.Group>
<Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell>
{/* <Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell> */}
<Cell>
<Button type="primary" block>
提交
Expand Down
7 changes: 4 additions & 3 deletions src/packages/configprovider/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
import { harmonyAndRn } from '@/utils/platform-taro'
import { ConfigProvider, Cell, Button } from '@nutui/nutui-react-taro'
// import { ConfigProvider, Cell, Rate, Button } from '@nutui/nutui-react-taro'
// import { harmonyAndRn } from '@/utils/platform-taro'

const Demo2 = () => {
const darkTheme = {
Expand All @@ -12,7 +13,7 @@ const Demo2 = () => {
<>
<ConfigProvider theme={darkTheme}>
<Cell.Group>
<Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell>
{/* <Cell>{harmonyAndRn() ? null : <Rate defaultValue={3} />}</Cell> */}
<Cell>
<Button type="primary" block>
提交
Expand Down
40 changes: 23 additions & 17 deletions src/packages/empty/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
import React, { useState } from 'react'
import { Tabs, TabPane, Empty } from '@nutui/nutui-react-taro'
// import { Tabs, TabPane, Empty } from '@nutui/nutui-react-taro'
import { Empty } from '@nutui/nutui-react-taro'

const Demo4 = () => {
const [tabvalue, setTabvalue] = useState<string | number>('0')

return (
<Tabs
value={tabvalue}
onChange={(paneKey) => {
setTabvalue(paneKey)
}}
>
<TabPane title="无内容" value="0">
<Empty status="empty" title="无内容" />
</TabPane>
<TabPane title="加载失败/错误" value="1">
<Empty status="error" title="加载失败/错误" />
</TabPane>
<TabPane title="无网络" value="2">
<Empty status="network" title="无网络" />
</TabPane>
</Tabs>
// <Tabs
// value={tabvalue}
// onChange={(paneKey) => {
// setTabvalue(paneKey)
// }}
// >
// <TabPane title="无内容" value="0">
// <Empty status="empty" title="无内容" />
// </TabPane>
// <TabPane title="加载失败/错误" value="1">
// <Empty status="error" title="加载失败/错误" />
// </TabPane>
// <TabPane title="无网络" value="2">
// <Empty status="network" title="无网络" />
// </TabPane>
// </Tabs>
<>
<Empty status="empty" title="无内容" />
<Empty status="error" title="加载失败/错误" />
<Empty status="network" title="无网络" />
</>
)
}
export default Demo4
23 changes: 12 additions & 11 deletions src/packages/hoverbutton/demos/taro/demo3-rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
* 有底部导航栏的情况
*/
import React from 'react'
import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
// import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
import { HoverButton } from '@nutui/nutui-react-taro'
import { View, Icon } 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'

const Demo3 = () => {
return (
<View>
<HoverButton icon={<Icon type="search" />} 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>
)}
{/* {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> */}
{/* )} */}
</View>
)
}
Expand Down
25 changes: 13 additions & 12 deletions src/packages/hoverbutton/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@
* 有底部导航栏的情况
*/
import React from 'react'
import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
// import { HoverButton, Tabbar } from '@nutui/nutui-react-taro'
// import { HoverButton } 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'

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} /> */}
{/* {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> */}
{/* )} */}
</View>
)
}
Expand Down
5 changes: 3 additions & 2 deletions src/packages/hoverbutton/demos/taro/demo4-rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* 自定义层级
*/
import React from 'react'
import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
// import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
import { HoverButton } from '@nutui/nutui-react-taro'
import { View, Icon, Text } from '@tarojs/components'
// import { Cart } from '@nutui/icons-react-taro'
import Taro, { pxTransform } from '@tarojs/taro'
Expand Down Expand Up @@ -30,7 +31,7 @@ const App = () => {
>
这个图层层级为 100
</Text>
<SafeArea position="bottom" />
{/* <SafeArea position="bottom" /> */}
</View>
</View>
)
Expand Down
5 changes: 3 additions & 2 deletions src/packages/hoverbutton/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* 自定义层级
*/
import React from 'react'
import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
// import { HoverButton, SafeArea } from '@nutui/nutui-react-taro'
import { HoverButton } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
import { Cart } from '@nutui/icons-react-taro'
import Taro, { pxTransform } from '@tarojs/taro'
Expand Down Expand Up @@ -30,7 +31,7 @@ const App = () => {
>
这个图层层级为 100
</View>
<SafeArea position="bottom" />
{/* <SafeArea position="bottom" /> */}
</View>
</View>
)
Expand Down
12 changes: 2 additions & 10 deletions src/packages/input/demos/taro/demo12.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import React from 'react'
import { Input, Toast } from '@nutui/nutui-react-taro'
import { Input } from '@nutui/nutui-react-taro'

const Demo12 = () => {
return (
<>
<Input
placeholder="事件"
onClick={() =>
Toast.show('click', {
title: 'onClick',
})
}
placeholderTextColor="#757575"
/>
<Input placeholder="事件" placeholderTextColor="#757575" />
</>
)
}
Expand Down
27 changes: 0 additions & 27 deletions src/packages/layout/demo.scss

This file was deleted.

42 changes: 30 additions & 12 deletions src/packages/layout/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,65 @@
import React from 'react'
import React, { CSSProperties } from 'react'
import { Row, Col } from '@nutui/nutui-react-taro'
import { pxTransform } from '@tarojs/taro'
import { View } from '@tarojs/components'
import '../../demo.scss'

const Demo1 = () => {
const flexContent: CSSProperties = {
display: 'flex',
flexDirection: 'row',
width: '100%',
height: pxTransform(40),
alignItems: 'center',
justifyContent: 'center',
color: '#fff',
textAlign: 'center',
borderRadius: pxTransform(6),
backgroundColor: '#ff8881',
fontSize: pxTransform(14),
}
const flexContentLight: CSSProperties = {
...flexContent,
backgroundColor: '#ffc7c4',
}

return (
<>
<Row>
<Col span="24">
<View className="flex-content">span:24</View>
<View style={flexContent}>span:24</View>
</Col>
</Row>
<Row>
<Col span="12">
<View className="flex-content">span:12</View>
<View style={flexContent}>span:12</View>
</Col>
<Col span="12">
<View className="flex-content-light">span:12</View>
<View style={flexContentLight}>span:12</View>
</Col>
</Row>
<Row>
<Col span="8">
<View className="flex-content">span:8</View>
<View style={flexContent}>span:8</View>
</Col>
<Col span="8">
<View className="flex-content-light">span:8</View>
<View style={flexContentLight}>span:8</View>
</Col>
<Col span="8">
<View className="flex-content">span:8</View>
<View style={flexContent}>span:8</View>
</Col>
</Row>
<Row>
<Col span="6">
<View className="flex-content">span:6</View>
<View style={flexContent}>span:6</View>
</Col>
<Col span="6">
<View className="flex-content-light">span:6</View>
<View style={flexContentLight}>span:6</View>
</Col>
<Col span="6">
<View className="flex-content">span:6</View>
<View style={flexContent}>span:6</View>
</Col>
<Col span="6">
<View className="flex-content-light">span:6</View>
<View style={flexContentLight}>span:6</View>
</Col>
</Row>
</>
Expand Down
29 changes: 23 additions & 6 deletions src/packages/layout/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,37 @@
import React from 'react'
import { Col, Row } from '@nutui/nutui-react-taro'
import React, { CSSProperties } from 'react'
import { Row, Col } from '@nutui/nutui-react-taro'
import { pxTransform } from '@tarojs/taro'
import { View } from '@tarojs/components'
import '../../demo.scss'

const Demo2 = () => {
const flexContent: CSSProperties = {
display: 'flex',
width: '100%',
height: pxTransform(40),
alignItems: 'center',
justifyContent: 'center',
color: '#fff',
textAlign: 'center',
borderRadius: pxTransform(6),
backgroundColor: '#ff8881',
fontSize: pxTransform(14),
}
const flexContentLight: CSSProperties = {
...flexContent,
backgroundColor: '#ffc7c4',
}

return (
<>
<Row gutter="10">
<Col span="8">
<View className="flex-content">span:8</View>
<View style={flexContent}>span:8</View>
</Col>
<Col span="8">
<View className="flex-content-light">span:8</View>
<View style={flexContentLight}>span:8</View>
</Col>
<Col span="8">
<View className="flex-content">span:8</View>
<View style={flexContent}>span:8</View>
</Col>
</Row>
</>
Expand Down
Loading