1
0
mirror of https://github.com/mattermost/focalboard.git synced 2025-01-11 18:13:52 +02:00

Remove text property from Button because children is enough

This commit is contained in:
Jesús Espino 2020-10-15 20:42:58 +02:00
parent a43ea02616
commit b801cd84f0
3 changed files with 8 additions and 9 deletions

View File

@ -141,7 +141,7 @@ class BoardComponent extends React.Component<Props, State> {
<div className="octo-board-header-cell"> <div className="octo-board-header-cell">
<div className="octo-label" title={`Items with an empty ${boardTree.groupByProperty?.name} property will go here. This column cannot be removed.`}>{`No ${boardTree.groupByProperty?.name}`}</div> <div className="octo-label" title={`Items with an empty ${boardTree.groupByProperty?.name} property will go here. This column cannot be removed.`}>{`No ${boardTree.groupByProperty?.name}`}</div>
<Button text={`${boardTree.emptyGroupCards.length}`} /> <Button>{`${boardTree.emptyGroupCards.length}`}</Button>
<div className="octo-spacer" /> <div className="octo-spacer" />
<Button><div className="imageOptions" /></Button> <Button><div className="imageOptions" /></Button>
<Button onClick={() => { this.addCard(undefined) }}><div className="imageAdd" /></Button> <Button onClick={() => { this.addCard(undefined) }}><div className="imageAdd" /></Button>
@ -165,7 +165,7 @@ class BoardComponent extends React.Component<Props, State> {
className={`octo-label ${group.option.color}`} className={`octo-label ${group.option.color}`}
text={group.option.value} text={group.option.value}
onChanged={(text) => { this.propertyNameChanged(group.option, text) }} /> onChanged={(text) => { this.propertyNameChanged(group.option, text) }} />
<Button text={`${group.cards.length}`} /> <Button>{`${group.cards.length}`}</Button>
<div className="octo-spacer" /> <div className="octo-spacer" />
<MenuWrapper> <MenuWrapper>
<Button><div className="imageOptions" /></Button> <Button><div className="imageOptions" /></Button>
@ -182,7 +182,7 @@ class BoardComponent extends React.Component<Props, State> {
)} )}
<div className="octo-board-header-cell"> <div className="octo-board-header-cell">
<Button text="+ Add a group" onClick={(e) => { this.addGroupClicked() }} /> <Button onClick={(e) => { this.addGroupClicked() }}>+ Add a group</Button>
</div> </div>
</div> </div>
@ -202,7 +202,7 @@ class BoardComponent extends React.Component<Props, State> {
onDragStart={() => { this.draggedCard = card }} onDragStart={() => { this.draggedCard = card }}
onDragEnd={() => { this.draggedCard = undefined }} /> onDragEnd={() => { this.draggedCard = undefined }} />
)} )}
<Button text="+ New" onClick={() => { this.addCard(undefined) }} /> <Button onClick={() => { this.addCard(undefined) }} >+ New</Button>
</BoardColumn> </BoardColumn>
{/* Columns */} {/* Columns */}
@ -218,7 +218,7 @@ class BoardComponent extends React.Component<Props, State> {
onDragStart={() => { this.draggedCard = card }} onDragStart={() => { this.draggedCard = card }}
onDragEnd={() => { this.draggedCard = undefined }} /> onDragEnd={() => { this.draggedCard = undefined }} />
)} )}
<Button text="+ New" onClick={() => { this.addCard(group.option.value) }} /> <Button onClick={() => { this.addCard(group.option.value) }} >+ New</Button>
</BoardColumn> </BoardColumn>
)} )}
</div> </div>

View File

@ -6,7 +6,7 @@ type Props = {
onClick?: (e: React.MouseEvent<HTMLDivElement>) => void onClick?: (e: React.MouseEvent<HTMLDivElement>) => void
style?: React.CSSProperties style?: React.CSSProperties
backgroundColor?: string backgroundColor?: string
text?: string children?: React.ReactNode
title?: string title?: string
} }
@ -20,7 +20,6 @@ export default class Button extends React.Component<Props> {
style={style} style={style}
title={this.props.title}> title={this.props.title}>
{this.props.children} {this.props.children}
{this.props.text}
</div>) </div>)
} }
} }

View File

@ -125,7 +125,7 @@ class CardDialog extends React.Component<Props, State> {
<div className="dialog" > <div className="dialog" >
<div className="toolbar"> <div className="toolbar">
<div className="octo-spacer"></div> <div className="octo-spacer"></div>
<Button text="..." onClick={(e) => { <Button onClick={(e) => {
Menu.shared.options = [ Menu.shared.options = [
{ id: "delete", name: "Delete" }, { id: "delete", name: "Delete" },
] ]
@ -139,7 +139,7 @@ class CardDialog extends React.Component<Props, State> {
} }
} }
Menu.shared.showAtElement(e.target as HTMLElement) Menu.shared.showAtElement(e.target as HTMLElement)
}}></Button> }}>...</Button>
</div> </div>
<div className="content"> <div className="content">
{icon ? {icon ?