Skip to content

Commit

Permalink
Render branch name in toolbar using PathText
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed Nov 17, 2017
1 parent 3de4dcd commit ce9e013
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/src/ui/toolbar/branch-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { BranchesTab } from '../../models/branches-tab'
import { enablePreviewFeatures } from '../../lib/feature-flag'
import { PullRequest } from '../../models/pull-request'
import { PullRequestBadge } from '../branches/pull-request-badge'
import { PathText } from '../lib/path-text'

interface IBranchDropdownProps {
readonly dispatcher: Dispatcher
Expand Down Expand Up @@ -86,7 +87,7 @@ export class BranchDropdown extends React.Component<IBranchDropdownProps> {

let icon = OcticonSymbol.gitBranch
let iconClassName: string | undefined = undefined
let title: string
let title: string | JSX.Element
let description = __DARWIN__ ? 'Current Branch' : 'Current branch'
let canOpen = true
let tooltip: string
Expand All @@ -108,8 +109,8 @@ export class BranchDropdown extends React.Component<IBranchDropdownProps> {
icon = OcticonSymbol.gitCommit
description = 'Detached HEAD'
} else if (tip.kind === TipState.Valid) {
title = tip.branch.name
tooltip = `Current branch is ${title}`
title = <PathText path={tip.branch.name} />
tooltip = `Current branch is ${tip.branch.name}`
} else {
return assertNever(tip, `Unknown tip state: ${tipKind}`)
}
Expand All @@ -118,7 +119,7 @@ export class BranchDropdown extends React.Component<IBranchDropdownProps> {
let progressValue: number | undefined = undefined

if (checkoutProgress) {
title = checkoutProgress.targetBranch
title = <PathText path={checkoutProgress.targetBranch} />
description = __DARWIN__ ? 'Switching to Branch' : 'Switching to branch'

if (checkoutProgress.value > 0) {
Expand Down

0 comments on commit ce9e013

Please sign in to comment.