diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 22:47:25 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2024-12-01 22:47:25 +0100 |
commit | 29dbb7e4f8a4749d012d35b6b1dea8734a7e1f47 (patch) | |
tree | 2c0df3ee8bfc41cbd06c8eea41ade40a4f56dc08 | |
parent | d6e3a4a09b968b5cba85d76b24f336ee1de68a1f (diff) |
feat: use formatted quantities in channel and playlist pages
-rw-r--r-- | src/frontend/tubo/channel/views.cljs | 9 | ||||
-rw-r--r-- | src/frontend/tubo/playlist/views.cljs | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/frontend/tubo/channel/views.cljs b/src/frontend/tubo/channel/views.cljs index 71c58cd..1b5da62 100644 --- a/src/frontend/tubo/channel/views.cljs +++ b/src/frontend/tubo/channel/views.cljs @@ -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 [_] @@ -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]]]) diff --git a/src/frontend/tubo/playlist/views.cljs b/src/frontend/tubo/playlist/views.cljs index 78174d6..0541f6b 100644 --- a/src/frontend/tubo/playlist/views.cljs +++ b/src/frontend/tubo/playlist/views.cljs @@ -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 @@ -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]])))) |