Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
}
const badgeSize = size / 3
class GroupBadge extends React.Component {
render = () =>
}
const Avatar = () => content
const WrappedAvatar = withBadge('', { Component: GroupBadge })(Avatar)
return
}
render() {
const { bells } = this.props
, unreadBells = bells.reduce((sum, bell) => sum + (bell.isRead ? 0 : 1), 0)
, Component = unreadBells ?
withBadge(unreadBells, {badgeStyle: {backgroundColor: colors.green}})(Icon) :
Icon
return (
)
}
}
const icon = (name: string, size: number = 32, color?: string, badge?: number) => ({focused}) => {
const Component = badge ? withBadge(badge)(Icon) : Icon
return (
)
}