Shared: CampaignsBanner: UseFitText: fix

The text didn't minimize when closing previous banner
This commit is contained in:
Viktor Fomin 2024-04-05 05:27:41 +03:00
parent c7910717d4
commit 8887dc9303

View File

@ -43,7 +43,8 @@ const useFitText = (
!!ref.current && ref.current.scrollHeight > ref.current.offsetHeight;
if (isOverflow) {
setFontSize((prevFontSize) => prevFontSize - 1);
const newFontSize = fontSize - 1;
setFontSize(newFontSize);
}
}, [currentFontSize, fontSize, ref?.current?.scrollHeight]);