mirror of
https://github.com/penpot/penpot.git
synced 2026-09-09 13:39:02 +00:00
🐛 Remove 'graphics' option from assets filter on new UI
This commit is contained in:
parent
a0870624b6
commit
d2b207f306
@ -73,11 +73,11 @@
|
|||||||
read-only? (mf/use-ctx ctx/workspace-read-only?)
|
read-only? (mf/use-ctx ctx/workspace-read-only?)
|
||||||
new-css-system (mf/use-ctx ctx/new-css-system)
|
new-css-system (mf/use-ctx ctx/new-css-system)
|
||||||
filters* (mf/use-state
|
filters* (mf/use-state
|
||||||
{:term ""
|
{:term ""
|
||||||
:section "all"
|
:section "all"
|
||||||
:ordering (dwa/get-current-assets-ordering)
|
:ordering (dwa/get-current-assets-ordering)
|
||||||
:list-style (dwa/get-current-assets-list-style)
|
:list-style (dwa/get-current-assets-list-style)
|
||||||
:open-menu false})
|
:open-menu false})
|
||||||
filters (deref filters*)
|
filters (deref filters*)
|
||||||
term (:term filters)
|
term (:term filters)
|
||||||
list-style (:list-style filters)
|
list-style (:list-style filters)
|
||||||
@ -88,19 +88,19 @@
|
|||||||
|
|
||||||
toggle-ordering
|
toggle-ordering
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps ordering)
|
(mf/deps ordering)
|
||||||
(fn []
|
(fn []
|
||||||
(let [new-value (toggle-values ordering [:asc :desc])]
|
(let [new-value (toggle-values ordering [:asc :desc])]
|
||||||
(swap! filters* assoc :ordering new-value)
|
(swap! filters* assoc :ordering new-value)
|
||||||
(dwa/set-current-assets-ordering! new-value))))
|
(dwa/set-current-assets-ordering! new-value))))
|
||||||
|
|
||||||
toggle-list-style
|
toggle-list-style
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps list-style)
|
(mf/deps list-style)
|
||||||
(fn []
|
(fn []
|
||||||
(let [new-value (toggle-values list-style [:thumbs :list])]
|
(let [new-value (toggle-values list-style [:thumbs :list])]
|
||||||
(swap! filters* assoc :list-style new-value)
|
(swap! filters* assoc :list-style new-value)
|
||||||
(dwa/set-current-assets-list-style! new-value))))
|
(dwa/set-current-assets-list-style! new-value))))
|
||||||
|
|
||||||
on-search-term-change
|
on-search-term-change
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
@ -148,30 +148,32 @@
|
|||||||
on-menu-close
|
on-menu-close
|
||||||
(mf/use-fn #(swap! filters* assoc :open-menu false))
|
(mf/use-fn #(swap! filters* assoc :open-menu false))
|
||||||
|
|
||||||
options [{:option-name (tr "workspace.assets.box-filter-all")
|
options (into [] (remove nil?
|
||||||
:id "section-all"
|
[{:option-name (tr "workspace.assets.box-filter-all")
|
||||||
:option-handler on-section-filter-change
|
:id "section-all"
|
||||||
:data-test "all"}
|
:option-handler on-section-filter-change
|
||||||
|
:data-test "all"}
|
||||||
|
|
||||||
{:option-name (tr "workspace.assets.components")
|
{:option-name (tr "workspace.assets.components")
|
||||||
:id "section-components"
|
:id "section-components"
|
||||||
:option-handler on-section-filter-change
|
:option-handler on-section-filter-change
|
||||||
:data-test "components"}
|
:data-test "components"}
|
||||||
|
|
||||||
{:option-name (tr "workspace.assets.graphics")
|
(when (not components-v2)
|
||||||
:id "section-graphics"
|
{:option-name (tr "workspace.assets.graphics")
|
||||||
:option-handler on-section-filter-change
|
:id "section-graphics"
|
||||||
:data-test "graphics"}
|
:option-handler on-section-filter-change
|
||||||
|
:data-test "graphics"})
|
||||||
|
|
||||||
{:option-name (tr "workspace.assets.colors")
|
{:option-name (tr "workspace.assets.colors")
|
||||||
:id "section-color"
|
:id "section-color"
|
||||||
:option-handler on-section-filter-change
|
:option-handler on-section-filter-change
|
||||||
:data-test "colors"}
|
:data-test "colors"}
|
||||||
|
|
||||||
{:option-name (tr "workspace.assets.typography")
|
{:option-name (tr "workspace.assets.typography")
|
||||||
:id "section-typography"
|
:id "section-typography"
|
||||||
:option-handler on-section-filter-change
|
:option-handler on-section-filter-change
|
||||||
:data-test "typographies"}]]
|
:data-test "typographies"}]))]
|
||||||
|
|
||||||
(if ^boolean new-css-system
|
(if ^boolean new-css-system
|
||||||
[:div {:class (stl/css :assets-bar)}
|
[:div {:class (stl/css :assets-bar)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user