Skip to content

Build your personal knowledge base with Trilium Notes

chore(setup): tweak language selection

Elian Doran849afaa877cf
diff --git a/apps/client/src/setup.css b/apps/client/src/setup.css
index 6df140773b..30461d527e 100644
--- a/apps/client/src/setup.css
+++ b/apps/client/src/setup.css
@@ -121,7 +121,6 @@ body.setup {
display: flex;
flex-direction: column;
padding-top: 1em;
- min-height: 0;
}
&.contentless {
@@ -130,13 +129,20 @@ body.setup {
}
>footer {
+ background: var(--main-background-color);
+ position: sticky;
+ bottom: -2rem;
+ left: 0;
+ right: 0;
display: flex;
justify-content: flex-end;
gap: 0.5rem;
border-top: 1px solid var(--main-border-color);
padding-top: 1rem;
- margin-inline: -2em;
- padding-inline: 2em;
+ padding-bottom: 2rem;
+ margin-inline: -2rem;
+ margin-bottom: -2rem;
+ padding-inline: 2rem;
}
>.page-error {
@@ -332,21 +338,15 @@ body[dir=rtl] .slide-in-backward {
}
.page.select-language {
- .dropdownWrapper {
- padding-bottom: 2em;
+ .tn-card {
width: 80%;
- margin: auto;
- }
-
- .dropdownWrapper,
- .dropdown,
- .dropdown-menu {
+ margin: 0 auto 2em;
height: 100%;
+ box-sizing: border-box;
}
- .dropdown-menu {
- box-sizing: border-box;
- overflow: auto;
+ .tn-card-body {
+ height: 100%;
}
}
diff --git a/apps/client/src/setup.tsx b/apps/client/src/setup.tsx
index 8e01e7dc20..cdefabc1a5 100644
--- a/apps/client/src/setup.tsx
+++ b/apps/client/src/setup.tsx
@@ -15,7 +15,7 @@ import Admonition from "./widgets/react/Admonition";
import Button from "./widgets/react/Button";
import { Card, CardFrame, CardSection } from "./widgets/react/Card";
import FormGroup from "./widgets/react/FormGroup";
-import FormList, { FormListItem } from "./widgets/react/FormList";
+import { FormListItem } from "./widgets/react/FormList";
import FormTextBox from "./widgets/react/FormTextBox";
import Icon from "./widgets/react/Icon";
@@ -101,16 +101,24 @@ function SelectLanguage({ setState }: { setState: (state: State) => void }) {
illustration={<Icon icon="bx bx-globe" className="illustration-icon" />}
footer={<Button text={t("setup.continue")} kind="primary" onClick={() => setState("firstOptions")} />}
>
- <FormList onSelect={async (id) => {
- await i18n.changeLanguage(id);
- setCurrentLocale(id);
- const locale = LOCALES.find(l => l.id === id);
- document.body.dir = locale?.rtl ? "rtl" : "ltr";
- }}>
- {filteredLocales.map(locale => (
- <FormListItem key={locale.id} value={locale.id} active={locale.id === currentLocale}>{locale.name}</FormListItem>
- ))}
- </FormList>
+ <Card>
+ <CardSection>
+ {filteredLocales.map(locale => (
+ <FormListItem
+ key={locale.id}
+ value={locale.id}
+ active={locale.id === currentLocale}
+ onClick={async () => {
+ await i18n.changeLanguage(locale.id);
+ setCurrentLocale(locale.id);
+ document.body.dir = locale.rtl ? "rtl" : "ltr";
+ }}
+ >
+ {locale.name}
+ </FormListItem>
+ ))}
+ </CardSection>
+ </Card>
</SetupPage>
);
}