mirror of
https://github.com/zadam/trilium.git
synced 2025-09-27 17:15:36 +08:00
fix(mobile): file properties not displayed
This commit is contained in:
parent
9750e25ad5
commit
d51fae7878
2 changed files with 17 additions and 3 deletions
|
@ -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 { applyModals } from "./layout_commons.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 = `
|
||||
<style>
|
||||
|
@ -163,7 +167,7 @@ export default class MobileLayout {
|
|||
.contentSized()
|
||||
.child(new NoteDetailWidget())
|
||||
.child(new NoteListWidget(false))
|
||||
//.child(new FilePropertiesWidget().css("font-size", "smaller"))
|
||||
.child(<FilePropertiesWrapper />)
|
||||
)
|
||||
.child(new MobileEditorToolbar())
|
||||
)
|
||||
|
@ -180,3 +184,13 @@ export default class MobileLayout {
|
|||
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 { FormFileUploadButton } from "../react/FormFileUpload";
|
||||
import { useNoteBlob, useNoteLabel } from "../react/hooks";
|
||||
import { TabContext } from "./ribbon-interface";
|
||||
import Button from "../react/Button";
|
||||
import protected_session_holder from "../../services/protected_session_holder";
|
||||
import { downloadFileNote, openNoteExternally } from "../../services/open";
|
||||
import toast from "../../services/toast";
|
||||
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 canAccessProtectedNote = !note?.isProtected || protected_session_holder.isProtectedSessionAvailable();
|
||||
const [ blob ] = useNoteBlob(note);
|
||||
|
|
Loading…
Add table
Reference in a new issue