File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ pub struct SiteConfig {
90
90
91
91
/// Whether users can log in with their email address.
92
92
pub login_with_email_allowed : bool ,
93
-
93
+
94
94
/// The iframe URL to show in the plan tab of the UI
95
95
pub plan_management_iframe_uri : Option < Url > ,
96
96
}
Original file line number Diff line number Diff line change @@ -43,37 +43,37 @@ function Plan(): React.ReactElement {
43
43
}
44
44
45
45
const ref = useRef < HTMLIFrameElement > ( null ) ;
46
- const [ height , setHeight ] = useState ( "0px" ) ;
46
+ const [ iframeHeight , setIframeHeight ] = useState ( "0px" ) ;
47
47
48
48
// Poll the size of the iframe content and set the height
49
49
// This will only work where the iframe is served from the same origin
50
- const doHeight = useCallback ( ( ) => {
50
+ const calculateHeight = useCallback ( ( ) => {
51
51
const height =
52
52
ref . current ?. contentWindow ?. document . body . parentElement ?. scrollHeight ;
53
53
if ( height ) {
54
- setHeight ( `${ height } px` ) ;
54
+ setIframeHeight ( `${ height } px` ) ;
55
55
} else {
56
- setHeight ( "500px" ) ;
56
+ setIframeHeight ( "500px" ) ;
57
57
}
58
58
} , [ ] ) ;
59
59
useEffect ( ( ) => {
60
- doHeight ( ) ;
60
+ calculateHeight ( ) ;
61
61
62
62
const interval = setInterval ( ( ) => {
63
- doHeight ( ) ;
63
+ calculateHeight ( ) ;
64
64
} , 1000 ) ;
65
65
66
66
return ( ) => clearInterval ( interval ) ;
67
- } , [ doHeight ] ) ;
67
+ } , [ calculateHeight ] ) ;
68
68
69
69
return (
70
70
< iframe
71
- title = "asd"
71
+ title = "iframe" // no proper title as this is experimental feature
72
72
ref = { ref }
73
- onLoad = { doHeight }
73
+ onLoad = { calculateHeight }
74
74
src = { planManagementIframeUri }
75
75
scrolling = "no"
76
- height = { height }
76
+ height = { iframeHeight }
77
77
/>
78
78
) ;
79
79
}
You can’t perform that action at this time.
0 commit comments