diff --git a/src/uxbox/view/ui/viewer/nav.cljs b/src/uxbox/view/ui/viewer/nav.cljs index 14f98bb0f..f4385b0ad 100644 --- a/src/uxbox/view/ui/viewer/nav.cljs +++ b/src/uxbox/view/ui/viewer/nav.cljs @@ -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]]]))