From 71e30a160766cdadf62163d1973aa6e8c6d6b561 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 29 Apr 2020 10:03:38 +0200 Subject: [PATCH] :sparkles: Fixes styles --- .../styles/main/layouts/projects-page.scss | 2 ++ .../styles/main/layouts/recent-files-page.scss | 9 +-------- .../styles/main/partials/dashboard-grid.scss | 7 +++++++ frontend/src/uxbox/main/exports.cljs | 3 ++- frontend/src/uxbox/main/store.cljs | 16 +++++++++++----- .../uxbox/main/ui/dashboard/recent_files.cljs | 7 +++++-- .../src/uxbox/main/ui/workspace/drawarea.cljs | 12 +++++++----- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/frontend/resources/styles/main/layouts/projects-page.scss b/frontend/resources/styles/main/layouts/projects-page.scss index d2c7d3bcf..c1341fbf0 100644 --- a/frontend/resources/styles/main/layouts/projects-page.scss +++ b/frontend/resources/styles/main/layouts/projects-page.scss @@ -1,3 +1,5 @@ .projects-page { padding: 1rem; + height: 100%; + background-color: $color-white; } diff --git a/frontend/resources/styles/main/layouts/recent-files-page.scss b/frontend/resources/styles/main/layouts/recent-files-page.scss index c9cbb18dd..61c5b426a 100644 --- a/frontend/resources/styles/main/layouts/recent-files-page.scss +++ b/frontend/resources/styles/main/layouts/recent-files-page.scss @@ -1,20 +1,13 @@ .recent-files-page { overflow: scroll; height: 100%; + background-color: $color-white; } .recent-files-row { padding: 1rem; border-top: 1px solid $color-gray-10; - &:hover { - background-color: $color-white; - - .grid-item.project-th { - box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.2); - } - } - &.first { border-top: none; } diff --git a/frontend/resources/styles/main/partials/dashboard-grid.scss b/frontend/resources/styles/main/partials/dashboard-grid.scss index b4bf6d9fb..d20da0d9c 100644 --- a/frontend/resources/styles/main/partials/dashboard-grid.scss +++ b/frontend/resources/styles/main/partials/dashboard-grid.scss @@ -349,11 +349,18 @@ position: relative; width: 100%; + background-color: $color-canvas; + .img-th { height: auto; width: 100%; } + svg { + height: 100%; + width: 100%; + } + } // MULTISELECT OPTIONS BAR diff --git a/frontend/src/uxbox/main/exports.cljs b/frontend/src/uxbox/main/exports.cljs index 336d37bfa..10374a3f3 100644 --- a/frontend/src/uxbox/main/exports.cljs +++ b/frontend/src/uxbox/main/exports.cljs @@ -22,13 +22,14 @@ [uxbox.main.ui.shapes.text :as text] [uxbox.main.ui.shapes.group :as group])) +(def ^:private background-color "#E8E9EA") ;; $color-canvas (mf/defc background [] [:rect {:x 0 :y 0 :width "100%" :height "100%" - :fill "#AFB2BF"}]) + :fill background-color}]) (defn- calculate-dimensions [data] diff --git a/frontend/src/uxbox/main/store.cljs b/frontend/src/uxbox/main/store.cljs index bc01282de..5512e9fc3 100644 --- a/frontend/src/uxbox/main/store.cljs +++ b/frontend/src/uxbox/main/store.cljs @@ -10,7 +10,8 @@ [okulary.core :as l] [potok.core :as ptk] [uxbox.common.uuid :as uuid] - [uxbox.util.storage :refer [storage]])) + [uxbox.util.storage :refer [storage]] + [uxbox.util.debug :refer [debug? logjs]])) (enable-console-print!) @@ -34,13 +35,11 @@ :else (str "unk: " (pr-str event)))) -(defonce ^:dynamic *debug* (atom false)) - (when *assert* (defonce debug-subscription (as-> stream $ - (rx/filter ptk/event? $) - (rx/filter (fn [s] (deref *debug*)) $) + #_(rx/filter ptk/event? $) + (rx/filter (fn [s] (debug? :events)) $) (rx/subscribe $ (fn [event] (println "[stream]: " (repr-event event))))))) (defn emit! @@ -62,3 +61,10 @@ ([props] (emit! #(merge % initial-state props)) (rx/to-atom store state))) + +(defn ^:export dump-state [] + (logjs "state" @state)) + +(defn ^:export dump-objects [] + (let [page-id (get @state :current-page-id)] + (logjs "state" (get-in @state [:workspace-data page-id :objects])))) diff --git a/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs b/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs index c08d70ec7..807a04a87 100644 --- a/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs +++ b/frontend/src/uxbox/main/ui/dashboard/recent_files.cljs @@ -51,11 +51,14 @@ (mf/defc recent-project [{:keys [project files first? locale] :as props}] - (let [project-id (:id project)] + (let [project-id (:id project) + team-id (:team-id project)] [:div.recent-files-row {:class-name (when first? "first")} [:div.recent-files-row-title - [:h2.recent-files-row-title-name (:name project)] + [:h2.recent-files-row-title-name {:on-click #(st/emit! (rt/nav :dashboard-project {:team-id team-id + :project-id project-id})) + :style {:cursor "pointer"}} (:name project)] [:span.recent-files-row-title-info (str (:file-count project) " files")] (let [time (-> (:modified-at project) (dt/timeago {:locale locale}))] diff --git a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs index 65a16ce0c..7c43e52f4 100644 --- a/frontend/src/uxbox/main/ui/workspace/drawarea.cljs +++ b/frontend/src/uxbox/main/ui/workspace/drawarea.cljs @@ -35,15 +35,18 @@ (declare handle-finish-drawing) (declare conditional-align) +(def ^:private default-color "#b1b2b5") ;; $color-gray-20 + (def ^:private minimal-shapes [{:type :rect :name "Rect" - :stroke-color "#000000" + :fill-color default-color :stroke-alignment :center} {:type :image} {:type :icon} {:type :circle - :name "Circle"} + :name "Circle" + :fill-color default-color} {:type :path :name "Path" :stroke-style :solid @@ -312,10 +315,9 @@ [:rect.main {:x x :y y :width width :height height - :stroke-dasharray (str (/ 5.0 zoom) "," (/ 5 zoom)) - :style {:stroke "#333" + :style {:stroke "#1FDEA7" :fill "transparent" - :stroke-opacity "1"}}]]))) + :stroke-width "1"}}]]))) (mf/defc path-draw-area [{:keys [shape] :as props}]