mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 16:30:37 -05:00
Add interactions button toggle functionality.
This commit is contained in:
parent
b154bb8ff4
commit
1532dccafa
1 changed files with 21 additions and 24 deletions
|
@ -9,34 +9,31 @@
|
|||
(:require [sablono.core :refer-macros [html]]
|
||||
[lentes.core :as l]
|
||||
[rum.core :as rum]
|
||||
[uxbox.util.mixins :as mx]
|
||||
[uxbox.util.mixins :as mx :include-macros true]
|
||||
[uxbox.util.rstore :as rs]
|
||||
[uxbox.main.ui.icons :as i]
|
||||
[uxbox.main.state :as st]
|
||||
[uxbox.view.data.viewer :as dv]))
|
||||
|
||||
(defn nav-render
|
||||
[own flags]
|
||||
(let [toggle #(rs/emit! (dv/toggle-flag :sitemap))
|
||||
sitemap? (contains? flags :sitemap)]
|
||||
(html
|
||||
[:div.view-nav
|
||||
[:ul.view-options-btn
|
||||
(mx/defc nav
|
||||
[flags]
|
||||
(let [toggle-sitemap #(rs/emit! (dv/toggle-flag :sitemap))
|
||||
toggle-interactions #(rs/emit! (dv/toggle-flag :interactions))
|
||||
sitemap? (contains? flags :sitemap)
|
||||
interactions? (contains? flags :interactions)]
|
||||
[:div.view-nav
|
||||
[:ul.view-options-btn
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "sitemap"
|
||||
:class (when sitemap? "selected")
|
||||
:on-click toggle-sitemap}
|
||||
i/project-tree]
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "sitemap"
|
||||
:class (when sitemap? "selected")
|
||||
:on-click toggle}
|
||||
i/project-tree]
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "view interactions"}
|
||||
{:alt "view interactions"
|
||||
:class (when interactions? "selected")
|
||||
:on-click toggle-interactions}
|
||||
i/action]
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "share"} i/export]
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "save SVG"} i/save]]])))
|
||||
|
||||
(def nav
|
||||
(mx/component
|
||||
{:render nav-render
|
||||
:name "nav"
|
||||
:mixins [mx/static mx/reactive]}))
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "share"} i/export]
|
||||
[:li.tooltip.tooltip-right
|
||||
{:alt "save SVG"} i/save]]]))
|
||||
|
|
Loading…
Reference in a new issue