@@ -4,22 +4,23 @@ import {connect} from "react-redux";
44import { addRemoteContainer , changeActiveRemoteContainer , removeRemoteContainer } from "../../../actions/explorerActions" ;
55
66function 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