File tree Expand file tree Collapse file tree 3 files changed +25
-14
lines changed Expand file tree Collapse file tree 3 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import { Link, NavLink } from 'react-router-dom';
4
4
import { If , Then , Else } from 'react-if' ;
5
5
import { AppStore } from '../../AppStore' ;
6
6
import { observer } from 'mobx-react' ;
7
- import { getInstituteLogoUrl } from '../../shared/api/urls' ;
7
+ import {
8
+ getcBioPortalLogoUrl ,
9
+ getInstituteLogoUrl ,
10
+ } from '../../shared/api/urls' ;
8
11
import SocialAuthButton from '../../shared/components/SocialAuthButton' ;
9
12
import { Dropdown } from 'react-bootstrap' ;
10
13
import { DataAccessTokensDropdown } from '../../shared/components/dataAccessTokens/DataAccessTokensDropdown' ;
@@ -119,7 +122,11 @@ export default class PortalHeader extends React.Component<
119
122
< div id = "leftHeaderContent" >
120
123
< Link to = "/" id = "cbioportal-logo" >
121
124
< img
122
- src = { require ( '../../globalStyles/images/cbioportal_logo.png' ) }
125
+ src = {
126
+ ! ! getcBioPortalLogoUrl ( )
127
+ ? getcBioPortalLogoUrl ( )
128
+ : require ( '../../globalStyles/images/cbioportal_logo.png' )
129
+ }
123
130
alt = "cBioPortal Logo"
124
131
/>
125
132
</ Link >
@@ -171,10 +178,10 @@ export default class PortalHeader extends React.Component<
171
178
</ Else >
172
179
</ If >
173
180
</ If >
174
- < If condition = { getInstituteLogoUrl ( ) } >
181
+ < If condition = { ! ! getInstituteLogoUrl ( ) } >
175
182
< img
176
183
id = "institute-logo"
177
- src = { getInstituteLogoUrl ( ) }
184
+ src = { getInstituteLogoUrl ( ) ! }
178
185
alt = "Institute Logo"
179
186
/>
180
187
</ If >
Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ export interface IServerConfig {
99
99
skin_documentation_news : string | null ;
100
100
skin_documentation_oql : string | null ;
101
101
skin_query_max_tree_depth : string ;
102
+ skin_left_logo : string | null ;
102
103
skin_right_logo : string | null ;
103
104
skin_right_nav_show_data_sets : boolean ;
104
105
skin_right_nav_show_examples : boolean ;
Original file line number Diff line number Diff line change @@ -214,18 +214,21 @@ export function getOncoKbApiUrl() {
214
214
) ;
215
215
}
216
216
217
+ export function getcBioPortalLogoUrl ( ) {
218
+ return getLogoUrl ( getServerConfig ( ) . skin_left_logo ) ;
219
+ }
220
+
217
221
export function getInstituteLogoUrl ( ) {
218
- if ( getServerConfig ( ) . skin_right_logo ) {
219
- if ( / ^ h t t p / . test ( getServerConfig ( ) . skin_right_logo || '' ) ) {
220
- return getServerConfig ( ) . skin_right_logo ! ;
221
- } else {
222
- return buildCBioPortalPageUrl (
223
- `images/${ getServerConfig ( ) . skin_right_logo } `
224
- ) ;
225
- }
226
- } else {
227
- return undefined ;
222
+ return getLogoUrl ( getServerConfig ( ) . skin_right_logo ) ;
223
+ }
224
+
225
+ function getLogoUrl ( logo_path : string | null ) {
226
+ if ( logo_path ) {
227
+ return / ^ h t t p / . test ( logo_path || '' )
228
+ ? logo_path !
229
+ : buildCBioPortalPageUrl ( `images/${ logo_path } ` ) ;
228
230
}
231
+ return undefined ;
229
232
}
230
233
231
234
export function getGenomeNexusApiUrl ( ) {
You can’t perform that action at this time.
0 commit comments