Updated NavigationBarButton style

• Updated:
- NavigationBarButton style
This commit is contained in:
mgabdev 2020-10-29 22:56:22 -05:00
parent f129d9c49b
commit c3cb3a5361
1 changed files with 26 additions and 6 deletions

View File

@ -16,6 +16,7 @@ class NavigationBarButton extends React.PureComponent {
attrTitle, attrTitle,
count, count,
onClick, onClick,
isXS,
} = this.props } = this.props
const active = to == window.location.pathname const active = to == window.location.pathname
@ -31,8 +32,9 @@ class NavigationBarButton extends React.PureComponent {
noUnderline: 1, noUnderline: 1,
colorNavigation: 1, colorNavigation: 1,
px15: !!title, px15: !!title,
px5: !title, px5: !title && !isXS,
py2: !title, px2: !title && isXS,
py5: !title && !isXS,
cWhite: !!title, cWhite: !!title,
fs13PX: !!title, fs13PX: !!title,
fw400: !!title, fw400: !!title,
@ -40,9 +42,13 @@ class NavigationBarButton extends React.PureComponent {
}) })
const iconClasses = CX({ const iconClasses = CX({
fillNavigation: !!title || active, fillNavigation: (!!title || active) || isXS,
fillNavigationBlend: !title, fillNavigationBlend: !title && !isXS,
px2: !title, px2: !title && !isXS,
py5: !title && !isXS,
px5: !title,
mr2: !title && isXS,
ml2: !title && isXS,
}) })
const countClasses = CX({ const countClasses = CX({
@ -60,6 +66,17 @@ class NavigationBarButton extends React.PureComponent {
radiusSmall: 1, radiusSmall: 1,
}) })
const iconContainerClasses = CX({
d: 1,
aiCenter: 1,
jcCenter: 1,
bgNavigationBlendLight: !title,
circle: !title,
px5: !title,
py5: !title,
py10: !title && isXS,
})
const iconSize = !!title ? '18px' : '20px' const iconSize = !!title ? '18px' : '20px'
return ( return (
@ -71,7 +88,9 @@ class NavigationBarButton extends React.PureComponent {
className={classes} className={classes}
noClasses noClasses
> >
<Icon className={iconClasses} id={icon} size={iconSize} /> <div className={iconContainerClasses}>
<Icon className={iconClasses} id={icon} size={iconSize} />
</div>
{ {
!!title && !!title &&
<Text color='white' size='extraSmall' className={_s.mt5}> <Text color='white' size='extraSmall' className={_s.mt5}>
@ -96,6 +115,7 @@ NavigationBarButton.propTypes = {
attrTitle: PropTypes.string, attrTitle: PropTypes.string,
count: PropTypes.number, count: PropTypes.number,
onClick: PropTypes.func, onClick: PropTypes.func,
isXS: PropTypes.bool,
} }
export default NavigationBarButton export default NavigationBarButton