Skip to content

Build your personal knowledge base with Trilium Notes

feat(import/export): mobile-friendly card grid and file picker

Elian Doran9b8ace621d0a
diff --git a/apps/client/src/translations/en/translation.json b/apps/client/src/translations/en/translation.json
index 4910ca6c8a..dd9747e020 100644
--- a/apps/client/src/translations/en/translation.json
+++ b/apps/client/src/translations/en/translation.json
@@ -239,6 +239,8 @@
"file_upload": {
"drop_or_browse_single": "Drag and drop a file here, or click to browse",
"drop_or_browse_multiple": "Drag and drop files here, or click to browse",
+ "browse_single": "Tap to choose a file",
+ "browse_multiple": "Tap to choose files",
"selected_one": "{{count}} file selected",
"selected_other": "{{count}} files selected"
},
diff --git a/apps/client/src/widgets/react/FileDropZone.tsx b/apps/client/src/widgets/react/FileDropZone.tsx
index c04224a021..eab8bd2241 100644
--- a/apps/client/src/widgets/react/FileDropZone.tsx
+++ b/apps/client/src/widgets/react/FileDropZone.tsx
@@ -3,6 +3,7 @@ import "./FileDropZone.css";
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
import { t } from "../../services/i18n";
+import { isMobile } from "../../services/utils";
export interface FileDropZoneProps {
name?: string;
@@ -86,7 +87,9 @@ export default function FileDropZone({ name, onChange, multiple, accept }: FileD
) : (
<div className="file-drop-zone-prompt">
<span className="bx bx-cloud-upload file-drop-zone-icon" />
- <span>{multiple ? t("file_upload.drop_or_browse_multiple") : t("file_upload.drop_or_browse_single")}</span>
+ <span>{isMobile()
+ ? (multiple ? t("file_upload.browse_multiple") : t("file_upload.browse_single"))
+ : (multiple ? t("file_upload.drop_or_browse_multiple") : t("file_upload.drop_or_browse_single"))}</span>
</div>
)}
</label>
diff --git a/apps/client/src/widgets/react/SelectableCard.css b/apps/client/src/widgets/react/SelectableCard.css
index 90ef117707..5dc781d6f0 100644
--- a/apps/client/src/widgets/react/SelectableCard.css
+++ b/apps/client/src/widgets/react/SelectableCard.css
@@ -4,6 +4,11 @@
gap: 0.75em;
}
+/* The grid columns get cramped on a phone — stack the cards into single-column rows instead. */
+body.mobile .selectable-card-grid {
+ grid-template-columns: 1fr;
+}
+
.selectable-card {
display: flex;
align-items: center;