mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 17:56:11 +02:00
🐛 Fixed problem in handoff with images
This commit is contained in:
parent
e69d402b4f
commit
91db8a9247
1 changed files with 7 additions and 3 deletions
|
@ -29,7 +29,8 @@
|
||||||
"image/jpeg" "jpg"
|
"image/jpeg" "jpg"
|
||||||
"image/png" "png"
|
"image/png" "png"
|
||||||
"image/svg+xml" "svg"
|
"image/svg+xml" "svg"
|
||||||
"image/webp" "webp"))
|
"image/webp" "webp"
|
||||||
|
nil))
|
||||||
|
|
||||||
(mf/defc image-panel [{:keys [shapes locale]}]
|
(mf/defc image-panel [{:keys [shapes locale]}]
|
||||||
(let [shapes (->> shapes (filter has-image?))]
|
(let [shapes (->> shapes (filter has-image?))]
|
||||||
|
@ -50,8 +51,11 @@
|
||||||
[:& copy-button {:data (cg/generate-css-props shape :height)}]]
|
[:& copy-button {:data (cg/generate-css-props shape :height)}]]
|
||||||
|
|
||||||
(let [mtype (-> shape :metadata :mtype)
|
(let [mtype (-> shape :metadata :mtype)
|
||||||
name (:name shape)]
|
name (:name shape)
|
||||||
|
extension (mtype->extension mtype)]
|
||||||
[:a.download-button {:target "_blank"
|
[: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))}
|
:href (cfg/resolve-file-media (-> shape :metadata))}
|
||||||
(t locale "handoff.attributes.image.download")])])))
|
(t locale "handoff.attributes.image.download")])])))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue