0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-25 07:58:49 -05:00

🐛 Fixed problem in handoff with images

This commit is contained in:
alonso.torres 2021-01-18 21:36:17 +01:00
parent e69d402b4f
commit 91db8a9247

View file

@ -29,7 +29,8 @@
"image/jpeg" "jpg"
"image/png" "png"
"image/svg+xml" "svg"
"image/webp" "webp"))
"image/webp" "webp"
nil))
(mf/defc image-panel [{:keys [shapes locale]}]
(let [shapes (->> shapes (filter has-image?))]
@ -50,8 +51,11 @@
[:& copy-button {:data (cg/generate-css-props shape :height)}]]
(let [mtype (-> shape :metadata :mtype)
name (:name shape)]
name (:name shape)
extension (mtype->extension mtype)]
[:a.download-button {:target "_blank"
:download (str name "." (mtype->extension mtype))
:download (if extension
(str name "." extension)
name)
:href (cfg/resolve-file-media (-> shape :metadata))}
(t locale "handoff.attributes.image.download")])])))