mirror of
https://github.com/vercel/commerce.git
synced 2025-07-22 20:26:49 +00:00
🎨 styles: button size small
:%s
This commit is contained in:
@@ -103,6 +103,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
&.small {
|
||||||
|
.inner {
|
||||||
|
padding: .5rem 1rem;
|
||||||
|
&.onlyIcon {
|
||||||
|
padding: 1rem;
|
||||||
|
}
|
||||||
|
@screen md {
|
||||||
|
padding: .8rem 1.6rem;
|
||||||
|
&.onlyIcon {
|
||||||
|
padding: .8rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&.large {
|
&.large {
|
||||||
.inner {
|
.inner {
|
||||||
|
@@ -5,7 +5,7 @@ import s from './ButtonCommon.module.scss'
|
|||||||
interface Props {
|
interface Props {
|
||||||
children?: React.ReactNode,
|
children?: React.ReactNode,
|
||||||
type?: 'primary' | 'light' | 'ghost' | 'lightBorderNone',
|
type?: 'primary' | 'light' | 'ghost' | 'lightBorderNone',
|
||||||
size?: 'default' | 'large',
|
size?: 'default' | 'large' | 'small',
|
||||||
icon?: React.ReactNode,
|
icon?: React.ReactNode,
|
||||||
isIconSuffix?: boolean,
|
isIconSuffix?: boolean,
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
|
@@ -4,13 +4,13 @@ import ButtonCommon from '../ButtonCommon/ButtonCommon'
|
|||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
type?: 'primary' | 'light' | 'ghost',
|
type?: 'primary' | 'light' | 'ghost',
|
||||||
size?: 'default' | 'large',
|
size?: 'default' | 'large' | 'small',
|
||||||
loading?: boolean,
|
loading?: boolean,
|
||||||
disabled?: boolean,
|
disabled?: boolean,
|
||||||
onClick?: () => void,
|
onClick?: () => void,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ButtonIconBuy = memo(({ type = 'light', size = 'default', loading = false, disabled, onClick }: Props) => {
|
const ButtonIconBuy = memo(({ type = 'light', size = 'small', loading = false, disabled, onClick }: Props) => {
|
||||||
return (
|
return (
|
||||||
<ButtonCommon
|
<ButtonCommon
|
||||||
type={type}
|
type={type}
|
||||||
|
@@ -63,15 +63,15 @@ const ProductCard = ({
|
|||||||
{
|
{
|
||||||
isSingleButton ?
|
isSingleButton ?
|
||||||
<div className={s.cardButton}>
|
<div className={s.cardButton}>
|
||||||
<ButtonCommon type="light" icon={<IconBuy />}>Add to cart</ButtonCommon>
|
<ButtonCommon type="light" icon={<IconBuy />} size='small'>Add to cart</ButtonCommon>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
<>
|
<>
|
||||||
<div className={s.cardIcon}>
|
<div className={s.cardIcon}>
|
||||||
<ButtonIconBuy />
|
<ButtonIconBuy/>
|
||||||
</div>
|
</div>
|
||||||
<div className={s.cardButton}>
|
<div className={s.cardButton}>
|
||||||
<ButtonCommon type="light">{buttonText}</ButtonCommon>
|
<ButtonCommon type="light" size='small'>{buttonText}</ButtonCommon>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user