Browse Source

fix: frontend code shouldn't require mobile ns

Tienson Qin 1 week ago
parent
commit
3952e5f1aa

+ 5 - 3
src/main/frontend/components/quick_add.cljs

@@ -11,7 +11,6 @@
             [logseq.db :as ldb]
             [logseq.shui.hooks :as hooks]
             [logseq.shui.ui :as shui]
-            [mobile.components.ui :as mobile-ui]
             [rum.core :as rum]))
 
 (rum/defc page-blocks
@@ -58,8 +57,11 @@
            "Quick add"]
           (when mobile? add-button)]
          (if mobile?
-           (mobile-ui/classic-app-container-wrap
-            (page-blocks add-page))
+           [:main#app-container-wrapper.ls-fold-button-on-right
+            [:div#app-container.pt-2
+             [:div#main-container.flex.flex-1
+              [:div.w-full
+               (page-blocks add-page)]]]]
            [:div.content {:class "block -ml-6"}
             (page-blocks add-page)])
          (when-not mobile? add-button)]))))

+ 1 - 2
src/main/frontend/handler/events/ui.cljs

@@ -40,7 +40,6 @@
             [goog.dom :as gdom]
             [logseq.common.util :as common-util]
             [logseq.shui.ui :as shui]
-            [mobile.state :as mobile-state]
             [promesa.core :as p]))
 
 (defmethod events/handle :go/search [_]
@@ -91,7 +90,7 @@
 (defmethod events/handle :redirect-to-home [_]
   (page-handler/create-today-journal!)
   (when (util/capacitor?)
-    (mobile-state/set-tab! "home")))
+    (state/pub-event! [:mobile/set-tab "home"])))
 
 (defmethod events/handle :page/show-delete-dialog [[_ selected-rows ok-handler]]
   (shui/dialog-open!