chore: add sort by journals desc back

pull/6412/head
Tienson Qin 2022-08-19 22:58:34 +08:00 committed by Andelf
parent ce61b01634
commit 0c803cd2f2
1 changed files with 18 additions and 17 deletions

View File

@ -3322,23 +3322,24 @@
(cond (cond
(and (:ref? config) (:group-by-page? config)) (and (:ref? config) (:group-by-page? config))
[:div.flex.flex-col [:div.flex.flex-col
(for [[page parent-blocks] blocks] (let [blocks (sort-by (comp :block/journal-day first) > blocks)]
(ui/lazy-visible (for [[page parent-blocks] blocks]
(fn [] (ui/lazy-visible
(let [alias? (:block/alias? page) (fn []
page (db/entity (:db/id page))] (let [alias? (:block/alias? page)
[:div.my-2 (cond-> {:key (str "page-" (:db/id page))} page (db/entity (:db/id page))]
(:ref? config) [:div.my-2 (cond-> {:key (str "page-" (:db/id page))}
(assoc :class "color-level px-2 sm:px-7 py-2 rounded")) (:ref? config)
(ui/foldable (assoc :class "color-level px-2 sm:px-7 py-2 rounded"))
[:div (ui/foldable
(page-cp config page) [:div
(when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])] (page-cp config page)
(for [block parent-blocks] (when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])]
(rum/with-key (for [block parent-blocks]
(breadcrumb-with-container block config) (rum/with-key
(:db/id block))) (breadcrumb-with-container block config)
{:debug-id page})]))))] (:db/id block)))
{:debug-id page})])))))]
(and (:custom-query? config) (:group-by-page? config)) (and (:custom-query? config) (:group-by-page? config))
[:div.flex.flex-col [:div.flex.flex-col