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
Update notification dropdown styling #2167
Conversation
{InvoiceEvent.ExpiredPaidPartial, "expired with partial payments"}, | ||
{InvoiceEvent.FailedToConfirm, "has payments that failed to confirm on time"}, | ||
// {InvoiceEvent.ReceivedPayment, "received a payment"}, | ||
{InvoiceEvent.Confirmed, "has been paid"} |
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.
Update this to match the wording in the mock-up.
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 revert. This makes the notification unclear whether the invoice was paid and settled or just paid and unconfirmed.
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.
Cool, will do.
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.
@@ -6685,6 +6685,9 @@ button.bg-dark:focus { | |||
.font-weight-normal { | |||
font-weight: 400 !important; } | |||
|
|||
.font-weight-semibold { |
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.
Added this here because the mock-up specified semibold weights but we didn't have a utility class for it like we have for other font weights.
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.
Noted as a thing to add/update with our Bootstrap 5 migration (#1866).
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.
Cool, thanks!
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.
Just a few notes. I don't want to delay this as it looks good from a code perspective, but we should note this PR to be revisited with/after the Bootstrap 5 migration (#1866).
I feel we will encounter things like this in a few places from now on until the migration is done. Will schedule the migration for when we are done with the wallet setup refactoring.
<style> | ||
.notification-dropdown { | ||
border: 0; | ||
border-radius: 4px; | ||
box-shadow: 0px 2px 16px rgba(0, 0, 0, 0.08); | ||
padding: 0; | ||
} | ||
|
||
@@media (min-width: 992px) { | ||
.notification-dropdown { | ||
width: 420px; | ||
} | ||
} | ||
|
||
.notification:hover { | ||
background-color: var(--btcpay-body-bg); | ||
} | ||
</style> | ||
|
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 think we should move this to the site.css – this way it can be cached and it might not be as easy to overlook there.
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.
@dennisreimann updated here: 2e5b1b4
@if (Model.UnseenCount > 0) | ||
{ | ||
<li class="nav-item dropdown" id="notifications-nav-item"> | ||
<a class="nav-link js-scroll-trigger" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" id="Notifications"> | ||
<a class="nav-link js-scroll-trigger" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" id="Notifications" style="border-bottom: 0;"> |
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.
<a class="nav-link js-scroll-trigger" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" id="Notifications" style="border-bottom: 0;"> | |
<a class="nav-link js-scroll-trigger border-bottom-0" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" id="Notifications"> |
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.
@dennisreimann updated here: 53fa520
<div class="dropdown-menu dropdown-menu-right text-center notification-items" aria-labelledby="navbarDropdown"> | ||
<div class="dropdown-menu dropdown-menu-right text-center notification-dropdown" aria-labelledby="navbarDropdown"> | ||
<div class="d-flex align-items-center justify-content-between py-3 px-4 border-bottom border-light"> | ||
<div role="heading" aria-level="3" class="font-weight-semibold" style="font-size: 20px;">Notifications</div> |
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 think we should use a heading here – even if it doesn't closely match the mockup with size and weight. My point would be that we should be consistent with the tools we have available currently (Bootstrap 4.5) and do the cleanup/extension in one go. This isn't ideal either, but I fear we will miss things if we are using inline styles and one-off solutions like this one, without marking them for the upcoming UI refactoring.
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.
Ok, I will use a heading.
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.
@dennisreimann updated here: 090c9fc
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M14.2 16H1.8C0.808 16 0 15.192 0 14.2V1.8C0 0.808 0.808 0 1.8 0H14.2C15.192 0 16 0.808 16 1.8V14.2C16 15.192 15.192 16 14.2 16ZM1.8 1.2C1.4688 1.2 1.2 1.4696 1.2 1.8V14.2C1.2 14.5304 1.4688 14.8 1.8 14.8H14.2C14.5312 14.8 14.8 14.5304 14.8 14.2V1.8C14.8 1.4696 14.5312 1.2 14.2 1.2H1.8Z" fill="#8D8D8F"/> | ||
<path d="M12.0004 5.31182H4.00039C3.66919 5.31182 3.40039 5.04222 3.40039 4.71182C3.40039 4.38142 3.66919 4.11182 4.00039 4.11182H12.0004C12.3316 4.11182 12.6004 4.37982 12.6004 4.71182C12.6004 5.04382 12.3316 5.31182 12.0004 5.31182ZM12.0004 8.59982H4.00039C3.66919 8.59982 3.40039 8.33102 3.40039 7.99982C3.40039 7.66862 3.66919 7.39982 4.00039 7.39982H12.0004C12.3316 7.39982 12.6004 7.66862 12.6004 7.99982C12.6004 8.33102 12.3316 8.59982 12.0004 8.59982ZM8.00039 11.8878H4.00039C3.66919 11.8878 3.40039 11.6198 3.40039 11.2878C3.40039 10.9558 3.66919 10.6878 4.00039 10.6878H8.00039C8.33159 10.6878 8.60039 10.9574 8.60039 11.2878C8.60039 11.6182 8.33159 11.8878 8.00039 11.8878Z" fill="#8D8D8F"/> | ||
</svg> |
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.
In the wallet setup UI refactoring I've introduced a SVG icon sprite for our custom icons. We can add this there once the other PR is merged.
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.
We should still move this to a separate svg file in this PR to avoid rendering bigger HTML markup since this is a list
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.
@dennisreimann ok, I will update this once the other PR is merged. Could you link it here?
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's #2164, but it'll likely take some time to get merged. Let's not wait for this, because it would postpone this otherwise ready PR.
Instead, you can add the icon sprite file with the desired icons here too. There's also the Icon
view component to use the icons in that sprite.
You can also give me access to your fork and I can add all of that to this PR :)
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.
@dennisreimann alright, added the sprite in e6a3f1e.
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.
Agree with @dennisreimann's points but my main concern is the text change for one of the notifications, which should be reverted.
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M14.2 16H1.8C0.808 16 0 15.192 0 14.2V1.8C0 0.808 0.808 0 1.8 0H14.2C15.192 0 16 0.808 16 1.8V14.2C16 15.192 15.192 16 14.2 16ZM1.8 1.2C1.4688 1.2 1.2 1.4696 1.2 1.8V14.2C1.2 14.5304 1.4688 14.8 1.8 14.8H14.2C14.5312 14.8 14.8 14.5304 14.8 14.2V1.8C14.8 1.4696 14.5312 1.2 14.2 1.2H1.8Z" fill="#8D8D8F"/> | ||
<path d="M12.0004 5.31182H4.00039C3.66919 5.31182 3.40039 5.04222 3.40039 4.71182C3.40039 4.38142 3.66919 4.11182 4.00039 4.11182H12.0004C12.3316 4.11182 12.6004 4.37982 12.6004 4.71182C12.6004 5.04382 12.3316 5.31182 12.0004 5.31182ZM12.0004 8.59982H4.00039C3.66919 8.59982 3.40039 8.33102 3.40039 7.99982C3.40039 7.66862 3.66919 7.39982 4.00039 7.39982H12.0004C12.3316 7.39982 12.6004 7.66862 12.6004 7.99982C12.6004 8.33102 12.3316 8.59982 12.0004 8.59982ZM8.00039 11.8878H4.00039C3.66919 11.8878 3.40039 11.6198 3.40039 11.2878C3.40039 10.9558 3.66919 10.6878 4.00039 10.6878H8.00039C8.33159 10.6878 8.60039 10.9574 8.60039 11.2878C8.60039 11.6182 8.33159 11.8878 8.00039 11.8878Z" fill="#8D8D8F"/> | ||
</svg> |
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.
We should still move this to a separate svg file in this PR to avoid rendering bigger HTML markup since this is a list
{InvoiceEvent.ExpiredPaidPartial, "expired with partial payments"}, | ||
{InvoiceEvent.FailedToConfirm, "has payments that failed to confirm on time"}, | ||
// {InvoiceEvent.ReceivedPayment, "received a payment"}, | ||
{InvoiceEvent.Confirmed, "has been paid"} |
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 revert. This makes the notification unclear whether the invoice was paid and settled or just paid and unconfirmed.
<div class="text-left" style="width: 200px; white-space:normal;"> | ||
@notif.Body | ||
<a asp-action="NotificationPassThrough" asp-controller="Notifications" asp-route-id="@notif.Id" class="notification d-flex align-items-center dropdown-item border-bottom border-light py-3 px-4"> | ||
<div class="d-flex mr-3" style="width: 16px; height: 16px; color: #8D8D8F;"> |
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.
Had to add the inline styles for width and height to make sure the icon appears in the right size since the sprite itself has height and width of zero. I wonder if there should be a built-in way to allow specifying the width and height and fill color? Something like <vc:icon symbol="note" width="16px" height="16px" color="#8D8D8F" />
. Or is this not desirable?
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 are some icon default styles.
Can we get around using a fixed color here? Because it'll most likely interfere with the different themes. If that color isn't present in the current set of variables, let's use the closest one for now.
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.
@dennisreimann ok, thanks for pointing out the default styles. I will add those in. I initially had the color fixed but changed it to not be fixed as other icons in your PR didn't have them.
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.
@dennisreimann alright, added default styles here which solves the issue nicely. I did notice something weird though. When I updated the color in the icon-sprite.svg
my app was refusing to show the new color even after I restarted BTCPay. I had to run dotnet clean
and then build from fresh for the change to be reflected. Looked like the SVG was cached and was not updating.
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.
For the color we should stick to using currentColor in the SVG as this allows to set it via CSS. We will need this to work with the different themes.
I also came across caching issues, which I brought up in this comment. I'll try to find a workaround, because this will likely take some time to get fixed.
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.
@dennisreimann alright, updated here: ebdd42e.
I noticed that the cache seems to be cleared if you modify the Default.cshtml
under Components/Icon
.
@@ -23,7 +23,7 @@ | |||
@foreach (var notif in Model.Last5) | |||
{ | |||
<a asp-action="NotificationPassThrough" asp-controller="Notifications" asp-route-id="@notif.Id" class="notification d-flex align-items-center dropdown-item border-bottom border-light py-3 px-4"> | |||
<div class="mr-3"> | |||
<div class="mr-3" style="color: #8D8D8F;"> |
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.
We should not go with a fixed color here but use one of the variables to be compatible with the themes. Also I'd rather have this in the site.css that an inline style, because that way it won't get overlooked easily.
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.
@dennisreimann alright, updated here: 4d143d3
Nice! I got two minor things I'd propose, because imho …
@media (min-width: 992px) {
.notification-dropdown {
width: 420px;
top: 64px;
right: -32px;
}
} See proposed screenshots … CurrentProposed |
Otherwise, looks fantastic, great work @bolatovumar @dennisreimann! |
@dennisreimann adjusted the dropdown positioning here: 5b04ccc Here is what H5 heading looks like vs the H4 one: H4 is closer in size to what the mock-up has (mock-up has 20px and H4 is 21px). H5 is 18px. I can update it to be H5 but I picked H4 initially because it was closer in size to what the mock had. |
sexy as fuck, let's add this for next release this week. |
@bolatovumar Seeing them both in context, let's roll with H5 (18px), it looks better. My 2 sats. Oh, and what do hover states on the notification row look like currently? Only thing I think that's remaining. |
Updated H4 to H5 here: bcce5e3 Hover state looks like this (see second item): |
This styling update brings the notification dropdown styling closer to where it is in the mock-up (https://www.figma.com/file/C7Xyq0FlxgFW8vaBr8ht1z/BTCPAY?node-id=1290%3A379). It's not exactly the same though. Some things that are different:
Before:
After: