Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/enhance/main-container'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bad3r committed Aug 4, 2023
2 parents 1c068a2 + baa774c commit 9a2e078
Show file tree
Hide file tree
Showing 21 changed files with 35,033 additions and 308 deletions.
5 changes: 0 additions & 5 deletions src/main/frontend/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ i.ti {

/* region FIXME: override elements (?) */
h1.title {
margin-bottom: 1.5rem;
color: var(--ls-title-text-color, #222);
font-size: var(--ls-page-title-size, 36px);
font-weight: 500;
Expand Down Expand Up @@ -888,10 +887,6 @@ html[data-theme='dark'] .keyboard-shortcut > code {
}

html.is-mobile {
h1.title {
margin-bottom: 10px;
}

#journals .journal-item:first-child {
margin-top: 5px;
}
Expand Down
22 changes: 12 additions & 10 deletions src/main/frontend/components/container.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
(if whiteboard-page?
(route-handler/redirect-to-whiteboard! name)
(route-handler/redirect-to-page! name {:click-from-recent? recent?})))))}
[:span.page-icon.ml-3 (if whiteboard-page? (ui/icon "whiteboard" {:extension? true}) icon)]
[:span.page-icon.ml-3.justify-center (if whiteboard-page? (ui/icon "whiteboard" {:extension? true}) icon)]
[:span.page-title {:class (when untitiled? "opacity-50")}
(if untitiled? (t :untitled)
(pdf-utils/fix-local-asset-pagename original-name))]]))
Expand Down Expand Up @@ -139,25 +139,26 @@
[t]
(let [favorites (->> (:favorites (state/sub-config))
(remove string/blank?)
(filter string?))]
(filter string?))
favorite-entities (->> favorites
(mapv #(db/entity [:block/name (util/safe-page-name-sanity-lc %)]))
(remove nil?))]
(nav-content-item
[:a.flex.items-center.text-sm.font-medium.rounded-md.wrap-th
(ui/icon "star" {:size 16})
[:span.flex-1.ml-2 (string/upper-case (t :left-side-bar/nav-favorites))]]

{:class "favorites"
:count (count favorites)
:count (count favorite-entities)
:edit-fn
(fn [e]
(rfe/push-state :page {:name "Favorites"})
(util/stop e))}
(when (seq favorites)
(when (seq favorite-entities)
[:ul.favorites.text-sm
(for [name favorites]
(when-not (string/blank? name)
(when-let [entity (db/entity [:block/name (util/safe-page-name-sanity-lc name)])]
(let [icon (get-page-icon entity)]
(favorite-item t name icon)))))]))))
(for [entity favorite-entities]
(let [icon (get-page-icon entity)]
(favorite-item t (:block/name entity) icon)))]))))

(rum/defc recent-pages < rum/reactive db-mixins/query
[t]
Expand Down Expand Up @@ -356,7 +357,8 @@
:active (and (not srs-open?)
(= route-name :page)
(= page (get-in route-match [:path-params :name])))
:icon "home"})
:icon "home"
:shortcut :go/home})
(sidebar-item
{:class "journals-nav"
:active (and (not srs-open?)
Expand Down
13 changes: 11 additions & 2 deletions src/main/frontend/components/container.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

#main-content-container {
@apply p-4 sm:px-8;
@apply p-4 sm:px-8 sm:py-10;

font-size: 1em;
}
Expand Down Expand Up @@ -183,6 +183,14 @@
.nav-content-item {
@apply overflow-hidden;

&:not(:hover) {
::-webkit-scrollbar-thumb,
::-webkit-scrollbar,
::-webkit-scrollbar-thumb:active {
background-color: transparent;
}
}

.nav-content-item-inner {
@apply flex flex-col h-full overflow-hidden;
}
Expand Down Expand Up @@ -497,7 +505,8 @@ html[data-theme='dark'] {
}

.cp__sidebar-main-content {
width: 100%;
@apply w-full h-fit;

max-width: var(--ls-main-content-max-width);
flex: 1;
}
Expand Down
Loading

0 comments on commit 9a2e078

Please sign in to comment.