Small tidying up on expand message refactor
parent
7537ee3727
commit
22e9526e6e
|
@ -74,13 +74,7 @@ interface State {
|
|||
}
|
||||
|
||||
const calculateScrollTop = scrollToRow => {
|
||||
return _.reduce(
|
||||
_.range(0, scrollToRow),
|
||||
acc => {
|
||||
return acc + ROW_HEIGHT
|
||||
},
|
||||
0
|
||||
)
|
||||
return scrollToRow * ROW_HEIGHT
|
||||
}
|
||||
|
||||
class LogsTable extends Component<Props, State> {
|
||||
|
@ -445,13 +439,7 @@ class LogsTable extends Component<Props, State> {
|
|||
private calculateTotalHeight = (): number => {
|
||||
const data = getValuesFromData(this.props.data)
|
||||
|
||||
return _.reduce(
|
||||
data,
|
||||
(acc, __) => {
|
||||
return acc + ROW_HEIGHT
|
||||
},
|
||||
0
|
||||
)
|
||||
return data.length * ROW_HEIGHT
|
||||
}
|
||||
|
||||
private headerRenderer = ({key, style, columnIndex}) => {
|
||||
|
|
|
@ -43,4 +43,4 @@
|
|||
color: $g19-ghost;
|
||||
border-radius: $radius;
|
||||
cursor: text;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,13 +23,11 @@ export class ExpandableMessage extends Component<Props, State> {
|
|||
const {formattedValue} = this.props
|
||||
|
||||
return (
|
||||
<ClickOutside onClickOutside={this.collapse}>
|
||||
<>
|
||||
<div onClick={this.expand} className="expandable--message">
|
||||
<div className="expandable--text">{formattedValue}</div>
|
||||
<div className={this.isExpanded}>{formattedValue}</div>
|
||||
</div>
|
||||
</>
|
||||
<ClickOutside onClickOutside={this.handleClickOutside}>
|
||||
<div onClick={this.handleClick} className="expandable--message">
|
||||
<div className="expandable--text">{formattedValue}</div>
|
||||
<div className={this.isExpanded}>{formattedValue}</div>
|
||||
</div>
|
||||
</ClickOutside>
|
||||
)
|
||||
}
|
||||
|
@ -43,13 +41,13 @@ export class ExpandableMessage extends Component<Props, State> {
|
|||
}
|
||||
}
|
||||
|
||||
private expand = () => {
|
||||
private handleClick = () => {
|
||||
this.setState({
|
||||
expanded: true,
|
||||
})
|
||||
}
|
||||
|
||||
private collapse = () => {
|
||||
private handleClickOutside = () => {
|
||||
this.setState({
|
||||
expanded: false,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue