hot fix for dinamic size of font for buttonBox component (#337)
## Dynamic Font Size for ButtonBox Component ### Description The ButtonBox component, which is used in the examples modal, has been enhanced to have a dynamic font size that adjusts based on the length of the text and the dimensions of its parent element. This improvement ensures that the text within the ButtonBox component remains readable and properly fits within its container. ### Changes Made - Added a new `fontSize` state variable to track the font size within the ButtonBox component. - Utilized the `useEffect` hook to calculate and update the font size dynamically. - Implemented logic to check for both vertical and horizontal overflow of the text within the parent container. - Decreased the font size incrementally until the text fits within the parent element's dimensions. - Updated the component to apply the calculated font size to the text element. ### Testing Done - Manually tested the ButtonBox component with various text lengths and parent container dimensions. - Verified that the font size was adjusted correctly to fit the text within the parent element without overflowing.
A
anovazzi1 committed
0c45186fcba69b31183f6d50e6412c258bd32ba9
Committed by GitHub <noreply@github.com>
on 5/24/2023, 4:41:20 AM