Moving the buttons icon into the button widget

This commit is contained in:
Jesús Espino 2020-10-31 16:00:28 +01:00
parent 97ff09230c
commit e93f95bf62
3 changed files with 5 additions and 10 deletions

View file

@ -54,8 +54,8 @@ class ViewTitle extends React.Component<Props, State> {
const newIcon = BlockIcons.shared.randomIcon()
mutator.changeIcon(board, newIcon)
}}
icon={<EmojiIcon/>}
>
<EmojiIcon/>
<FormattedMessage
id='TableComponent.add-icon'
defaultMessage='Add Icon'

View file

@ -13,10 +13,7 @@
&:hover {
background-color: rgba(var(--main-fg), 0.1);
}
.octo-hovercontrol {
background: rgb(239, 239, 238);
}
.Icon {
width: 14px;
height: 14px;

View file

@ -6,22 +6,20 @@ import './button.scss'
type Props = {
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
style?: React.CSSProperties
backgroundColor?: string
children?: React.ReactNode
title?: string
icon?: React.ReactNode
}
export default class Button extends React.Component<Props> {
render() {
const style = {...this.props.style, backgroundColor: this.props.backgroundColor}
return (
<div
onClick={this.props.onClick}
className='Button octo-button'
style={style}
className='Button'
title={this.props.title}
>
{this.props.icon}
{this.props.children}
</div>)
}