mirror of
https://github.com/vercel/commerce.git
synced 2025-07-04 04:01:21 +00:00
✨ feat: btn icon buy
:%s
This commit is contained in:
parent
44b8cf4608
commit
5517928556
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { ButtonCommon, Inputcommon, InputSearch, Layout } from 'src/components/common';
|
import { ButtonCommon, ButtonIconBuy, Inputcommon, InputSearch, Layout } from 'src/components/common';
|
||||||
import { IconBuy } from 'src/components/icons';
|
import { IconBuy } from 'src/components/icons';
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
@ -17,9 +17,7 @@ export default function Home() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ButtonCommon type='ghost' icon={<IconBuy />}>Button</ButtonCommon>
|
<ButtonCommon type='ghost' icon={<IconBuy />}>Button</ButtonCommon>
|
||||||
<ButtonCommon type='light'><IconBuy /></ButtonCommon>
|
<ButtonIconBuy/>
|
||||||
<ButtonCommon type='light' icon={<IconBuy />}/>
|
|
||||||
<ButtonCommon type='ghost' icon={<IconBuy />} size='large'/>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
26
src/components/common/ButtonIconBuy/ButtonIconBuy.tsx
Normal file
26
src/components/common/ButtonIconBuy/ButtonIconBuy.tsx
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import React, { memo } from 'react'
|
||||||
|
import { IconBuy } from 'src/components/icons'
|
||||||
|
import ButtonCommon from '../ButtonCommon/ButtonCommon'
|
||||||
|
|
||||||
|
interface Props {
|
||||||
|
type?: 'primary' | 'light' | 'ghost',
|
||||||
|
size?: 'default' | 'large',
|
||||||
|
loading?: boolean,
|
||||||
|
disabled?: boolean,
|
||||||
|
onClick?: () => void,
|
||||||
|
}
|
||||||
|
|
||||||
|
const ButtonIconBuy = memo(({ type = 'light', size = 'default', loading = false, disabled, onClick }: Props) => {
|
||||||
|
return (
|
||||||
|
<ButtonCommon
|
||||||
|
type={type}
|
||||||
|
size={size}
|
||||||
|
loading={loading}
|
||||||
|
disabled={disabled}
|
||||||
|
onClick={onClick}
|
||||||
|
icon={<IconBuy />}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
export default ButtonIconBuy
|
@ -6,3 +6,4 @@ export { default as ItemWishList} from './ItemWishList/ItemWishList'
|
|||||||
export { default as Logo} from './Logo/Logo'
|
export { default as Logo} from './Logo/Logo'
|
||||||
export { default as Inputcommon} from './InputCommon/InputCommon'
|
export { default as Inputcommon} from './InputCommon/InputCommon'
|
||||||
export { default as InputSearch} from './InputSearch/InputSearch'
|
export { default as InputSearch} from './InputSearch/InputSearch'
|
||||||
|
export { default as ButtonIconBuy} from './ButtonIconBuy/ButtonIconBuy'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user