Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions lib/views/pr-detail-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,25 +136,27 @@ export class BarePullRequestDetailView extends React.Component {

return (
<Tabs selectedIndex={this.props.selectedTab} onSelect={this.onTabSelected}>
<TabList className="github-IssueishDetailView-tablist">
<Tab className="github-IssueishDetailView-tab">
<Octicon icon="info" className="github-IssueishDetailView-tab-icon" />Overview</Tab>
<Tab className="github-IssueishDetailView-tab">
<Octicon icon="checklist" className="github-IssueishDetailView-tab-icon" />
<TabList className="github-tablist">
<Tab className="github-tab">
<Octicon icon="info" className="github-tab-icon" />Overview</Tab>
<Tab className="github-tab">
<Octicon icon="checklist" className="github-tab-icon" />
Build Status
</Tab>
<Tab className="github-IssueishDetailView-tab">
<Tab className="github-tab">
<Octicon icon="git-commit"
className="github-IssueishDetailView-tab-icon"
className="github-tab-icon"
/>
Commits
<span className="github-IssueishDetailView-tab-count">{pullRequest.countedCommits.totalCount}</span>
<span className="github-tab-count">
{pullRequest.countedCommits.totalCount}
</span>
</Tab>
<Tab className="github-IssueishDetailView-tab">
<Tab className="github-tab">
<Octicon icon="diff"
className="github-IssueishDetailView-tab-icon"
/>
Files<span className="github-IssueishDetailView-tab-count">{pullRequest.changedFiles}</span>
className="github-tab-icon"
/>Files
<span className="github-tab-count">{pullRequest.changedFiles}</span>
</Tab>
</TabList>
{/* 'Reviews' tab to be added in the future. */}
Expand Down
61 changes: 0 additions & 61 deletions styles/issueish-detail-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@
height: 100%;
}

.react-tabs {
flex: 1;
display: flex;
flex-direction: column;
}

.react-tabs__tab-panel--selected {
flex: 1;
overflow: auto;
}


// Header ------------------------

&-header {
Expand Down Expand Up @@ -137,55 +125,6 @@
}


// Tabs ------------------------

&-tablist {
flex: none;
display: flex;
justify-content: center;
padding: 0;
margin: 0;
list-style: none;
border-bottom: 1px solid @base-border-color;
background-color: @app-background-color;
}

&-tab {
padding: @component-padding/2 @component-padding*1.5;
text-align: center;
font-weight: 600;
color: mix(@text-color, @app-background-color, 75%);
cursor: default;
user-select: none;
}

&-tab-icon {
color: mix(@text-color, @app-background-color, 33%);
vertical-align: middle;
&:before {
margin-right: .4em;
}
}

&-tab-count {
display: inline-block;
background-color: mix(@text-color-subtle, @app-background-color, 20%);
border-radius: @component-border-radius;
padding: 0 .25em;
margin-left: @component-padding/2;
}


// Selected tab
&-tab.react-tabs__tab--selected {
color: @text-color-selected;
box-shadow: 0 1px 0 @button-background-color-selected;

.github-IssueishDetailView-tab-icon {
color: @text-color;
}
}

// Footer ------------------------

&-footer {
Expand Down
59 changes: 59 additions & 0 deletions styles/tabs.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
@import 'variables';

.react-tabs {
flex: 1;
display: flex;
flex-direction: column;
}

.react-tabs__tab-panel--selected {
flex: 1;
overflow: auto;
}

.github-tab {
padding: @component-padding/2 @component-padding*1.5;
text-align: center;
font-weight: 600;
color: mix(@text-color, @app-background-color, 75%);
cursor: default;
user-select: none;

&list {
flex: none;
display: flex;
justify-content: center;
padding: 0;
margin: 0;
list-style: none;
border-bottom: 1px solid @base-border-color;
background-color: @app-background-color;
}

&-icon {
color: mix(@text-color, @app-background-color, 33%);
vertical-align: middle;
&:before {
margin-right: .4em;
}
}

&-count {
display: inline-block;
background-color: mix(@text-color-subtle, @app-background-color, 20%);
border-radius: @component-border-radius;
padding: 0 .25em;
margin-left: @component-padding/2;
}


// Selected tab
&.react-tabs__tab--selected {
color: @text-color-selected;
box-shadow: 0 1px 0 @button-background-color-selected;

.github-tab-icon {
color: @text-color;
}
}
}
10 changes: 5 additions & 5 deletions test/views/pr-detail-view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,22 +182,22 @@ describe('PullRequestDetailView', function() {
assert.lengthOf(tabs, 4);

const tab0Children = tabs[0].props.children;
assert.deepEqual(tab0Children[0].props, {icon: 'info', className: 'github-IssueishDetailView-tab-icon'});
assert.deepEqual(tab0Children[0].props, {icon: 'info', className: 'github-tab-icon'});
assert.deepEqual(tab0Children[1], 'Overview');

const tab1Children = tabs[1].props.children;
assert.deepEqual(tab1Children[0].props, {icon: 'checklist', className: 'github-IssueishDetailView-tab-icon'});
assert.deepEqual(tab1Children[0].props, {icon: 'checklist', className: 'github-tab-icon'});
assert.deepEqual(tab1Children[1], 'Build Status');

const tab2Children = tabs[2].props.children;
assert.deepEqual(tab2Children[0].props, {icon: 'git-commit', className: 'github-IssueishDetailView-tab-icon'});
assert.deepEqual(tab2Children[0].props, {icon: 'git-commit', className: 'github-tab-icon'});
assert.deepEqual(tab2Children[1], 'Commits');

const tab3Children = tabs[3].props.children;
assert.deepEqual(tab3Children[0].props, {icon: 'diff', className: 'github-IssueishDetailView-tab-icon'});
assert.deepEqual(tab3Children[0].props, {icon: 'diff', className: 'github-tab-icon'});
assert.deepEqual(tab3Children[1], 'Files');

const tabCounts = wrapper.find('.github-IssueishDetailView-tab-count');
const tabCounts = wrapper.find('.github-tab-count');
assert.lengthOf(tabCounts, 2);
assert.strictEqual(tabCounts.at(0).text(), '11');
assert.strictEqual(tabCounts.at(1).text(), '22');
Expand Down