Commit 53c9107 1 parent 8449e29 commit 53c9107 Copy full SHA for 53c9107
File tree 2 files changed +16
-2
lines changed
packages/anvil-ui-ft-shell/src
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ DocumentHead.defaultProps = {
76
76
jsonLd : [ ] ,
77
77
robots : 'index,follow' ,
78
78
siteTitle : 'Financial Times' ,
79
- twitterSite : '@FinancialTimes' ,
79
+ twitterSite : '@FinancialTimes'
80
80
}
81
81
82
82
export default DocumentHead
Original file line number Diff line number Diff line change @@ -32,7 +32,21 @@ export default function Shell(props: Props) {
32
32
/>
33
33
< script dangerouslySetInnerHTML = { { __html : getBootstrapJS ( ) } } />
34
34
</ head >
35
- < body > { props . children } </ body >
35
+ { renderComponent ( props . children ) }
36
36
</ html >
37
37
)
38
38
}
39
+
40
+ function renderComponent ( Component ) {
41
+ if ( typeof Component === 'string' ) {
42
+ return < body dangerouslySetInnerHTML = { { __html : Component } } />
43
+ } else if ( typeof Component === 'function' ) {
44
+ return (
45
+ < body >
46
+ < Component />
47
+ </ body >
48
+ )
49
+ } else {
50
+ return < body > { Component } </ body >
51
+ }
52
+ }
You can’t perform that action at this time.
0 commit comments