mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(mobile): file properties not displayed
This commit is contained in:
parent
9750e25ad5
commit
d51fae7878
@ -26,6 +26,10 @@ import RefreshButton from "../widgets/floating_buttons/refresh_button.js";
|
|||||||
import MobileEditorToolbar from "../widgets/type_widgets/ckeditor/mobile_editor_toolbar.js";
|
import MobileEditorToolbar from "../widgets/type_widgets/ckeditor/mobile_editor_toolbar.js";
|
||||||
import { applyModals } from "./layout_commons.js";
|
import { applyModals } from "./layout_commons.js";
|
||||||
import CloseZenButton from "../widgets/close_zen_button.js";
|
import CloseZenButton from "../widgets/close_zen_button.js";
|
||||||
|
import FilePropertiesTab from "../widgets/ribbon/FilePropertiesTab.jsx";
|
||||||
|
import { useNoteContext } from "../widgets/react/hooks.jsx";
|
||||||
|
import { useContext } from "preact/hooks";
|
||||||
|
import { ParentComponent } from "../widgets/react/react_utils.jsx";
|
||||||
|
|
||||||
const MOBILE_CSS = `
|
const MOBILE_CSS = `
|
||||||
<style>
|
<style>
|
||||||
@ -163,7 +167,7 @@ export default class MobileLayout {
|
|||||||
.contentSized()
|
.contentSized()
|
||||||
.child(new NoteDetailWidget())
|
.child(new NoteDetailWidget())
|
||||||
.child(new NoteListWidget(false))
|
.child(new NoteListWidget(false))
|
||||||
//.child(new FilePropertiesWidget().css("font-size", "smaller"))
|
.child(<FilePropertiesWrapper />)
|
||||||
)
|
)
|
||||||
.child(new MobileEditorToolbar())
|
.child(new MobileEditorToolbar())
|
||||||
)
|
)
|
||||||
@ -180,3 +184,13 @@ export default class MobileLayout {
|
|||||||
return rootContainer;
|
return rootContainer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function FilePropertiesWrapper() {
|
||||||
|
const { note } = useNoteContext();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{note?.type === "file" && <FilePropertiesTab note={note} />}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
@ -2,14 +2,14 @@ import { t } from "../../services/i18n";
|
|||||||
import { formatSize } from "../../services/utils";
|
import { formatSize } from "../../services/utils";
|
||||||
import { FormFileUploadButton } from "../react/FormFileUpload";
|
import { FormFileUploadButton } from "../react/FormFileUpload";
|
||||||
import { useNoteBlob, useNoteLabel } from "../react/hooks";
|
import { useNoteBlob, useNoteLabel } from "../react/hooks";
|
||||||
import { TabContext } from "./ribbon-interface";
|
|
||||||
import Button from "../react/Button";
|
import Button from "../react/Button";
|
||||||
import protected_session_holder from "../../services/protected_session_holder";
|
import protected_session_holder from "../../services/protected_session_holder";
|
||||||
import { downloadFileNote, openNoteExternally } from "../../services/open";
|
import { downloadFileNote, openNoteExternally } from "../../services/open";
|
||||||
import toast from "../../services/toast";
|
import toast from "../../services/toast";
|
||||||
import server from "../../services/server";
|
import server from "../../services/server";
|
||||||
|
import FNote from "../../entities/fnote";
|
||||||
|
|
||||||
export default function FilePropertiesTab({ note }: TabContext) {
|
export default function FilePropertiesTab({ note }: { note?: FNote | null }) {
|
||||||
const [ originalFileName ] = useNoteLabel(note, "originalFileName");
|
const [ originalFileName ] = useNoteLabel(note, "originalFileName");
|
||||||
const canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable();
|
const canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable();
|
||||||
const [ blob ] = useNoteBlob(note);
|
const [ blob ] = useNoteBlob(note);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user