Browse Source

fix: block align

Tienson Qin 7 months ago
parent
commit
0a65f7d6a9

+ 6 - 6
src/main/capacitor/components/app.cljs

@@ -1,15 +1,17 @@
 (ns capacitor.components.app
   (:require ["../externals.js"]
             ["@capacitor/app" :refer [App]]
-            [capacitor.nav :as nav]
             [capacitor.components.settings :as settings]
             [capacitor.components.ui :as ui]
             [capacitor.ionic :as ion]
+            [capacitor.nav :as nav]
             [capacitor.state :as state]
             [clojure.string :as string]
             [frontend.components.journal :as journal]
             [frontend.date :as date]
+            [frontend.db :as db]
             [frontend.db.conn :as db-conn]
+            [frontend.handler.page :as page-handler]
             [frontend.handler.repo :as repo-handler]
             [frontend.mobile.util :as mobile-util]
             [frontend.rum :as frum]
@@ -20,9 +22,7 @@
             [logseq.shui.popup.core :as shui-popup]
             [logseq.shui.toaster.core :as shui-toaster]
             [promesa.core :as p]
-            [rum.core :as rum]
-            [frontend.db :as db]
-            [frontend.handler.page :as page-handler]))
+            [rum.core :as rum]))
 
 (rum/defc app-graphs-select
   []
@@ -92,11 +92,11 @@
                           1000))}
       (ion/refresher-content))
 
-     [:div.pt-4.px-4
+     [:div.pt-4
       [:main#app-container-wrapper.ls-fold-button-on-right
        [:div#app-container
         [:div#main-container.flex.flex-1
-         [:div#main-content-container.w-full
+         [:div#main-content-container.w-full.!px-0
           (journal/all-journals)]]]]])))
 
 (rum/defc home < rum/reactive

+ 4 - 0
src/main/capacitor/components/app.css

@@ -76,6 +76,10 @@ ion-textarea {
   box-shadow: none;
 }
 
+.page {
+  @apply px-3;
+}
+
 :root {
     --ls-page-title-size: 26px;
     --ion-color-primary: #000000;

+ 4 - 1
src/main/frontend/components/block.cljs

@@ -3627,7 +3627,10 @@
      (when-not (:hide-title? config)
        [:div.block-main-container.flex.flex-row.gap-1
         {:style (when (and db-based? (:page-title? config))
-                  {:margin-left (if page-icon -36 -30)})
+                  {:margin-left (cond
+                                  (util/mobile?) 0
+                                  page-icon -36
+                                  :else -30)})
          :data-has-heading (some-> block (pu/lookup :logseq.property/heading))
          :on-mouse-enter (fn [e]
                            (block-mouse-over e block *control-show? block-id doc-mode?))

+ 4 - 4
src/main/frontend/components/page.cljs

@@ -186,7 +186,7 @@
       :tab-index 0}
      [:div.flex.flex-row
       [:div.flex.items-center {:style {:height 28
-                                       :margin-left 22}}
+                                       :margin-left (if (util/mobile?) 0 22)}}
        [:span.bullet-container.cursor.opacity-0.transition-opacity.ease-in.duration-100 {:ref *bullet-ref}
         [:span.bullet]]]]]))
 
@@ -478,7 +478,7 @@
                          (state/get-current-repo)
                          (:db/id page)
                          :page)
-                        (util/capacitor-new?)
+                        (util/mobile?)
                         (route-handler/redirect-to-page! (:block/uuid page))
                         :else
                         nil))))}
@@ -487,7 +487,7 @@
       (component-block/block-container
        {:page-title? true
         :page-title-actions-cp (when (and with-actions?
-                                          (not (util/capacitor-new?))
+                                          (not (util/mobile?))
                                           (not= (:db/id (state/get-edit-block)) (:db/id page)))
                                  db-page-title-actions)
         :hide-title? sidebar?
@@ -703,7 +703,7 @@
 
             (when (or (not show-tabs?) tabs-rendered?)
               [:div.ls-page-blocks
-               {:style {:margin-left (if whiteboard? 0 -20)}}
+               {:style {:margin-left (if (or whiteboard? (util/mobile?)) 0 -20)}}
                (page-blocks-cp page (merge option {:sidebar? sidebar?
                                                    :container-id (:container-id state)
                                                    :whiteboard? whiteboard?}))])])

+ 1 - 0
tailwind.capacitor.css

@@ -19,5 +19,6 @@
 @import "src/main/frontend/components/datepicker.css";
 @import "src/main/frontend/components/views.css";
 @import "src/main/frontend/components/block/views.css";
+@import "src/main/frontend/components/journal.css";
 
 @import-glob "src/main/capacitor/**/[!_]*.css";