From 24252c817204b427ea1341f1f086a82398e36702 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Sat, 23 Nov 2024 20:07:04 +0100 Subject: feat: add default values for popover-menu props --- src/frontend/tubo/components/items.cljs | 3 ++- src/frontend/tubo/components/layout.cljs | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/frontend') diff --git a/src/frontend/tubo/components/items.cljs b/src/frontend/tubo/components/items.cljs index 605169d..cc8f3f1 100644 --- a/src/frontend/tubo/components/items.cljs +++ b/src/frontend/tubo/components/items.cljs @@ -57,7 +57,8 @@ :on-click #(rf/dispatch [:bookmarks/remove bookmark-id true])})])] (when (not-empty (remove nil? items)) - [layout/popover-menu !menu-active? items]))))) + [layout/popover-menu !menu-active? items :extra-classes + [:pr-0 :pl-4] :menu-styles {:right "15px"}]))))) (defn item-content [{:keys [url name uploader-url uploader-name subscriber-count view-count diff --git a/src/frontend/tubo/components/layout.cljs b/src/frontend/tubo/components/layout.cljs index c542574..d72d76d 100644 --- a/src/frontend/tubo/components/layout.cljs +++ b/src/frontend/tubo/components/layout.cljs @@ -165,10 +165,12 @@ ^{:key i} [menu-item item])])) (defn popover-menu - [!menu-active? items & {:keys [menu-styles extra-classes]}] + [!menu-active? items & + {:keys [menu-styles extra-classes] + :or {menu-styles {:right "25px"} extra-classes [:p-3]}}] [:div.flex.items-center [focus-overlay #(reset! !menu-active? false) @!menu-active? true] - [:button.focus:outline-none.relative.pl-4 + [:button.focus:outline-none.relative {:on-click #(reset! !menu-active? (not @!menu-active?)) :class extra-classes} [:i.fa-solid.fa-ellipsis-vertical] -- cgit v1.2.3