Ver Fonte

Merge branch 'master' of github.com:logseq/logseq-internal into master

Tienson Qin há 5 anos atrás
pai
commit
01682c6275

+ 9 - 17
src/main/frontend/components/diff.cljs

@@ -53,22 +53,14 @@
   [repo type path contents remote-oid component]
   (let [{:keys [collapse? resolved?]} (util/react (rum/cursor diff-state path))
         edit? (util/react *edit?)]
-    [:div.mb-3 {:style {:border "1px solid #ddd"
-                        :border-radius 3}}
-     [:div.flex.flex-row.items-center.justify-between.bg-base-2
-      {:style {:padding "5px 10px"
-               :border-bottom "1px solid #e1e4e8"
-               :border-top-left-radius 3
-               :border-top-right-radius 3}}
-      [:div.flex.flex-row.items-center
-       [:a.mr-2 {:on-click (fn [] (toggle-collapse? path))}
-        (if collapse?
-          (svg/arrow-right)
-          (svg/arrow-down))]
-       [:span
-        path
-        [:span.text-sm.font-medium.ml-2.border.rounded.px-1
-         type]]]
+    [:div.cp__diff-file
+     [:div.cp__diff-file-header
+      [:a.mr-2 {:on-click (fn [] (toggle-collapse? path))}
+       (if collapse?
+         (svg/arrow-right)
+         (svg/arrow-down))]
+      [:span.cp__diff-file-header-content path]
+      [:span.cp__diff-file-header-type type]
       (when resolved?
         [:span.text-green-600
          {:dangerouslySetInnerHTML
@@ -82,7 +74,7 @@
                            (or added removed))
                          diff)]
          [:div.pre-line-white-space.p-2 {:class (if collapse? "hidden")
-                                         :style {:overflow "hidden"}}
+                                         :style {:overflow "auto"}}
           (if edit?
             [:div.grid.grid-cols-2.gap-1
              (diff-cp diff)

+ 22 - 0
src/main/frontend/components/diff.css

@@ -0,0 +1,22 @@
+.cp__diff-file {
+    @apply mb-3;
+    border: 1px solid #ddd;
+    border-radius: 3px;
+}
+
+.cp__diff-file-header {
+    background-color: var(--ls-secondary-background-color);
+    padding: 5px 10px;
+    border-bottom: 1px solid #e1e4e8;
+    border-radius: 3px 3px 0 0;
+    display: flex;
+    align-items: center;
+}
+
+.cp__diff-file-header-content {
+    @apply truncate
+}
+
+.cp__diff-file-header-type {
+    @apply text-sm font-medium ml-2 border rounded px-1;
+}

+ 7 - 15
src/main/frontend/components/sidebar.cljs

@@ -417,21 +417,13 @@
                                          (if white? "#f0f8ff" "#073642"))}}
              (when (state/sub :ui/left-sidebar-open?)
                (sidebar-nav route-match nil))])
-          [:div.flex.#main-content-container.justify-center
-           {:class (if global-graph-pages?
-                     "initial"
-                     (util/hiccup->class ".mx-6.my-12"))
-            :style {:position "relative"
-                    :flex "1 1 65%"
-                    :width "100vw"}}
-           [:div.flex-1
-            {:style (cond->
-                     {:max-width 640}
-                      (or global-graph-pages?
-                          (and (not logged?)
-                               home?)
-                          (contains? #{:all-files :all-pages} route-name))
-                      (dissoc :max-width))}
+          [:div#main-content-container.cp__sidebar-main-content-container
+           [:div.cp__sidebar-main-content
+            {:data-is-global-graph-pages global-graph-pages?
+             :data-is-full-width (or global-graph-pages?
+                                  (and (not logged?)
+                                       home?)
+                                  (contains? #{:all-files :all-pages} route-name))}
             (cond
               (not indexeddb-support?)
               nil

+ 24 - 0
src/main/frontend/components/sidebar.css

@@ -0,0 +1,24 @@
+.cp__sidebar-main-content-container {
+    position: relative;
+    flex: 1 1 65%;
+}
+
+.cp__sidebar-main-content {
+    padding: 3rem 1.5rem;
+    margin: 0 auto;
+    max-width: 640px;
+}
+
+@media (max-width: 640px) {
+    .cp__sidebar-main-content {
+        max-width: 100vw;
+    }
+}
+
+.cp__sidebar-main-content[data-is-full-width="true"] {
+    max-width: 100vw;
+}
+
+.cp__sidebar-main-content[data-is-global-graph-pages="true"] {
+    padding: 0;
+}