Skip to content

Commit

Permalink
Proper page_nav content alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
alwx committed May 17, 2024
1 parent 24efb8c commit a27baa8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 14 deletions.
12 changes: 9 additions & 3 deletions src/quo/components/navigation/page_nav/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@
:opacity center-opacity})

(def right-actions-container
{:flex-direction :row})
{:flex-direction :row
:justify-content :flex-end})

(def right-actions-spacing
{:width 12})

(def right-content-min-size
{:min-width 32 :min-height 32})
(defn right-content
[min-size?]
(merge
{:flex-grow 1
:flex-basis 1}
(when min-size?
{:min-height 32})))

(def token-logo
{:width 16 :height 16})
Expand Down
23 changes: 12 additions & 11 deletions src/quo/components/navigation/page_nav/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@
& children]
(into [rn/view {:style (style/container margin-top)}
(when icon-name
[button/button
{:type (button-type background)
:icon-only? true
:size 32
:on-press on-press
:background (if behind-overlay?
:blur
(when (button-properties/backgrounds background) background))
:accessibility-label accessibility-label}
icon-name])]
[rn/view {:flex-grow 1 :flex-basis 1}
[button/button
{:type (button-type background)
:icon-only? true
:size 32
:on-press on-press
:background (if behind-overlay?
:blur
(when (button-properties/backgrounds background) background))
:accessibility-label accessibility-label}
icon-name]])]
children))

(defn- right-section-spacing [] [rn/view {:style style/right-actions-spacing}])
Expand Down Expand Up @@ -88,7 +89,7 @@
[{:keys [background content max-actions min-size? support-account-switcher?
behind-overlay?]
:or {support-account-switcher? true}}]
[rn/view (when min-size? {:style style/right-content-min-size})
[rn/view (style/right-content min-size?)
(when (coll? content)
(into [rn/view {:style style/right-actions-container}]
(add-right-buttons-xf max-actions background behind-overlay? support-account-switcher?)
Expand Down

0 comments on commit a27baa8

Please sign in to comment.