diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-11-23 20:07:04 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-11-23 20:12:48 +0100 |
commit | 24252c817204b427ea1341f1f086a82398e36702 (patch) | |
tree | 2663a6baa694b2f3a5700ae3e35821db1e9b71e5 | |
parent | 8f65eeb8dec8ad51d4c09b53f9b5ce34f7727a48 (diff) |
feat: add default values for popover-menu props
-rw-r--r-- | src/frontend/tubo/components/items.cljs | 3 | ||||
-rw-r--r-- | src/frontend/tubo/components/layout.cljs | 6 |
2 files changed, 6 insertions, 3 deletions
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] |