Skip to content

Build your personal knowledge base with Trilium Notes

feat(standalone/setup): improve creating new document screen

Elian Doran06cb568fbd62
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index 8096d1fba3..35f8fdbe7e 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -94,6 +94,11 @@ body.setup {
overflow: auto;
}
+ &.contentless {
+ justify-content: center;
+ align-items: center;
+ }
+
>footer {
display: flex;
justify-content: flex-end;
@@ -157,8 +162,11 @@ body.setup {
.lds-ring {
display: inline-block;
position: relative;
- width: 60px;
- height: 60px;
+ --size: 128px;
+ flex-grow: 1;
+ display: flex;
+ align-items: center;
+ justify-content: center;
&>div {
box-sizing: border-box;
@@ -167,10 +175,10 @@ body.setup {
width: var(--size, 48px);
height: var(--size, 48px);
margin: 8px;
- border: 6px solid black;
+ border: 6px solid var(--main-text-color);
border-radius: 50%;
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
- border-color: black transparent transparent transparent;
+ border-color: var(--main-text-color) transparent transparent transparent;
&:nth-child(1) {
animation-delay: -0.45s;
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 3496eb65b4..e776f4c7ca 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -233,9 +233,8 @@ function CreateNewDocumentInProgress({ withDemo = false }: { withDemo?: boolean
className="create-new-document"
title={t("setup.create-new-document-title")}
description={t("setup.create-new-document-description")}
- >
- <Spinner />
- </SetupPage>
+ illustration={<Icon icon="bx bx-loader-circle bx-spin" className="illustration-icon" />}
+ />
);
}
@@ -384,14 +383,14 @@ function SetupOptionCard({ title, description, icon, onClick, disabled }: { titl
);
}
-function SetupPage({ title, className, illustration, children, footer, error, errorId }: {
+function SetupPage({ title, description, className, illustration, children, footer, error, errorId }: {
title: string;
description?: string;
error?: string | null;
errorId?: number;
className?: string;
illustration?: ComponentChildren;
- children: ComponentChildren;
+ children?: ComponentChildren;
footer?: ComponentChildren;
}) {
const [ showError, setShowError ] = useState(!!error);
@@ -402,7 +401,7 @@ function SetupPage({ title, className, illustration, children, footer, error, er
}, [ error, errorId ]);
return (
- <div className={clsx("page", className)}>
+ <div className={clsx("page", className, { "contentless": !children })}>
{error && showError && (
<Admonition className="page-error" type="caution">
<ActionButton icon="bx bx-x" text={t("setup.dismiss-error")} onClick={() => setShowError(false)} />
@@ -412,9 +411,10 @@ function SetupPage({ title, className, illustration, children, footer, error, er
{illustration}
<h1>{title}</h1>
- <main>
+ {description && <p class="page-description">{description}</p>}
+ {children && <main>
{children}
- </main>
+ </main>}
{footer && <footer>{footer}</footer>}
</div>
);
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index b36e42080b..03d11a313e 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -2256,8 +2256,8 @@
"create-new-document-options-with-demo-description": "Explore Trilium with example content.",
"create-new-document-options-empty": "Empty",
"create-new-document-options-empty-description": "Start with a blank knowledge base. You can import demo notes later.",
- "create-new-document-title": "Preparing your new document",
- "create-new-document-description": "You’ll be redirected automatically in a moment.",
+ "create-new-document-title": "Preparing your knowledge base",
+ "create-new-document-description": "This will only take a moment.",
"sync-illustration-this-device": "This device",
"sync-illustration-desktop-app": "Desktop app",
"sync-illustration-server": "Sync server",