File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ registerLanguages();
1717class App extends React . Component {
1818 static propTypes = {
1919 isAuthenticated : PropTypes . bool ,
20+ singleClusterMode : PropTypes . bool ,
21+ clusterName : PropTypes . string ,
2022 children : PropTypes . node ,
2123 } ;
2224
@@ -40,9 +42,10 @@ class App extends React.Component {
4042 }
4143
4244 renderContentWithNavigation ( ) {
45+ const { singleClusterMode, clusterName} = this . props ;
4346 return (
4447 < AsideNavigation >
45- < Content singleClusterMode = { this . props . singleClusterMode } />
48+ < Content singleClusterMode = { singleClusterMode } clusterName = { clusterName } />
4649 < div id = "fullscreen-root" > </ div >
4750 </ AsideNavigation >
4851 ) ;
@@ -58,6 +61,7 @@ function mapStateToProps(state) {
5861 isAuthenticated : state . authentication . isAuthenticated ,
5962 internalUser : state . authentication . user ,
6063 singleClusterMode : state . singleClusterMode ,
64+ clusterName : state . cluster . data ?. Name ,
6165 } ;
6266}
6367
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ export function Content(props) {
5959 } ;
6060 return (
6161 < React . Fragment >
62- { ! isClustersPage && < Header /> }
62+ { ! isClustersPage && < Header clusterName = { props . clusterName } /> }
6363 < main className = { b ( 'main' ) } > { renderRoute ( ) } </ main >
6464 < ReduxTooltip />
6565 < AppIcons />
@@ -70,6 +70,7 @@ export function Content(props) {
7070Content . propTypes = {
7171 singleClusterMode : PropTypes . bool ,
7272 children : PropTypes . node ,
73+ clusterName : PropTypes . string ,
7374} ;
7475
7576function ContentWrapper ( props ) {
Original file line number Diff line number Diff line change @@ -26,16 +26,16 @@ function ClusterName({name}: {name: string}) {
2626 ) ;
2727}
2828
29- function Header ( ) {
29+ interface HeaderProps {
30+ clusterName : string
31+ }
32+
33+ function Header ( { clusterName} : HeaderProps ) {
3034 const dispatch = useDispatch ( ) ;
3135 const { data : host } : { data : { ClusterName ?: string } } = useSelector ( ( state : any ) => state . host ) ;
3236 const { singleClusterMode, header} : { singleClusterMode : boolean ; header : HeaderItemType [ ] } =
3337 useSelector ( ( state : any ) => state ) ;
3438
35- const clusterName : string = useSelector (
36- ( state : any ) => state . cluster . data ?. Name || state . clusterInfo ?. title ,
37- ) ;
38-
3939 const location = useLocation ( ) ;
4040 const history = useHistory ( ) ;
4141
You can’t perform that action at this time.
0 commit comments