Skip to content

Build your personal knowledge base with Trilium Notes

refactor(dropdown): open the hand-made bottom sheets with `mobileBottomSheet`

Elian Doran6f31d21635cb
diff --git a/apps/client/src/widgets/dialogs/revisions.tsx b/apps/client/src/widgets/dialogs/revisions.tsx
index 7b5486ed18..894e9a3eb9 100644
--- a/apps/client/src/widgets/dialogs/revisions.tsx
+++ b/apps/client/src/widgets/dialogs/revisions.tsx
@@ -244,7 +244,7 @@ function RevisionsMenu({ note, onRevisionSaved, onAllDeleted, hasRevisions }: {
buttonClassName="custom-title-bar-button"
noSelectButtonStyle
buttonProps={{ title: t("revisions.menu_tooltip") }}
- dropdownContainerClassName="mobile-bottom-menu"
+ mobileBottomSheet
>
<FormListItem
icon="bx bx-save"
diff --git a/apps/client/src/widgets/layout/ActiveContentBadges.tsx b/apps/client/src/widgets/layout/ActiveContentBadges.tsx
index 7ce70e9514..925b6c58a1 100644
--- a/apps/client/src/widgets/layout/ActiveContentBadges.tsx
+++ b/apps/client/src/widgets/layout/ActiveContentBadges.tsx
@@ -172,10 +172,7 @@ function ActiveContentBadge({ info, note }: { note: FNote, info: ActiveContentIn
className={clsx("active-content-badge", info.canToggleEnabled && !info.isEnabled && "disabled")}
icon={icon}
text={title}
- dropdownProps={{
- dropdownContainerClassName: "mobile-bottom-menu",
- mobileBackdrop: true
- }}
+ dropdownProps={{ mobileBottomSheet: true }}
>
{additionalOptions?.length && (
<>
diff --git a/apps/client/src/widgets/note_bars/CollectionProperties.tsx b/apps/client/src/widgets/note_bars/CollectionProperties.tsx
index 199a223228..441a026c0b 100644
--- a/apps/client/src/widgets/note_bars/CollectionProperties.tsx
+++ b/apps/client/src/widgets/note_bars/CollectionProperties.tsx
@@ -168,8 +168,7 @@ function ViewOptions({ note, viewType, optionsChildren }: {
<Dropdown
buttonClassName="bx bx-cog icon-action"
hideToggleArrow
- dropdownContainerClassName="mobile-bottom-menu"
- mobileBackdrop
+ mobileBottomSheet
>
{properties.map((property, index) => (
<ViewProperty key={index} note={note} property={property} />
diff --git a/apps/client/src/widgets/react/IconPicker.tsx b/apps/client/src/widgets/react/IconPicker.tsx
index dc08cf6db1..26003cd60f 100644
--- a/apps/client/src/widgets/react/IconPicker.tsx
+++ b/apps/client/src/widgets/react/IconPicker.tsx
@@ -356,7 +356,7 @@ function FilterRow({ filterByPrefix, search, setSearch, setFilterByPrefix, filte
hideToggleArrow
noSelectButtonStyle
iconAction
- dropdownContainerClassName="mobile-bottom-menu"
+ mobileBottomSheet
>
{onReset && <>
<FormListItem
diff --git a/apps/client/src/widgets/ribbon/NoteActions.tsx b/apps/client/src/widgets/ribbon/NoteActions.tsx
index 92ed156ff7..67f9eff54b 100644
--- a/apps/client/src/widgets/ribbon/NoteActions.tsx
+++ b/apps/client/src/widgets/ribbon/NoteActions.tsx
@@ -117,12 +117,11 @@ export function NoteContextMenu({ note, noteContext, itemsAtStart, itemsNearNote
dropdownRef={dropdownRef}
buttonClassName={ isNewLayout ? "bx bx-dots-horizontal-rounded" : "bx bx-dots-vertical-rounded" }
className="note-actions"
- dropdownContainerClassName="mobile-bottom-menu"
+ mobileBottomSheet
hideToggleArrow
noSelectButtonStyle
iconAction
onHidden={() => itemToFocusRef.current = null }
- mobileBackdrop
>
{itemsAtStart}
diff --git a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx
index 2d58fc1913..e4796b64e4 100644
--- a/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx
+++ b/apps/client/src/widgets/ribbon/SearchDefinitionTab.tsx
@@ -98,7 +98,7 @@ export default function SearchDefinitionTab({ note, ntxId, hidden }: Pick<TabCon
<Dropdown
buttonClassName="action-add-toggle btn btn-sm"
text={<><Icon icon="bx bx-plus" />{" "}{t("search_definition.option")}</>}
- dropdownContainerClassName="mobile-bottom-menu" mobileBackdrop
+ mobileBottomSheet
noSelectButtonStyle
>
{searchOptions?.availableOptions.map(({ icon, label, tooltip, attributeName, attributeType, defaultValue }) => (
@@ -222,7 +222,7 @@ function AddBulkActionButton({ note }: { note: FNote }) {
buttonClassName="action-add-toggle btn btn-sm"
text={<><Icon icon="bx bxs-zap" />{" "}{t("search_definition.action")}</>}
noSelectButtonStyle
- dropdownContainerClassName="mobile-bottom-menu" mobileBackdrop
+ mobileBottomSheet
>
{ACTION_GROUPS.map(({ actions, title }, index) => (
<Fragment key={index}>
diff --git a/apps/client/src/widgets/type_widgets/Attachment.tsx b/apps/client/src/widgets/type_widgets/Attachment.tsx
index 065524d753..a21907f1b3 100644
--- a/apps/client/src/widgets/type_widgets/Attachment.tsx
+++ b/apps/client/src/widgets/type_widgets/Attachment.tsx
@@ -429,8 +429,7 @@ function AttachmentActions({ attachment, copyAttachmentReferenceToClipboard, onS
text={<Icon icon="bx bx-dots-vertical-rounded" />}
buttonClassName="icon-action-always-border"
iconAction
- dropdownContainerClassName="mobile-bottom-menu"
- mobileBackdrop
+ mobileBottomSheet
>
<FormListItem
icon="bx bx-file-find"