Skip to content

Commit

Permalink
feat: use formatted quantities in channel and playlist pages
Browse files Browse the repository at this point in the history
  • Loading branch information
migalmoreno committed Dec 1, 2024
1 parent d6e3a4a commit 29dbb7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions src/frontend/tubo/channel/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
[re-frame.core :as rf]
[tubo.bookmarks.modals :as modals]
[tubo.items.views :as items]
[tubo.layout.views :as layout]))
[tubo.layout.views :as layout]
[tubo.utils :as utils]))

(defn metadata-popover
[_]
Expand All @@ -30,9 +31,9 @@
[:div.m-4
[:h1.text-2xl.line-clamp-1.font-semibold {:title name} name]
(when subscriber-count
[:div.flex.my-2.items-center
[:i.fa-solid.fa-users.text-xs]
[:span.mx-2 (.toLocaleString subscriber-count)]])]]
[:div.flex.items-center.text-neutral-600.dark:text-neutral-400.text-sm
[:span
(str (utils/format-quantity subscriber-count) " subscribers")]])]]
[:div.hidden.lg:block
[metadata-popover channel]]])

Expand Down
8 changes: 5 additions & 3 deletions src/frontend/tubo/playlist/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
(rf/dispatch [:playlist/fetch-paginated url next-page-url]))
[layout/content-container
[:div.flex.flex-col.justify-center
[layout/content-header name
[layout/content-header
[:div.flex.flex-col.gap-y-2.mb-2 name
[:span.text-sm.whitespace-nowrap.text-neutral-600.dark:text-neutral-400
(str stream-count " streams")]]
[:div.hidden.lg:block
[metadata-popover playlist]]]
[:div.flex.items-center.justify-between.my-4.gap-x-4
Expand All @@ -45,7 +48,6 @@
[:a.line-clamp-1.ml-2
{:href (rfe/href :channel-page nil {:url uploader-url})
:title uploader-name}
uploader-name]]
[:span.text-sm.whitespace-nowrap (str stream-count " streams")]]]
uploader-name]]]]
[items/layout-switcher !layout]
[items/related-streams related-streams next-page-url !layout]]))))

0 comments on commit 29dbb7e

Please sign in to comment.