From 906bd96c1e5b0449099b8161792c9baa2ffc18e4 Mon Sep 17 00:00:00 2001 From: Miguel Ángel Moreno Date: Tue, 4 Jun 2024 14:08:47 +0200 Subject: feat: simplify show more container --- src/frontend/tubo/components/layout.cljs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/frontend/tubo/components/layout.cljs b/src/frontend/tubo/components/layout.cljs index c9fdd70..8121853 100644 --- a/src/frontend/tubo/components/layout.cljs +++ b/src/frontend/tubo/components/layout.cljs @@ -197,15 +197,13 @@ (.unobserve @!resize-observer @!text-container)) :reagent-render (fn [open? text on-open] - [:div.py-3.flex.flex-wrap.min-w-full - [:div {:dangerouslySetInnerHTML {:__html text} - :class (when-not open? "line-clamp-2") - :ref #(reset! !text-container %)}] + [:div.py-3.min-w-full + [:span.text-clip.pr-2 + {:dangerouslySetInnerHTML {:__html text} + :class (when-not open? "line-clamp-2") + :ref #(reset! !text-container %)}] (when (or @text-clamped? open?) - [:div.flex.justify-center.min-w-full.py-4 - [secondary-button - (if (not open?) "Show More" "Show Less") - on-open]])])}))) + [:button.font-bold {:on-click on-open} (str "show " (if open? "less" "more"))])])}))) (defn error [{:keys [failure parse-error status status-text]} cb] [:div.flex.flex-auto.h-full.items-center.justify-center -- cgit v1.2.3