@@ -2,7 +2,7 @@ import React, { Component } from 'react';
22import PropTypes from 'prop-types' ;
33import classnames from 'classnames' ;
44import { translate } from 'react-i18next' ;
5- import { inject , observer } from 'mobx-react' ;
5+ import { observer , inject } from 'mobx-react' ;
66
77import { Image } from 'components/Base' ;
88import SearchBox from 'pages/Home/SearchBox' ;
@@ -11,7 +11,9 @@ import { getPortalFromPath } from 'routes';
1111import styles from './index.scss' ;
1212
1313@translate ( )
14- @inject ( 'rootStore' )
14+ @inject ( ( { rootStore } ) => ( {
15+ user : rootStore . user
16+ } ) )
1517@observer
1618export default class Banner extends Component {
1719 static propTypes = {
@@ -42,22 +44,26 @@ export default class Banner extends Component {
4244 className,
4345 stretch,
4446 shrink,
45- rootStore ,
47+ user ,
4648 t
4749 } = this . props ;
4850
4951 if ( ! [ '' , 'user' ] . includes ( getPortalFromPath ( ) ) ) {
5052 return null ;
5153 }
5254
55+ const titleShow = user . isLoggedIn ( )
56+ ? `${ t ( 'QingCloud App Center' ) } - ${ t ( title ) } `
57+ : t ( title ) ;
58+
5359 return (
5460 < div
5561 className = { classnames (
5662 'banner' ,
5763 styles . banner ,
5864 {
5965 [ styles . stretch ] : stretch ,
60- [ styles . shrink ] : shrink || rootStore . fixNav
66+ [ styles . shrink ] : shrink
6167 } ,
6268 className
6369 ) }
@@ -69,7 +75,7 @@ export default class Banner extends Component {
6975 < Image src = { icon } iconSize = { 48 } iconLetter = { title } />
7076 </ span >
7177 ) }
72- < div className = { styles . name } > { t ( title ) } </ div >
78+ < div className = { styles . name } > { titleShow } </ div >
7379 < div className = { styles . description } > { t ( description ) } </ div >
7480 </ div >
7581
0 commit comments