Wire admin studio SSR and search infrastructure
This commit is contained in:
@@ -188,9 +188,36 @@ function mountStorySocial() {
|
||||
});
|
||||
}
|
||||
|
||||
function mountRememberMeCheckboxes() {
|
||||
var roots = document.querySelectorAll('[data-remember-me-checkbox-root]');
|
||||
if (!roots.length) return;
|
||||
|
||||
roots.forEach(function (rootEl) {
|
||||
if (rootEl.dataset.reactMounted === 'true') return;
|
||||
|
||||
var props = safeParseJson(rootEl.getAttribute('data-props'), {});
|
||||
rootEl.dataset.reactMounted = 'true';
|
||||
|
||||
void Promise.all([
|
||||
import('./components/auth/RememberMeCheckbox.jsx'),
|
||||
getReactRuntime(),
|
||||
])
|
||||
.then(function (resolved) {
|
||||
var module = resolved[0];
|
||||
var reactRuntime = resolved[1];
|
||||
var Component = module.default;
|
||||
reactRuntime.createRoot(rootEl).render(reactRuntime.React.createElement(Component, props));
|
||||
})
|
||||
.catch(function () {
|
||||
rootEl.dataset.reactMounted = 'false';
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
mountToolbarMessages();
|
||||
mountToolbarNotifications();
|
||||
mountStorySocial();
|
||||
mountRememberMeCheckboxes();
|
||||
|
||||
function initStorySyntaxHighlighting() {
|
||||
var codeBlocks = Array.prototype.slice.call(document.querySelectorAll('.story-prose pre code'));
|
||||
|
||||
Reference in New Issue
Block a user