-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: update UserHub transactions to have correct styles for 720-768px screen #3446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes transactions with long error messages:
![Screenshot 2024-10-24 at 09 47 29](https://private-user-images.githubusercontent.com/34915414/379691327-760178dc-4a6c-4940-a99a-6a6a77f5edd7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8zNDkxNTQxNC8zNzk2OTEzMjctNzYwMTc4ZGMtNGE2Yy00OTQwLWE5OWEtNmE2YTc3ZjVlZGQ3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThiOWRlYzIzMjk1NzRlMmYxZTFlNzI4ZDczNDgwYzcyYmI4NjA4YTczNDZjM2Y2MzNjMTVmNzA3NzRlMDQwOWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.q7rZdU0DFxErZ4uweNSmd9WYJBaZKgVO3h6leNNl0tQ)
But short ones are aligned centre:
![Screenshot 2024-10-24 at 09 46 32](https://private-user-images.githubusercontent.com/34915414/379691404-7ab2876f-69a1-4b82-8d29-792d52f4101d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8zNDkxNTQxNC8zNzk2OTE0MDQtN2FiMjg3NmYtNjlhMS00YjgyLThkMjktNzkyZDUyZjQxMDFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMyOTcxNDA3NTQ0YzZmZTJhYjEzMzJlMjgzYzQ4Mjk3MTIwMDIxOTY0ODczNmFhYzliZDA5MGVjNjlkZTUxMGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.k64f_r40gsQPyZ_d97EWIs0SVyeChKI5mxibV54UQ9k)
And it breaks notification banners in a bunch of places unfortunately:
![Screenshot 2024-10-24 at 09 44 09](https://private-user-images.githubusercontent.com/34915414/379691542-b0d63646-8a44-4ae5-b267-2ffc953a085e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8zNDkxNTQxNC8zNzk2OTE1NDItYjBkNjM2NDYtOGE0NC00YWU1LWIyNjctMmZmYzk1M2EwODVlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3YjA1NTYzMDEyODY2NDdiMDk5NDYxZGIyZDcyZmViMTQwMTM3YzNlMjljN2JmNzBjZWIzYzgxMGFhYmJjNDAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.mOLOJqItYNgqbk6flIlx1jBGyPnVmLu78LOV3145JDk)
![Screenshot 2024-10-24 at 09 47 45](https://private-user-images.githubusercontent.com/34915414/379691597-49c9337a-ee97-407c-bcfd-18a1ea9e34d0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8zNDkxNTQxNC8zNzk2OTE1OTctNDljOTMzN2EtZWU5Ny00MDdjLWJjZmQtMThhMWVhOWUzNGQwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwOGU2MGY5ZGQwMTE3NTM1MTkxMWEwYjlmN2ZhNTExMzgyMTU0MjdhZjEyYzc0MzdmYWM5YzkzODNmMzBhYTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SaVgcX66eGmoM4IQ1c1BTLf66yMdMtS4AWvnsQgNHNo)
The notification banner is used in a bunch of different places so you'll have to be careful with the changes here:
![Screenshot 2024-10-24 at 09 37 31](https://private-user-images.githubusercontent.com/34915414/379691943-c4efcce1-3628-46cc-966a-c07fbcf9204f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8zNDkxNTQxNC8zNzk2OTE5NDMtYzRlZmNjZTEtMzYyOC00NmNjLTk2NmEtYzA3ZmJjZjkyMDRmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTZhOWM5YzY5YTc0NTVkNGNmNjlmMDM3NzgyMTFlODNlNzk5NzQ0YjQ4MGRmNGMyNWE1MjMzNjQyNzc5OTgxZjgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ovUuC-w3VxZO38qkk4DMGBY9j_71mfLpuFZW6Xt_S_k)
I found the original PR where this change was made #1381 so the reasoning for it is a bit clearer.
@@ -40,7 +40,7 @@ const NotificationBanner: FC<NotificationBannerProps> = ({ | |||
})} | |||
/> | |||
) : null} | |||
<div className="flex flex-1 flex-col items-start gap-2 @[600px]/notificationBanner:flex-row @[600px]/notificationBanner:items-center"> | |||
<div className="flex flex-1 flex-col items-start gap-2 @[600px]/notificationBanner:items-center"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a humble suggestion @Nortsova -- to save you the hassle since this seemingly affects other areas where we use this NotificationBanner component, maybe you can add a prop for this component and adjust these styles specifically for the GroupedTransactionContent, which contains this problematic NotificationBanner version
And because we know your style changes are definitely fixing the issue, we can try:
<div
className={clsx(
'flex flex-1 flex-col items-start gap-2 @[600px]/notificationBanner:flex-row @[600px]/notificationBanner:items-center',
contentClassName,
)}
>
Then in GroupedTransactionContent:
<NotificationBanner
...existingProps
contentClassName="@[600px]/notificationBanner:flex-col" // <<-- Add me 😄
>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then later down the line, maybe we can start thinking about whether it's worth refactoring component entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @rumzledz , I decided to go with this approach. 🙌
After some investigation, I realized that this issue arises because:
- There's a rule for a container width of 600px (only for 720-768px does the container width become larger).
- In UserHub, we have a
callToAction
prop containing two buttons that attempt to fill the full width.
An alternative solution I considered is to remove the callToAction
from the component entirely.
And instead of this:
<NotificationBanner
...existingProps
callToAction={<Buttons />}
>
Do something like:
<NotificationBanner
...existingProps
>
{....content}
<Buttons>
</NotificationBanner>
but this case requires me to fix a lot of styles.
0515e38
to
bf13baa
Compare
bf13baa
to
3e17b4b
Compare
Thank you, @iamsamgibbs and @rumzledz, for reviewing! It’s crucial to update this component without impacting other areas where it’s used. 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested and all good on my side @Nortsova ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
For 720-768px error message was broken:
![image](https://private-user-images.githubusercontent.com/15706494/379434993-657cb0b8-4b35-46f2-839e-3b4d18bbb5eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTYxNjEsIm5iZiI6MTczOTI1NTg2MSwicGF0aCI6Ii8xNTcwNjQ5NC8zNzk0MzQ5OTMtNjU3Y2IwYjgtNGIzNS00NmYyLTgzOWUtM2I0ZDE4YmJiNWViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2Mzc0MVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM3NGEzMWZmMTRlOWNkYmIyNGQ3Yzk1NzQ1YTRhOTk1YzgzMDdhYmQ1ODFmYzE1MzJmNDQ3MGEyZDQ3ZDVhNTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BlVGoxmbIG1wEiacHDqiQGfifOMxGKbfBjjrXsO3Nbs)
I really hope that my fix will not break anything else, but all I tested now works 😄
Testing
Resolves #3056