1
1
import React from "react" ;
2
2
import { connect } from "react-redux" ;
3
+ import { Helmet , HelmetData } from "react-helmet-async" ;
3
4
import { ThemeProvider as EmotionThemeProvider } from "@emotion/react" ;
4
5
import { StyledEngineProvider , ThemeProvider } from "@mui/material/styles" ;
5
6
import actions from "actions" ;
@@ -34,6 +35,7 @@ interface StateProps {
34
35
privacyURL : string ;
35
36
seamlessEnabled : boolean ;
36
37
datasetMetadataError : RootState [ "datasetMetadata" ] [ "error" ] ;
38
+ datasetMetadata : RootState [ "datasetMetadata" ] ;
37
39
isCellGuideCxg : RootState [ "controls" ] [ "isCellGuideCxg" ] ;
38
40
scatterplotXXaccessor : RootState [ "controls" ] [ "scatterplotXXaccessor" ] ;
39
41
scatterplotYYaccessor : RootState [ "controls" ] [ "scatterplotYYaccessor" ] ;
@@ -48,6 +50,7 @@ const mapStateToProps = (state: RootState): StateProps => ({
48
50
privacyURL : state . config ?. parameters ?. about_legal_privacy || "" ,
49
51
seamlessEnabled : selectIsSeamlessEnabled ( state ) ,
50
52
datasetMetadataError : state . datasetMetadata . error ,
53
+ datasetMetadata : state . datasetMetadata ,
51
54
isCellGuideCxg : state . controls . isCellGuideCxg ,
52
55
scatterplotXXaccessor : state . controls . scatterplotXXaccessor ,
53
56
scatterplotYYaccessor : state . controls . scatterplotYYaccessor ,
@@ -71,14 +74,22 @@ class App extends React.Component<StateProps & { dispatch: AppDispatch }> {
71
74
privacyURL,
72
75
seamlessEnabled,
73
76
datasetMetadataError,
77
+ datasetMetadata,
74
78
isCellGuideCxg,
75
79
differentialExpressionLoading,
76
80
scatterplotXXaccessor,
77
81
scatterplotYYaccessor,
78
82
} = this . props ;
79
83
84
+ const isPublished =
85
+ datasetMetadata ?. datasetMetadata ?. collection_datasets [ 0 ] ?. published ;
86
+ const helmetData = new HelmetData ( { } ) ;
87
+
80
88
return (
81
89
< Container >
90
+ < Helmet helmetData = { helmetData } prioritizeSeoTags >
91
+ { ! isPublished && < meta name = "robots" content = "noindex" /> }
92
+ </ Helmet >
82
93
< StyledEngineProvider injectFirst >
83
94
< EmotionThemeProvider theme = { theme } >
84
95
< ThemeProvider theme = { theme } >
0 commit comments