0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 00:40:30 -05:00

Minor ns reorg in colors page namespace.

This commit is contained in:
Andrey Antukh 2016-09-25 10:20:48 +03:00
parent a45d91e663
commit 9fa4d8f4d9
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -6,28 +6,26 @@
;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com> ;; Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
(ns uxbox.main.ui.dashboard.colors (ns uxbox.main.ui.dashboard.colors
(:require [sablono.core :refer-macros [html]] (:require [cuerdas.core :as str]
[rum.core :as rum]
[cuerdas.core :as str]
[lentes.core :as l] [lentes.core :as l]
[uxbox.util.i18n :as t :refer (tr)]
[uxbox.main.state :as st]
[uxbox.util.rstore :as rs]
[uxbox.util.schema :as sc]
[uxbox.main.library :as library]
[uxbox.main.data.dashboard :as dd]
[uxbox.main.data.colors :as dc] [uxbox.main.data.colors :as dc]
[uxbox.main.data.dashboard :as dd]
[uxbox.main.data.lightbox :as udl] [uxbox.main.data.lightbox :as udl]
[uxbox.main.ui.icons :as i] [uxbox.main.library :as library]
[uxbox.main.ui.forms :as form] [uxbox.main.state :as st]
[uxbox.main.ui.lightbox :as lbx]
[uxbox.main.ui.colorpicker :refer (colorpicker)] [uxbox.main.ui.colorpicker :refer (colorpicker)]
[uxbox.util.mixins :as mx]
[uxbox.main.ui.dashboard.header :refer (header)] [uxbox.main.ui.dashboard.header :refer (header)]
[uxbox.main.ui.forms :as form]
[uxbox.main.ui.icons :as i]
[uxbox.main.ui.keyboard :as k] [uxbox.main.ui.keyboard :as k]
[uxbox.main.ui.lightbox :as lbx]
[uxbox.util.color :refer (hex->rgb)]
[uxbox.util.dom :as dom] [uxbox.util.dom :as dom]
[uxbox.util.i18n :as t :refer (tr)]
[uxbox.util.lens :as ul] [uxbox.util.lens :as ul]
[uxbox.util.color :refer (hex->rgb)])) [uxbox.util.mixins :as mx]
[uxbox.util.rstore :as rs]
[uxbox.util.schema :as sc]))
;; --- Refs ;; --- Refs
@ -52,7 +50,7 @@
;; --- Page Title ;; --- Page Title
(mx/defcs page-title (mx/defcs page-title
{:mixins [(rum/local {}) mx/static mx/reactive]} {:mixins [(mx/local {}) mx/static mx/reactive]}
[own {:keys [id] :as coll}] [own {:keys [id] :as coll}]
(let [local (:rum/local own) (let [local (:rum/local own)
dashboard (mx/react dashboard-ref) dashboard (mx/react dashboard-ref)
@ -192,7 +190,7 @@
[type selected] [type selected]
(let [own? (= type :own) (let [own? (= type :own)
builtin? (= type :builtin) builtin? (= type :builtin)
collections (cond->> (rum/react collections-ref) collections (cond->> (mx/react collections-ref)
own? (filter #(= :own (:type %))) own? (filter #(= :own (:type %)))
builtin? (filter #(= :builtin (:type %))) builtin? (filter #(= :builtin (:type %)))
own? (sort-by :id))] own? (sort-by :id))]
@ -212,7 +210,7 @@
{:mixins [mx/static mx/reactive]} {:mixins [mx/static mx/reactive]}
[] []
(let [dashboard (mx/react dashboard-ref) (let [dashboard (mx/react dashboard-ref)
collections (rum/react collections-ref) collections (mx/react collections-ref)
selected (:id dashboard) selected (:id dashboard)
type (:type dashboard) type (:type dashboard)
own? (= type :own) own? (= type :own)
@ -265,7 +263,7 @@
;; --- Colors Lightbox (Component) ;; --- Colors Lightbox (Component)
(mx/defcs color-lightbox (mx/defcs color-lightbox
{:mixins [(rum/local {}) mx/static]} {:mixins [(mx/local {}) mx/static]}
[own {:keys [coll color]}] [own {:keys [coll color]}]
(let [local (:rum/local own)] (let [local (:rum/local own)]
(letfn [(on-submit [event] (letfn [(on-submit [event]