mirror of
https://github.com/penpot/penpot.git
synced 2025-02-24 07:46:13 -05:00
Merge pull request #2180 from penpot/palba-carousel-misaligment
🐛 Fix Libraries & Templates carousel misalingments
This commit is contained in:
commit
dbd2b8527a
1 changed files with 2 additions and 1 deletions
|
@ -80,6 +80,7 @@
|
||||||
|
|
||||||
card-width 275
|
card-width 275
|
||||||
num-cards (count templates)
|
num-cards (count templates)
|
||||||
|
container-size (* (+ 2 num-cards) card-width)
|
||||||
;; We need space for num-cards plus the libraries&templates link
|
;; We need space for num-cards plus the libraries&templates link
|
||||||
more-cards (> (+ @card-offset (* (+ 1 num-cards) card-width)) content-width)
|
more-cards (> (+ @card-offset (* (+ 1 num-cards) card-width)) content-width)
|
||||||
content-ref (mf/use-ref)
|
content-ref (mf/use-ref)
|
||||||
|
@ -148,7 +149,7 @@
|
||||||
[:span (tr "dashboard.libraries-and-templates")]
|
[:span (tr "dashboard.libraries-and-templates")]
|
||||||
[:span.icon (if collapsed i/arrow-up i/arrow-down)]]]
|
[:span.icon (if collapsed i/arrow-up i/arrow-down)]]]
|
||||||
[:div.content {:ref content-ref
|
[:div.content {:ref content-ref
|
||||||
:style {:left @card-offset}}
|
:style {:left @card-offset :width (str container-size "px")}}
|
||||||
(for [num-item (range (count templates)) :let [item (nth templates num-item)]]
|
(for [num-item (range (count templates)) :let [item (nth templates num-item)]]
|
||||||
[:div.card-container {:id (str/concat "card-container-" num-item)
|
[:div.card-container {:id (str/concat "card-container-" num-item)
|
||||||
:key (:id item)
|
:key (:id item)
|
||||||
|
|
Loading…
Add table
Reference in a new issue