Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonfurtado2000 committed Jan 14, 2025
1 parent 8144e56 commit cef330c
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions react/features/notifications/components/web/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,18 @@ const Notification = ({
return iconToDisplay;
}, [ icon, appearance ]);


const renderNotificationTitle = useCallback(() => {
const notificationTitle = String(title || t(titleKey ?? '', titleArguments));
const titleWords = notificationTitle.split(' ');
const [ isTruncatedWordList, setIsTruncatedWordList ] =
useState<boolean[]>(Array(titleWords.length).fill(false));
const spanRefs = useRef<(HTMLSpanElement | null)[]>([]);
const [isTruncatedWordList, setIsTruncatedWordList] = useState<boolean[]>(

Check failure on line 327 in react/features/notifications/components/web/Notification.tsx

View workflow job for this annotation

GitHub Actions / Lint

A space is required after '['

Check failure on line 327 in react/features/notifications/components/web/Notification.tsx

View workflow job for this annotation

GitHub Actions / Lint

A space is required after '['

Check failure on line 327 in react/features/notifications/components/web/Notification.tsx

View workflow job for this annotation

GitHub Actions / Lint

A space is required before ']'

Check failure on line 327 in react/features/notifications/components/web/Notification.tsx

View workflow job for this annotation

GitHub Actions / Lint

A space is required before ']'
Array(titleWords.length).fill(false)
);
const spanRefs = useRef<HTMLSpanElement[] | null[]>([]);

const assignRef = (index: number) => (spanElement: HTMLSpanElement | null) => {
spanRefs.current[index] = spanElement;
};

useEffect(() => {
if (textContainerRef.current) {
Expand All @@ -351,18 +357,14 @@ const Notification = ({
<Tooltip content = { word }>
<span
className = { classes.title }
ref = { function (spanElement) {
spanRefs.current[index] = spanElement
}}>
ref = { assignRef(index) }>
{t(word)}
</span>
</Tooltip>
) : (
<span
className = { classes.title }
ref = { function (spanElement) {
spanRefs.current[index] = spanElement
}}>
ref = { assignRef(index) }>
{t(word)}
</span>
)}
Expand Down

0 comments on commit cef330c

Please sign in to comment.