Skip to content
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
4 changes: 1 addition & 3 deletions src/packages/button/button.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,7 @@ export const Button = React.forwardRef<HTMLButtonElement, Partial<ButtonProps>>(
onClick={(e) => handleClick(e as any)}
>
<View className="nut-button-wrap">
{loading && !harmonyAndRn() && (
<Loading className="nut-icon-loading" />
)}
{loading && <Loading className="nut-icon-loading" />}
{!loading && icon ? icon : null}
{children && (
<View
Expand Down
355 changes: 116 additions & 239 deletions src/packages/button/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import { Button, Cell } from '@nutui/nutui-react-taro'
import { Star, Plus } from '@nutui/icons-react-taro'
import { harmonyAndRn } from '@/utils/platform-taro'
import { Plus, Star } from '@nutui/icons-react-taro'
import pxTransform from '@/utils/px-transform'

const Demo4 = () => {
Expand All @@ -13,243 +12,121 @@ const Demo4 = () => {
}
return (
<>
{!harmonyAndRn() ? (
<Cell style={{ flexWrap: 'wrap' }}>
<Button
type="primary"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="outline"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="dashed"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-color-primary-light-pressed)`,
borderColor: `var(--nutui-color-primary)`,
color: `var(--nutui-color-primary)`,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-gray-3)`,
color: `var(--nutui-gray-7)`,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-gray-1)`,
color: `var(--nutui-gray-7)`,
}}
>
Button
</Button>
<Button
type="default"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
}}
>
Button
</Button>
<Button
shape="square"
fill="outline"
type="primary"
icon={<Plus />}
style={marginStyle}
/>
<Button
fill="outline"
type="primary"
icon={<Plus />}
style={marginStyle}
/>
<Button
type="primary"
fill="dashed"
icon={<Plus />}
style={marginStyle}
/>
<Button
shape="round"
type="primary"
size="large"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
shape="round"
type="primary"
size="xlarge"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
</Cell>
) : (
<Cell style={{ flexWrap: 'wrap' }}>
<Button
type="primary"
// icon={<Star />}
// rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="outline"
// icon={<Star />}
// rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="dashed"
// icon={<Star />}
// rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
// icon={<Star />}
// rightIcon={<Star />}
style={{
...{
backgroundColor: `#ffebf1`,
borderColor: `#ff0f23`,
color: `#ff0f23`,
},
...marginStyle,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
// icon={<Star />}
// rightIcon={<Star />}
style={{
...{
backgroundColor: `#f5f6fa`,
color: `#1a1a1a`,
},
...marginStyle,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
// icon={<Star />}
// rightIcon={<Star />}
style={{
...{
backgroundColor: `#ffffff`,
color: `#1a1a1a`,
},
...marginStyle,
}}
>
Button
</Button>
<Button
type="default"
// icon={<Star />}
// rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
shape="square"
fill="outline"
type="primary"
// icon={<Plus />}
style={{ width: pxTransform(32), ...marginStyle }}
/>
<Button
fill="outline"
type="primary"
// icon={<Plus />}
style={{ width: pxTransform(32), ...marginStyle }}
/>
<Button
type="primary"
fill="dashed"
// icon={<Plus />}
style={{ width: pxTransform(32), ...marginStyle }}
/>
<Button
shape="round"
type="primary"
size="large"
// icon={<Star />}
// rightIcon={<Star />}
style={{ width: pxTransform(100), ...marginStyle }}
>
Button
</Button>
<Button
shape="round"
type="primary"
size="xlarge"
// icon={<Star />}
// rightIcon={<Star />}
style={{ width: pxTransform(200), ...marginStyle }}
>
Button
</Button>
</Cell>
)}
<Cell style={{ flexWrap: 'wrap' }}>
<Button
type="primary"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="outline"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
type="primary"
fill="dashed"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-color-primary-light-pressed)`,
borderColor: `var(--nutui-color-primary)`,
color: `var(--nutui-color-primary)`,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-gray-3)`,
color: `var(--nutui-gray-7)`,
}}
>
Button
</Button>
<Button
type="default"
fill="none"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
backgroundColor: `var(--nutui-gray-1)`,
color: `var(--nutui-gray-7)`,
}}
>
Button
</Button>
<Button
type="default"
icon={<Star />}
rightIcon={<Star />}
style={{
margin: 8,
}}
>
Button
</Button>
<Button
shape="square"
fill="outline"
type="primary"
icon={<Plus />}
style={marginStyle}
/>
<Button
fill="outline"
type="primary"
icon={<Plus />}
style={marginStyle}
/>
<Button
type="primary"
fill="dashed"
icon={<Plus />}
style={marginStyle}
/>
<Button
shape="round"
type="primary"
size="large"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
<Button
shape="round"
type="primary"
size="xlarge"
icon={<Star />}
rightIcon={<Star />}
style={marginStyle}
>
Button
</Button>
</Cell>
</>
)
}
Expand Down
Loading