🎨 styles: button size small

:%s
This commit is contained in:
lytrankieio123
2021-09-16 14:57:23 +07:00
parent 9186f8b011
commit 035fca4563
4 changed files with 20 additions and 6 deletions

View File

@@ -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 {

View File

@@ -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,

View File

@@ -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}

View File

@@ -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>
</> </>
} }