소스 검색

fix: journal border

Tienson Qin 8 달 전
부모
커밋
4706a33b3b
3개의 변경된 파일13개의 추가작업 그리고 15개의 파일을 삭제
  1. 6 3
      src/main/frontend/components/journal.cljs
  2. 3 3
      src/main/frontend/components/journal.css
  3. 4 9
      src/main/frontend/components/views.cljs

+ 6 - 3
src/main/frontend/components/journal.cljs

@@ -9,8 +9,10 @@
             [rum.core :as rum]))
             [rum.core :as rum]))
 
 
 (rum/defc journal-cp < rum/static
 (rum/defc journal-cp < rum/static
-  [id]
+  [id last?]
   [:div.journal-item.content
   [:div.journal-item.content
+   (when last?
+     {:class "journal-last-item"})
    (page/page-cp {:db/id id})])
    (page/page-cp {:db/id id})])
 
 
 (rum/defc all-journals
 (rum/defc all-journals
@@ -30,5 +32,6 @@
                              (str "journal-" id)))
                              (str "journal-" id)))
        :total-count (count data)
        :total-count (count data)
        :item-content (fn [idx]
        :item-content (fn [idx]
-                       (let [id (util/nth-safe data idx)]
-                         (journal-cp id)))})]))
+                       (let [id (util/nth-safe data idx)
+                             last? (= (inc idx) (count data))]
+                         (journal-cp id last?)))})]))

+ 3 - 3
src/main/frontend/components/journal.css

@@ -11,9 +11,9 @@
     &:first-child {
     &:first-child {
       @apply pt-0 min-h-[500px];
       @apply pt-0 min-h-[500px];
     }
     }
+  }
 
 
-    &:last-child {
-      @apply border-none;
-    }
+  .journal-last-item {
+    @apply border-none;
   }
   }
 }
 }

+ 4 - 9
src/main/frontend/components/views.cljs

@@ -1162,13 +1162,8 @@
          (p/let [block (db-async/<get-block (state/get-current-repo) db-id opts)]
          (p/let [block (db-async/<get-block (state/get-current-repo) db-id opts)]
            (set-item! block))))
            (set-item! block))))
      [db-id])
      [db-id])
-    (item-render (cond
-                   (map? item)
-                   item
-                   (number? item)
-                   {:db/id item}
-                   :else
-                   nil))))
+    (when item
+      (item-render (cond (map? item) item (number? item) {:db/id item})))))
 
 
 (rum/defc table-body < rum/static
 (rum/defc table-body < rum/static
   [table option rows *scroller-ref *rows-wrap set-items-rendered!]
   [table option rows *scroller-ref *rows-wrap set-items-rendered!]
@@ -1635,8 +1630,8 @@
                                       (if value
                                       (if value
                                         (let [c (state/get-component :block/page-cp)]
                                         (let [c (state/get-component :block/page-cp)]
                                           (c {:disable-preview? true} value))
                                           (c {:disable-preview? true} value))
-                                        [:div.text-muted-foreground
-                                         "Other pages"])
+                                        [:div.text-muted-foreground.text-sm
+                                         "Pages"])
 
 
                                       (some? value)
                                       (some? value)
                                       (let [icon (pu/get-block-property-value value :logseq.property/icon)]
                                       (let [icon (pu/get-block-property-value value :logseq.property/icon)]