mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-21 12:15:50 +00:00
Fix interactive tutorials issues
This commit is contained in:
@@ -31,7 +31,8 @@ export function InteractiveBlock(props: { children: React.ReactNode; label: stri
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="interactive-block" id={'interactive-' + stepId}>
|
// add key={pathname} to ensure old step state gets rerendered on page navigation
|
||||||
|
<div className="interactive-block" id={'interactive-' + stepId} key={pathname}>
|
||||||
<div className="interactive-block-inner">
|
<div className="interactive-block-inner">
|
||||||
<div className="breadcrumbs-wrap">
|
<div className="breadcrumbs-wrap">
|
||||||
<ul
|
<ul
|
||||||
@@ -53,7 +54,8 @@ export function InteractiveBlock(props: { children: React.ReactNode; label: stri
|
|||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div className="interactive-block-ui" key={pathname}>{dynamicReact(props.children, React, {})}</div>
|
|
||||||
|
<div className="interactive-block-ui">{dynamicReact(props.children, React, {})}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -629,6 +629,9 @@ async function show_log(block, msg) {
|
|||||||
block.find(".output-area").append(msg)
|
block.find(".output-area").append(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Run callback only when the current route is loaded.
|
||||||
|
*/
|
||||||
function onCurrentRouteLoaded(callback) {
|
function onCurrentRouteLoaded(callback) {
|
||||||
const currentPath = window.location.pathname;
|
const currentPath = window.location.pathname;
|
||||||
window.onRouteChange(() => {
|
window.onRouteChange(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user