@@ -4,7 +4,6 @@ import { CommandRegistry } from '@lumino/commands';
44import * as React from 'react' ;
55import { classes } from 'typestyle' ;
66import { GitExtension } from '../model' ;
7- import { diffIcon } from '../style/icons' ;
87import {
98 branchClass ,
109 branchWrapperClass ,
@@ -20,7 +19,6 @@ import {
2019 workingBranchClass
2120} from '../style/PastCommitNode' ;
2221import { Git } from '../tokens' ;
23- import { ActionButton } from './ActionButton' ;
2422
2523/**
2624 * Interface describing component properties.
@@ -107,6 +105,11 @@ export class PastCommitNode extends React.Component<
107105 ? commitExpandedClass
108106 : null
109107 ) }
108+ title = {
109+ this . props . children
110+ ? this . props . trans . __ ( 'View commit details' )
111+ : this . props . trans . __ ( 'View file changes' )
112+ }
110113 onClick = { this . _onCommitClick }
111114 >
112115 < div className = { commitHeaderClass } >
@@ -119,19 +122,10 @@ export class PastCommitNode extends React.Component<
119122 < span className = { commitHeaderItemClass } >
120123 { this . props . commit . date }
121124 </ span >
122- { this . props . children ? (
123- this . state . expanded ? (
124- < caretUpIcon . react className = { iconButtonClass } tag = "span" />
125- ) : (
126- < caretDownIcon . react className = { iconButtonClass } tag = "span" />
127- )
125+ { this . props . children && this . state . expanded ? (
126+ < caretUpIcon . react className = { iconButtonClass } tag = "span" />
128127 ) : (
129- ! ! this . props . onOpenDiff && (
130- < ActionButton
131- icon = { diffIcon }
132- title = { this . props . trans . __ ( 'View file changes' ) }
133- />
134- )
128+ < caretDownIcon . react className = { iconButtonClass } tag = "span" />
135129 ) }
136130 </ div >
137131 < div className = { branchWrapperClass } > { this . _renderBranches ( ) } </ div >
@@ -198,8 +192,8 @@ export class PastCommitNode extends React.Component<
198192 this . setState ( {
199193 expanded : ! this . state . expanded
200194 } ) ;
201- } else if ( ! ! this . props . onOpenDiff ) {
202- this . props . onOpenDiff ( event ) ;
195+ } else {
196+ this . props . onOpenDiff ?. call ( this , event ) ;
203197 }
204198 } ;
205199}
0 commit comments