mirror of
https://github.com/zadam/trilium.git
synced 2026-06-23 16:10:52 +02:00
feat(standalone/setup): dedicated setup page with React
This commit is contained in:
@@ -112,6 +112,8 @@ function loadIcons() {
|
||||
}
|
||||
|
||||
function setBodyAttributes() {
|
||||
if (!glob.isDbInitialized) return;
|
||||
|
||||
const { device, headingStyle, layoutOrientation, platform, isElectron, hasNativeTitleBar, hasBackgroundEffects, currentLocale } = window.glob;
|
||||
const classesToSet = [
|
||||
device,
|
||||
@@ -132,6 +134,11 @@ function setBodyAttributes() {
|
||||
}
|
||||
|
||||
async function loadScripts() {
|
||||
if (!glob.dbInitialized) {
|
||||
await import("./setup.js");
|
||||
return;
|
||||
}
|
||||
|
||||
switch (glob.device) {
|
||||
case "mobile":
|
||||
await import("./mobile.js");
|
||||
|
||||
13
apps/client/src/setup.tsx
Normal file
13
apps/client/src/setup.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { render } from "preact";
|
||||
|
||||
async function main() {
|
||||
const bodyWrapper = document.createElement("div");
|
||||
render(<App />, bodyWrapper);
|
||||
document.body.appendChild(bodyWrapper);
|
||||
}
|
||||
|
||||
function App() {
|
||||
return <p>Loading...</p>;
|
||||
}
|
||||
|
||||
main();
|
||||
1
apps/client/src/types.d.ts
vendored
1
apps/client/src/types.d.ts
vendored
@@ -16,6 +16,7 @@ interface ElectronProcess {
|
||||
}
|
||||
|
||||
interface CustomGlobals extends BootstrapDefinition {
|
||||
isDbInitialized: boolean;
|
||||
isDesktop: typeof utils.isDesktop;
|
||||
isMobile: typeof utils.isMobile;
|
||||
getComponentByEl: typeof appContext.getComponentByEl;
|
||||
|
||||
Reference in New Issue
Block a user