0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-20 13:55:34 -05:00

🐛 Show new dashboard only in v2, and fix loading screen

This commit is contained in:
Andrés Moya 2022-09-30 12:31:18 +02:00 committed by Eva
parent 7dcd362abd
commit a6d9a65843
2 changed files with 21 additions and 16 deletions

View file

@ -355,8 +355,7 @@
(dnd/has-type? e "application/x-moz-file")) (dnd/has-type? e "application/x-moz-file"))
(dom/prevent-default e) (dom/prevent-default e)
(reset! dragging? false) (reset! dragging? false)
(import-files (.-files (.-dataTransfer e)))))) (import-files (.-files (.-dataTransfer e))))))]
]
[:section.dashboard-grid [:section.dashboard-grid
{:on-drag-enter on-drag-enter {:on-drag-enter on-drag-enter

View file

@ -9,6 +9,7 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.math :as mth] [app.common.math :as mth]
[app.main.data.dashboard :as dd] [app.main.data.dashboard :as dd]
[app.main.features :as features]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.dashboard.grid :refer [grid]] [app.main.ui.dashboard.grid :refer [grid]]
@ -25,11 +26,16 @@
default-project (->> projects vals (d/seek :is-default)) default-project (->> projects vals (d/seek :is-default))
files (->> (vals files-map) files (->> (vals files-map)
(sort-by :modified-at) (sort-by :modified-at)
(reverse)) (reverse)
(not-empty))
components-v2 (features/use-feature :components-v2)
width (mf/use-state nil) width (mf/use-state nil)
rowref (mf/use-ref) rowref (mf/use-ref)
itemsize 330 itemsize (if (>= @width 1030)
280
230)
ratio (if (some? @width) (/ @width itemsize) 0) ratio (if (some? @width) (/ @width itemsize) 0)
nitems (mth/floor ratio) nitems (mth/floor ratio)
limit (min 10 nitems) limit (min 10 nitems)
@ -71,5 +77,5 @@
:project default-project :project default-project
:origin :libraries :origin :libraries
:limit limit :limit limit
:library-view? true}]]])) :library-view? components-v2}]]]))