Skip to content

Commit

Permalink
enhance(mobile): tweak body style
Browse files Browse the repository at this point in the history
  • Loading branch information
leizhe authored and tiensonqin committed Dec 21, 2021
1 parent 969fec3 commit fd7bb2c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
21 changes: 13 additions & 8 deletions src/main/frontend/components/block.cljs
Expand Up @@ -60,7 +60,8 @@
[reitit.frontend.easy :as rfe]
[rum.core :as rum]
[shadow.loader :as loader]
[frontend.components.query-table :as query-table]))
[frontend.components.query-table :as query-table]
[frontend.mobile.util :as mobile-util]))

;; TODO: remove rum/with-context because it'll make reactive queries not working

Expand Down Expand Up @@ -1352,17 +1353,21 @@
(seq children)
(not collapsed?))
(let [doc-mode? (state/sub :document/mode?)]
[:div.block-children {:style {:margin-left (if doc-mode? 18 29)
[:div.block-children {:style {:margin-left (if doc-mode? 18
(if (or (mobile-util/native-android?)
(mobile-util/native-iphone?))
22
29))
:display (if collapsed? "none" "")}}
(for [child children]
(when (map? child)
(let [child (dissoc child :block/meta)
config (cond->
(-> config
(assoc :block/uuid (:block/uuid child))
(dissoc :breadcrumb-show? :embed-parent))
ref?
(assoc :ref-child? true))]
(-> config
(assoc :block/uuid (:block/uuid child))
(dissoc :breadcrumb-show? :embed-parent))
ref?
(assoc :ref-child? true))]
(rum/with-key (block-container config child)
(:block/uuid child)))))]))))

Expand Down Expand Up @@ -1394,7 +1399,7 @@
ref? (:ref? config)
collapsed? (if ref? ref-collapsed? collapsed?)
empty-content? (block-content-empty? block)]
[:div.mr-2.flex.flex-row.items-center
[:div.mr-1.flex.flex-row.items-center.sm:mr-2
{:style {:height 24
:margin-top 0
:float "left"}}
Expand Down
5 changes: 4 additions & 1 deletion src/main/frontend/components/block.css
@@ -1,6 +1,9 @@
.block-content-wrapper {
/* 38px is the width of block-control */
width: calc(100% - 38px);
width: calc(100% - 22px);
@screen sm {
width: calc(100% - 33px);
}
}

.block-content {
Expand Down
6 changes: 5 additions & 1 deletion src/main/frontend/ui.css
Expand Up @@ -138,7 +138,11 @@ html.is-native-iphone

.references .foldable-title {
margin-left: 4px
}
}

.cards-review .block-control {
margin-left: -24px;
}
}

html.is-mobile {
Expand Down

0 comments on commit fd7bb2c

Please sign in to comment.