0
Fork 0
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:
Andrey Antukh 2016-07-10 15:00:08 +03:00
parent b154bb8ff4
commit 1532dccafa
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -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]]]))