Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
feat(standalone/setup): basic footer
Elian Doran44f519c1d64f
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.cssindex 0612dae2ed..338da5407e 100644--- a/apps/client/src/setup.css+++ b/apps/client/src/setup.css@@ -66,5 +66,23 @@ body.setup {}}}++ .page {+ display: flex;+ flex-direction: column;+ height: 100%;++ >main {+ flex: 1;+ }++ >footer {+ display: flex;+ justify-content: flex-end;+ gap: 0.5rem;+ border-top: 1px solid var(--main-border-color);+ padding-top: 1rem;+ }+ }}}diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsxindex 753766ce4c..0840aea730 100644--- a/apps/client/src/setup.tsx+++ b/apps/client/src/setup.tsx@@ -1,8 +1,10 @@import "./setup.css";import { render } from "preact";+import { useState } from "preact/hooks";import { initLocale, t } from "./services/i18n";+import Button from "./widgets/react/Button";import { CardFrame } from "./widgets/react/Card";import Icon from "./widgets/react/Icon";@@ -15,9 +17,22 @@ async function main() {document.body.replaceChildren(bodyWrapper);}+type State = "firstOptions" | "syncFromDesktop" | "syncFromServer";+function App() {+ const [ state, setState ] = useState<State>("syncFromServer");+return (<div class="setup-container">+ {state === "firstOptions" && <SetupOptions setState={setState} />}+ {state === "syncFromServer" && <SyncFromServer setState={setState} />}+ </div>+ );+}++function SetupOptions({ setState }: { setState: (state: State) => void }) {+ return (+ <div class="page setup-options-container"><h1>{t("setup.heading")}</h1><div class="setup-options">@@ -31,27 +46,45 @@ function App() {icon="bx bx-server"title={t("setup.sync-from-server")}description={t("setup.sync-from-server-description")}+ onClick={() => setState("syncFromServer")}/><SetupOptionCardicon="bx bx-desktop"title={t("setup.sync-from-desktop")}description={t("setup.sync-from-desktop-description")}+ onClick={() => setState("syncFromDesktop")}/></div></div>);}-function SetupOptionCard({ title, description, icon }: { title: string; description: string, icon: string }) {+function SyncFromServer({ setState }: { setState: (state: State) => void }) {return (- <CardFrame className="setup-option-card">+ <div class="page sync-from-server">+ <h1>{t("setup.sync-from-server-page-title")}</h1>+ <p>{t("setup.sync-from-server-page-description")}</p>++ <main />++ <footer>+ <Button text={t("setup.button-back")} onClick={() => setState("firstOptions")} kind="lowProfile" />+ <Button text={t("setup.button-finish-setup")} kind="primary" />+ </footer>+ </div>+ );+}++function SetupOptionCard({ title, description, icon, onClick }: { title: string; description: string, icon: string, onClick?: () => void }) {+ return (+ <CardFrame className="setup-option-card" onClick={onClick}><Icon icon={icon} />- <main>+ <div><h3>{title}</h3><p>{description}</p>- </main>+ </div></CardFrame>);}diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.jsonindex dac607b15b..838920067b 100644--- a/apps/client/src/translations/en/translation.json+++ b/apps/client/src/translations/en/translation.json@@ -2242,6 +2242,10 @@"next": "Next","init-in-progress": "Document initialization in progress","redirecting": "You will be shortly redirected to the application.",- "title": "Setup"+ "title": "Setup",+ "sync-from-server-page-title": "Connect to sync server",+ "sync-from-server-page-description": "Enter your server details below to connect your existing workspace.",+ "button-back": "Back",+ "button-finish-setup": "Finish setup"}}