0
Fork 0
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:
Alejandro 2022-08-23 10:50:46 +02:00 committed by GitHub
commit dbd2b8527a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,6 +80,7 @@
card-width 275
num-cards (count templates)
container-size (* (+ 2 num-cards) card-width)
;; We need space for num-cards plus the libraries&templates link
more-cards (> (+ @card-offset (* (+ 1 num-cards) card-width)) content-width)
content-ref (mf/use-ref)
@ -148,7 +149,7 @@
[:span (tr "dashboard.libraries-and-templates")]
[:span.icon (if collapsed i/arrow-up i/arrow-down)]]]
[: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)]]
[:div.card-container {:id (str/concat "card-container-" num-item)
:key (:id item)