Skip to content

Commit

Permalink
use pass through merged default-args to fix download-shortcut
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Jul 8, 2024
1 parent 70a2e6b commit 5962b44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
21 changes: 11 additions & 10 deletions src/shimmers/common/ui/svg.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@
(fn [] (svg-export/download id filename))])

(defn page
[{:keys [sketch-id scene-id explanation]
:or {scene-id "scene"}
[{:keys [sketch-id explanation]
:as sketch-args}
scene]
(fn []
[sketch/with-explanation
[:div.canvas-frame
[scene sketch-args]
[download-shortcut scene-id (name sketch-id)]]
[:p.center [view-sketch/generate sketch-id]]
(when explanation
[:div.readable-width
[explanation sketch-args]])]))
(let [default-args {:scene-id "scene"}
{:keys [scene-id] :as args} (merge default-args sketch-args)]
[sketch/with-explanation
[:div.canvas-frame
[scene args]
[download-shortcut scene-id (name sketch-id)]]
[:p.center [view-sketch/generate sketch-id]]
(when explanation
[:div.readable-width
[explanation sketch-args]])])))
3 changes: 1 addition & 2 deletions src/shimmers/sketches/radial_mosaic.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@
cycled across all segments in the arc, subdviding evenly as it's an even
divisor."]]]))

;; FIXME: download-sketch is failing in console
(defn sketch [{:keys [params scene-id]}]
(defn sketch [{:keys [scene-id params]}]
(csvg/svg-timed {:id scene-id
:width width
:height height}
Expand Down

0 comments on commit 5962b44

Please sign in to comment.