0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-02 12:28:54 -05:00

Merge pull request #5358 from penpot/azazeln28-fix-assets-filters

🐛 Fix assets filters
This commit is contained in:
Andrey Antukh 2024-11-25 11:23:14 +01:00 committed by GitHub
commit 7e5f93ca3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 7 deletions

View file

@ -133,23 +133,23 @@
options options
[{:name (tr "workspace.assets.box-filter-all") [{:name (tr "workspace.assets.box-filter-all")
:id "section-all" :id "all"
:handler on-section-filter-change} :handler on-section-filter-change}
{:name (tr "workspace.assets.components") {:name (tr "workspace.assets.components")
:id "section-components" :id "components"
:handler on-section-filter-change} :handler on-section-filter-change}
(when (not components-v2) (when (not components-v2)
{:name (tr "workspace.assets.graphics") {:name (tr "workspace.assets.graphics")
:id "section-graphics" :id "graphics"
:handler on-section-filter-change}) :handler on-section-filter-change})
{:name (tr "workspace.assets.colors") {:name (tr "workspace.assets.colors")
:id "section-colors" :id "colors"
:handler on-section-filter-change} :handler on-section-filter-change}
{:name (tr "workspace.assets.typography") {:name (tr "workspace.assets.typography")
:id "section-typographies" :id "typographies"
:handler on-section-filter-change}]] :handler on-section-filter-change}]]
[:article {:class (stl/css :assets-bar)} [:article {:class (stl/css :assets-bar)}

View file

@ -74,14 +74,13 @@
(mf/defc file-library-content (mf/defc file-library-content
{::mf/wrap-props false} {::mf/wrap-props false}
[{:keys [file local? open-status-ref on-clear-selection]}] [{:keys [file local? open-status-ref on-clear-selection filters]}]
(let [components-v2 (mf/use-ctx ctx/components-v2) (let [components-v2 (mf/use-ctx ctx/components-v2)
open-status (mf/deref open-status-ref) open-status (mf/deref open-status-ref)
file-id (:id file) file-id (:id file)
project-id (:project-id file) project-id (:project-id file)
filters (mf/use-ctx cmm/assets-filters)
filters-section (:section filters) filters-section (:section filters)
filters-term (:term filters) filters-term (:term filters)