-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Review groups overflowing jira template link (#684)
* fix(session details): fix overflowing review groups in jira integration link * chore(version): update to version 1.36.4
- Loading branch information
Showing
3 changed files
with
64 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
(ns webapp.components.tooltip | ||
(:require ["@radix-ui/themes" :refer [Tooltip]] | ||
[reagent.core :as r])) | ||
|
||
(defn truncate-tooltip [{:keys [text]}] | ||
(let [text-ref (r/atom nil) | ||
is-truncated? (r/atom false)] | ||
(r/create-class | ||
{:component-did-mount | ||
(fn [] | ||
(when-let [element @text-ref] | ||
(reset! is-truncated? (> (.-scrollWidth element) (.-clientWidth element))))) | ||
|
||
:component-did-update | ||
(fn [this [_ old-props] [_ new-props]] | ||
(when (not= (:text old-props) (:text new-props)) | ||
(when-let [element @text-ref] | ||
(reset! is-truncated? (> (.-scrollWidth element) (.-clientWidth element)))))) | ||
|
||
:reagent-render | ||
(fn [{:keys [text]}] | ||
(if @is-truncated? | ||
[:> Tooltip {:content text} | ||
[:span {:ref #(reset! text-ref %) | ||
:class "inline-block truncate w-full"} | ||
text]] | ||
[:span {:ref #(reset! text-ref %) | ||
:class "inline-block truncate w-full"} | ||
text]))}))) |