-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat(extension): add midnight pre-launch settings banner LW-10398 #1156
feat(extension): add midnight pre-launch settings banner LW-10398 #1156
Conversation
line-height: 24px; | ||
font-weight: 500; | ||
margin-bottom: 30px; | ||
} |
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.
Please note that i tried to use @lace/ui
typography here instead of defining it all in CSS which turned out to be more trouble than good as this text is not standard (e.g: it looks the same in both themes) and i ran into override issues when trying to change the color via css then.
return ( | ||
<Card.Outlined | ||
className={styles.card} | ||
style={{ '--midnight-pre-launch-banner-image': `url(${bannerImageUrl})` } as React.CSSProperties} |
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.
That was the only way I found to provide a background image via CSS variable to the component (since it didn't work to include the background-image in the compiled core component)
9b7d0cc
to
29283c3
Compare
Allure Report
smokeTests: ✅ test report for 8b83c82e
|
29283c3
to
4e25510
Compare
4e25510
to
711980e
Compare
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 is a small ts warning, but aside than that, this looks great to me!
import styles from './MidnightPreLaunchSettingsBanner.module.scss'; | ||
|
||
export const MidnightPreLaunchSettingsBanner = ({ | ||
bannerImageUrl, |
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.
I have mixed feelings about bannerImageUrl
prop. In my opinion this prop would have more sense if this banner was generic one.
When I look at place where it is used I see this weird looking import import MidnightPreLaunchBannerImage from '../../../../../../../../packages/core/src/ui/assets/images/midnight-launch-event-sidebar-banner.png';
I would recommend removing this prop, or making this component generic like <SettingsBanner />
and place image in apps/browser-extension-wallet directory. The same for storybook.
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.
The more I think about it, the more I like the idea of making this component generic one, especially that it's implementation is in core
package. If we would like to keep this name MidnightPreLaunchSettingsBanner
to me it would make more sense to have it in apps/browser-extension-wallet
as this is not something generic and there is probably 0% chance we would like to reuse it somewhere else.
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.
@pczeglik-iohk I had to introduce the prop because the image must be used as CSS background (so that the rounded corners of the banner are correctly respected) AND unfortunately our core package doesn't correctly bundle css images (the path is simply retained and then wrong when component is imported in the extension) - I can move the image to the extension package but then what should be shown in the core storybook (it also acts as an example)?
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.
I agree with @DominikGuzei I think the issue is on the way we have of working and exporting images from core
which should be addressed. But I think the way it was set up it's consistent with how other components currently do it.
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.
@pczeglik-iohk sure, i can turn this into a generic component BUT it doesn't really make sense since the design is quite special in that it looks the same in light/dark theme (font colors). I'm not sure if it's the best case for a generic component tbh.
|
||
export const MidnightPreLaunchSettingsBanner = ({ | ||
bannerImageUrl, | ||
onMoreDetailsClick |
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.
Can we instead of onMoreDetailsClick
use just onClick
?
In case of button text change we won't need to change prop name to have consistency between what we see in UI and what we have in code.
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.
what about onCtaButtonClick
?
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.
@pczeglik-iohk renamed to onCtaButtonClick
and updated PR
@@ -250,6 +250,9 @@ | |||
"core.infoWallet.addressCopied": "Address copied", | |||
"core.infoWallet.copy": "Copy", | |||
"core.infoWallet.handleCopied": "Handle copied", | |||
"core.MidnightPreLaunchSettingsBanner.heading": "Midnight Pre-Launch Event", |
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.
If we decide to go with generic component translations should be in apps/browser-extension-wallet?
I would recommend creating dedicated namespace for all midnight related translations like browserView.midnight
or just midnight
.
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.
@pczeglik-iohk it's not a generic component, the only reason why we develop new components in core because we haven't been able to set up storybook correctly in the extension app package 😆 if you look around you will see plenty of non-generic components in core package. Only @lace/ui
is truly generic.
In both cases i followed the existing naming scheme for translations in the app and core package. I'm not sure if introducing a dedicated namespace will make things clearer now.
btw. the way we handle translations will be changed dramatically anyway (moved into a dedicated package): #1154
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.
Looks good @DominikGuzei, a few changes proposed.
Let me know what do you think :)
711980e
to
c6bc842
Compare
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.
Not 100% happy, but I totally understand your arguments @DominikGuzei
Code approved! Thank you @DominikGuzei
c6bc842
to
d0d7d92
Compare
d0d7d92
to
8db3c89
Compare
8db3c89
to
8b83c82
Compare
Quality Gate passedIssues Measures |
Checklist
Proposed solution
Please note: the CTA buttons do not have any action defined yet (as per task requirement) and will be wired-up in later tasks.
USE_MIDNIGHT_PRELAUNCH_EVENT
feature flag to hide the midnight related UI elements behind@lace/core
storybookTesting
Screenshots
video of the responsive banner sidebar banner (please note that at time of recording the settings list item was not yet activated for extended view but is in latest version):
Bildschirmaufnahme.2024-05-13.um.14.51.12.mov