@@ -10,26 +10,30 @@ import { useSelector } from '../../../../../../hooks';
1010import axios from 'axios' ;
1111
1212export const SideFooter : React . FC = ( ) => {
13-
1413 const authToken = useSelector ( sessionSelectors . authenticationToken ) ;
15- const [ apiVersion , setApiVersion ] = useState ( '' )
14+ const [ apiVersion , setApiVersion ] = useState ( '' ) ;
15+
16+ useEffect ( ( ) => {
17+ if ( authToken ) {
18+ const getApiVersion = async ( ) => {
19+ const { data } = await axios . get (
20+ `${ process . env . REACT_APP_BASE_API_URL } /version` ,
21+ {
22+ headers : {
23+ Authorization : `bearer ${ authToken } ` ,
24+ } ,
25+ } ,
26+ ) ;
27+ setApiVersion ( data ) ;
28+ } ;
1629
17- useEffect ( ( ) => {
18- const getApiVersion = async ( ) => {
19- const { data } = await axios . get ( `${ process . env . REACT_APP_BASE_API_URL } /version` , {
20- headers : {
21- 'Authorization' : `bearer ${ authToken } `
22- }
23- } )
24- setApiVersion ( data )
30+ getApiVersion ( ) ;
2531 }
32+ } , [ authToken ] ) ;
2633
27- getApiVersion ( )
28- } , [ authToken ] )
29-
3034 return (
3135 < >
32- < Box marginHorizontal = "md" paddingBottom = 'md' >
36+ < Box marginHorizontal = "md" paddingBottom = "md" >
3337 < Separator . LightNew />
3438 </ Box >
3539
@@ -53,13 +57,19 @@ export const SideFooter: React.FC = () => {
5357 < MenuItem
5458 Icon = { ( ) => (
5559 < icons . settings color = { iconColors . white } size = { iconSizes . md } />
56- ) } to = { routePaths . settings . personalDetails } text = { translate ( 'menu.setting.text' ) }
60+ ) }
61+ to = { routePaths . settings . personalDetails }
62+ text = { translate ( 'menu.setting.text' ) }
5763 />
5864
59- < Box style = { { paddingLeft : '12px' } } paddingTop = "md" paddingBottom = 'xs' >
60- < Paragraph color = 'white' style = { { fontSize : '8px' , fontWeight : 400 } } > UI Version v{ process . env . REACT_APP_VERSION } </ Paragraph >
61- < Paragraph color = 'white' style = { { fontSize : '8px' , fontWeight : 400 } } > ZenML v{ apiVersion } </ Paragraph >
65+ < Box style = { { paddingLeft : '12px' } } paddingTop = "md" paddingBottom = "xs" >
66+ < Paragraph color = "white" style = { { fontSize : '8px' , fontWeight : 400 } } >
67+ UI Version v{ process . env . REACT_APP_VERSION }
68+ </ Paragraph >
69+ < Paragraph color = "white" style = { { fontSize : '8px' , fontWeight : 400 } } >
70+ ZenML v{ apiVersion }
71+ </ Paragraph >
6272 </ Box >
63- </ >
73+ </ >
6474 ) ;
6575} ;
0 commit comments