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 {
9090
9191 /// Whether users can log in with their email address.
9292 pub login_with_email_allowed : bool ,
93-
93+
9494 /// The iframe URL to show in the plan tab of the UI
9595 pub plan_management_iframe_uri : Option < Url > ,
9696}
Original file line number Diff line number Diff line change @@ -43,37 +43,37 @@ function Plan(): React.ReactElement {
4343 }
4444
4545 const ref = useRef < HTMLIFrameElement > ( null ) ;
46- const [ height , setHeight ] = useState ( "0px" ) ;
46+ const [ iframeHeight , setIframeHeight ] = useState ( "0px" ) ;
4747
4848 // Poll the size of the iframe content and set the height
4949 // This will only work where the iframe is served from the same origin
50- const doHeight = useCallback ( ( ) => {
50+ const calculateHeight = useCallback ( ( ) => {
5151 const height =
5252 ref . current ?. contentWindow ?. document . body . parentElement ?. scrollHeight ;
5353 if ( height ) {
54- setHeight ( `${ height } px` ) ;
54+ setIframeHeight ( `${ height } px` ) ;
5555 } else {
56- setHeight ( "500px" ) ;
56+ setIframeHeight ( "500px" ) ;
5757 }
5858 } , [ ] ) ;
5959 useEffect ( ( ) => {
60- doHeight ( ) ;
60+ calculateHeight ( ) ;
6161
6262 const interval = setInterval ( ( ) => {
63- doHeight ( ) ;
63+ calculateHeight ( ) ;
6464 } , 1000 ) ;
6565
6666 return ( ) => clearInterval ( interval ) ;
67- } , [ doHeight ] ) ;
67+ } , [ calculateHeight ] ) ;
6868
6969 return (
7070 < iframe
71- title = "asd"
71+ title = "iframe" // no proper title as this is experimental feature
7272 ref = { ref }
73- onLoad = { doHeight }
73+ onLoad = { calculateHeight }
7474 src = { planManagementIframeUri }
7575 scrolling = "no"
76- height = { height }
76+ height = { iframeHeight }
7777 />
7878 ) ;
7979}
You can’t perform that action at this time.
0 commit comments