@@ -162,42 +162,40 @@ export class BranchHeader extends React.Component<
162
162
163
163
getHistoryHeaderStyle ( ) {
164
164
if ( this . props . sideBarExpanded ) {
165
- return classes (
166
- openHistorySideBarButtonStyle ,
167
- selectedHeaderStyle
168
- ) ;
165
+ return classes ( openHistorySideBarButtonStyle , selectedHeaderStyle ) ;
169
166
}
170
- return classes (
171
- unSelectedHeaderStyle ,
172
- openHistorySideBarButtonStyle
173
- )
167
+ return classes ( unSelectedHeaderStyle , openHistorySideBarButtonStyle ) ;
174
168
}
175
169
176
170
getBranchHeaderStyle ( ) {
177
171
if ( this . props . sideBarExpanded ) {
178
- return classes (
179
- branchHeaderCenterContent ,
180
- unSelectedHeaderStyle
181
- ) ;
172
+ return classes ( branchHeaderCenterContent , unSelectedHeaderStyle ) ;
182
173
}
183
- return classes (
184
- selectedHeaderStyle ,
185
- branchHeaderCenterContent
186
- )
174
+ return classes ( selectedHeaderStyle , branchHeaderCenterContent ) ;
187
175
}
188
176
189
177
render ( ) {
190
178
return (
191
179
< div className = { this . getBranchStyle ( ) } >
192
- < div style = { { display : "flex" } } >
193
- < div className = { this . getHistoryHeaderStyle ( ) }
194
- onClick = { this . props . sideBarExpanded ? null : ( ) => this . props . toggleSidebar ( ) }
180
+ < div style = { { display : 'flex' } } >
181
+ < div
182
+ className = { this . getHistoryHeaderStyle ( ) }
183
+ onClick = {
184
+ this . props . sideBarExpanded
185
+ ? null
186
+ : ( ) => this . props . toggleSidebar ( )
187
+ }
195
188
title = { 'Show commit history' }
196
189
>
197
190
< h3 className = { historyLabelStyle } > History</ h3 >
198
191
</ div >
199
- < div className = { this . getBranchHeaderStyle ( ) }
200
- onClick = { this . props . sideBarExpanded ? ( ) => this . props . toggleSidebar ( ) : null }
192
+ < div
193
+ className = { this . getBranchHeaderStyle ( ) }
194
+ onClick = {
195
+ this . props . sideBarExpanded
196
+ ? ( ) => this . props . toggleSidebar ( )
197
+ : null
198
+ }
201
199
>
202
200
< h3 className = { branchLabelStyle } > { this . props . currentBranch } </ h3 >
203
201
< div
@@ -216,48 +214,52 @@ export class BranchHeader extends React.Component<
216
214
< div
217
215
className = {
218
216
this . props . disabled
219
- ? classes (
220
- newBranchButtonStyle ,
221
- headerButtonDisabledStyle
222
- )
217
+ ? classes ( newBranchButtonStyle , headerButtonDisabledStyle )
223
218
: newBranchButtonStyle
224
219
}
225
220
title = { 'Create a new branch' }
226
221
onClick = { ( ) => this . toggleNewBranchBox ( ) }
227
222
/>
228
223
) }
229
- { this . state . showNewBranchBox &&
230
- this . props . showList && (
231
- < NewBranchBox
232
- createNewBranch = { this . createNewBranch }
233
- toggleNewBranchBox = { this . toggleNewBranchBox }
234
- />
224
+ { this . state . showNewBranchBox && this . props . showList && (
225
+ < NewBranchBox
226
+ createNewBranch = { this . createNewBranch }
227
+ toggleNewBranchBox = { this . toggleNewBranchBox }
228
+ />
229
+ ) }
230
+ { this . props . upstreamBranch != null &&
231
+ this . props . upstreamBranch !== '' && (
232
+ < div className = { branchTrackingIconStyle } />
233
+ ) }
234
+ { this . props . upstreamBranch != null &&
235
+ this . props . upstreamBranch !== '' && (
236
+ < h3 className = { branchTrackingLabelStyle } >
237
+ { this . props . upstreamBranch }
238
+ </ h3 >
235
239
) }
236
- { this . props . upstreamBranch != null && this . props . upstreamBranch != '' && ( < div className = { branchTrackingIconStyle } /> ) }
237
- { this . props . upstreamBranch != null && this . props . upstreamBranch != '' && ( < h3 className = { branchTrackingLabelStyle } > { this . props . upstreamBranch } </ h3 > ) }
238
240
</ div >
239
241
</ div >
240
- { ! this . props . sideBarExpanded && ( < >
241
- { this . state . dropdownOpen && (
242
- < div >
243
- { this . props . data . map ( ( branch : any , branchIndex : number ) => {
244
- return (
245
- < li
246
- className = { branchListItemStyle }
247
- key = { branchIndex }
248
- onClick = { ( ) => this . switchBranch ( branch . name ) }
249
- >
250
- { branch . name }
251
- </ li >
252
- ) ;
253
- } ) }
254
- </ div >
255
- ) }
256
- { this . state . showNewBranchBox && (
257
- < div > Branching from { this . props . currentBranch } </ div >
258
- ) }
259
- { this . state . showCommitBox &&
260
- this . props . showList && (
242
+ { ! this . props . sideBarExpanded && (
243
+ < >
244
+ { this . state . dropdownOpen && (
245
+ < div >
246
+ { this . props . data . map ( ( branch : any , branchIndex : number ) => {
247
+ return (
248
+ < li
249
+ className = { branchListItemStyle }
250
+ key = { branchIndex }
251
+ onClick = { ( ) => this . switchBranch ( branch . name ) }
252
+ >
253
+ { branch . name }
254
+ </ li >
255
+ ) ;
256
+ } ) }
257
+ </ div >
258
+ ) }
259
+ { this . state . showNewBranchBox && (
260
+ < div > Branching from { this . props . currentBranch } </ div >
261
+ ) }
262
+ { this . state . showCommitBox && this . props . showList && (
261
263
< CommitBox
262
264
checkReadyForSubmit = { this . updateCommitBoxState }
263
265
stagedFiles = { this . props . stagedFiles }
@@ -266,7 +268,8 @@ export class BranchHeader extends React.Component<
266
268
refresh = { this . props . refresh }
267
269
/>
268
270
) }
269
- </ > ) }
271
+ </ >
272
+ ) }
270
273
</ div >
271
274
) ;
272
275
}
0 commit comments