Просмотр исходного кода

fix(ui): duplicated page icon for block page refs

charlie 1 год назад
Родитель
Сommit
09bcef808e

+ 18 - 15
src/main/frontend/components/block.cljs

@@ -3725,21 +3725,24 @@
         ;; FIXME: parents need to be sorted
         parent-blocks (group-by :block/parent page-blocks)]
     [:div.my-2.references-blocks-item {:key (str "page-" (:db/id page))}
-      (ui/foldable
-       [:div
-        (page-cp config page)
-        (when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])]
-       (for [[parent blocks] parent-blocks]
-         (let [blocks' (map (fn [b]
-                              (if (e/entity? b)
-                                b
-                                (update b :block/children
-                                        (fn [col]
-                                          (tree/non-consecutive-blocks->vec-tree col))))) blocks)]
-           (rum/with-key
-             (breadcrumb-with-container blocks' config)
-             (:db/id parent))))
-       {:debug-id page})]))
+     (let [items (for [[parent blocks] parent-blocks]
+                     (let [blocks' (map (fn [b]
+                                          (if (e/entity? b)
+                                            b
+                                            (update b :block/children
+                                              (fn [col]
+                                                (tree/non-consecutive-blocks->vec-tree col))))) blocks)]
+                       (rum/with-key
+                         (breadcrumb-with-container blocks' config)
+                         (:db/id parent))))]
+       (if page
+         (ui/foldable
+           [:div
+            (page-cp config page)
+            (when alias? [:span.text-sm.font-medium.opacity-50 " Alias"])]
+           items
+           {:debug-id page})
+         [:div.relative.-left-2 items]))]))
 
 ;; headers to hiccup
 (defn ->hiccup

+ 1 - 1
src/main/frontend/components/block.css

@@ -355,7 +355,7 @@
   }
 
   .ui__icon.ti {
-    @apply relative left-[1px] top-[3px];
+    @apply relative left-[2px] top-[5px];
   }
 }
 

+ 5 - 1
src/main/frontend/components/page.css

@@ -202,7 +202,11 @@ html.is-native-ios {
 }
 
 .references {
-  user-select: none;
+  @apply select-none;
+
+  .ls-page-icon {
+    @apply hidden;
+  }
 }
 
 .no-ring {