mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
📎 Use grid* instead of line-grid to show all deleted files
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.context-menu-a11y :refer [context-menu*]]
|
||||
[app.main.ui.dashboard.grid :refer [line-grid]]
|
||||
[app.main.ui.dashboard.grid :refer [grid*]]
|
||||
[app.main.ui.ds.buttons.button :refer [button*]]
|
||||
[app.main.ui.ds.product.empty-placeholder :refer [empty-placeholder*]]
|
||||
[app.main.ui.hooks :as hooks]
|
||||
@@ -103,18 +103,19 @@
|
||||
{::mf/props :obj
|
||||
::mf/private true}
|
||||
[{:keys [project team files]}]
|
||||
(let [project-files (filterv #(= (:project-id %) (:id project)) files)
|
||||
empty? (empty? project-files)
|
||||
(let [project-files (filterv #(= (:project-id %) (:id project)) files)
|
||||
|
||||
dstate (mf/deref refs/dashboard-local)
|
||||
edit-id (:project-for-edit dstate)
|
||||
empty? (empty? project-files)
|
||||
selected-files (mf/deref refs/selected-files)
|
||||
|
||||
local (mf/use-state {:menu-open false
|
||||
:menu-pos nil
|
||||
:edition (= (:id project) edit-id)})
|
||||
dstate (mf/deref refs/dashboard-local)
|
||||
edit-id (:project-for-edit dstate)
|
||||
|
||||
[rowref limit]
|
||||
(hooks/use-dynamic-grid-item-width)
|
||||
local (mf/use-state {:menu-open false
|
||||
:menu-pos nil
|
||||
:edition (= (:id project) edit-id)})
|
||||
|
||||
[rowref limit] (hooks/use-dynamic-grid-item-width)
|
||||
|
||||
on-menu-click
|
||||
(mf/use-fn
|
||||
@@ -178,13 +179,14 @@
|
||||
:type 1
|
||||
:subtitle (tr "dashboard.empty-placeholder-files-subtitle")}]
|
||||
|
||||
[:& line-grid
|
||||
[:> grid*
|
||||
{:project project
|
||||
:team team
|
||||
:files project-files
|
||||
:origin :deleted
|
||||
:can-edit false
|
||||
:can-restore true
|
||||
:limit limit}])]]))
|
||||
:limit limit
|
||||
:selected-files selected-files}])]]))
|
||||
|
||||
(def ^:private ref:deleted-files
|
||||
(l/derived :deleted-files st/state))
|
||||
|
||||
@@ -460,7 +460,7 @@
|
||||
|
||||
(mf/defc grid*
|
||||
{::mf/props :obj}
|
||||
[{:keys [files project origin limit create-fn can-edit selected-files]}]
|
||||
[{:keys [files project origin limit create-fn can-edit selected-files can-restore]}]
|
||||
(let [dragging? (mf/use-state false)
|
||||
project-id (get project :id)
|
||||
team-id (get project :team-id)
|
||||
@@ -540,7 +540,8 @@
|
||||
:key (dm/str (:id item))
|
||||
:origin origin
|
||||
:selected-files selected-files
|
||||
:can-edit can-edit}])])
|
||||
:can-edit can-edit
|
||||
:can-restore can-restore}])])
|
||||
|
||||
:else
|
||||
[:> empty-grid-placeholder*
|
||||
|
||||
Reference in New Issue
Block a user