Skip to content

Commit

Permalink
Fix 'Your Repository' link on GH Enterprise (refined-github#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
busches authored and fregante committed Jan 18, 2018
1 parent 9b7ba95 commit 1d559b9
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import select from 'select-dom';
import {getUsername} from '../libs/utils';

export default function () {
select('.user-nav .dropdown-menu li:nth-child(3)').after(
<li>
<a class="dropdown-item" href={`/${getUsername()}?tab=repositories`}>
Your repositories
</a>
</li>
const position = select('.user-nav .dropdown:last-child .dropdown-menu > :nth-child(3)');
const link = (
<a class="dropdown-item" href={`/${getUsername()}?tab=repositories`}>
Your repositories
</a>
);

// GHE doesn't wrap links in <li> yet
position.after(position.tagName === 'LI' ? <li>{link}</li> : link);
}

0 comments on commit 1d559b9

Please sign in to comment.