Prefer to use ldb/{type}? check when possible

This commit is contained in:
Tienson Qin
2024-08-05 17:51:24 +08:00
parent 0a9320c234
commit 411b05e7ba
36 changed files with 131 additions and 126 deletions

View File

@@ -13,7 +13,8 @@
[logseq.shui.ui :as shui]
[frontend.util :as util]
[clojure.string :as string]
[logseq.db.frontend.property :as db-property]))
[logseq.db.frontend.property :as db-property]
[logseq.db :as ldb]))
(rum/defc page-properties
"This component is called by page-inner and within configure/info modal. This should not
@@ -51,9 +52,8 @@
[state page *mode]
(let [*mode *mode
mode (rum/react *mode)
type (:block/type page)
class? (= type "tag")
property? (= type "property")
class? (ldb/tag? page)
property? (ldb/property? page)
page-opts {:configure? true}]
(when (nil? mode)
(reset! *mode (cond
@@ -106,7 +106,7 @@
*hover? (::hover? state)
*mode (::mode state)
type (:block/type page)
class? (= type "tag")
class? (ldb/tag? page)
collapsed? (not @*show-info?)
has-properties? (or
(seq (:block/tags page))