Skip to content

Commit 972fe14

Browse files
committed
Diff between active and non active tabs.
1 parent 0c1c7dc commit 972fe14

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

src/scss/_custom.scss

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,35 @@ body{
191191
color: rgb(114,114,114);
192192
padding-top: 15px;
193193
padding-bottom: 15px;
194-
border-top: 1px solid rgba(232,239,247,1);
194+
border-top: 1px solid rgba(232, 239, 247, 1);
195195
}
196-
.nav-link-success:hover{
196+
197+
.nav-link-success:hover {
197198
color: #fff;
198199
}
199200
}
200201

201202
// END Sidebar
202203

204+
.custom-tab {
205+
border-right: 1px solid #c8ced3;
206+
background-color: #ffffff;
207+
color: #000000;
208+
209+
i {
210+
color: #000;
211+
}
212+
}
213+
214+
.tab-active {
215+
background: #1b8eb7;
216+
color: #ffffff;
217+
218+
i {
219+
color: #fff;
220+
}
221+
}
222+
203223
.text-red {
204224
color: #FF0000;
205225
}

src/views/Explorer/TabsLayout/TabsLayout.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,23 @@ import {connect} from "react-redux";
44
import {addRemoteContainer, changeActiveRemoteContainer, removeRemoteContainer} from "../../../actions/explorerActions";
55

66
function TabsLayout(props) {
7-
const {addRemoteContainer, removeRemoteContainer, changeActiveRemoteContainer} = props;
7+
const {addRemoteContainer, removeRemoteContainer, changeActiveRemoteContainer, activeRemoteContainerID} = props;
88
const {containers, currentPaths} = props;
99
return (<Nav tabs>
1010
{
11-
containers.map((container) => {
11+
containers.map((containerID) => {
12+
const isActiveTab = containerID === activeRemoteContainerID;
1213
return (
13-
<NavItem key={"TAB_" + container} className={"col-md-2 pl-0 pr-0"}
14-
style={{background: "#1b8eb7", color: "#fff", borderRight: "1px solid #c8ced3"}}>
15-
<NavLink className={"float-center"} onClick={() => changeActiveRemoteContainer(container)}>
14+
<NavItem key={"TAB_" + containerID}
15+
className={"col-md-2 pl-0 pr-0 custom-tab " + (isActiveTab ? "tab-active" : "")}>
16+
<NavLink className={"float-center"} onClick={() => changeActiveRemoteContainer(containerID)}>
1617
<i className="fa fa-folder-o pr-1"/>
17-
{currentPaths[container] && currentPaths[container].remoteName !== "" ? currentPaths[container].remoteName : "Open New"}
18+
{currentPaths[containerID] && currentPaths[containerID].remoteName !== "" ? currentPaths[containerID].remoteName : "Open New"}
1819
<Button className="btn-no-background btn btn-secondary float-right p-0" onClick={(e) => {
1920
e.stopPropagation();
20-
removeRemoteContainer(container)
21+
removeRemoteContainer(containerID)
2122
}}>
22-
<i className="fa fa-lg fa-close" style={{color: "#fff"}}/>
23+
<i className="fa fa-lg fa-close"/>
2324
</Button>
2425
</NavLink>
2526
</NavItem>)

0 commit comments

Comments
 (0)