Skip to content

Commit 4f73b3c

Browse files
committed
added indication that a given notification is read or not (full inbox page)
1 parent b3ca34f commit 4f73b3c

3 files changed

Lines changed: 27 additions & 6 deletions

File tree

app/assets/stylesheets/_variables.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ $key: #335;
1111
$muted-text: #666;
1212
$muted-graphic: #DDD;
1313
$primary: #4B68FF;
14+
$primary-graphic: #2980b9;
1415
$secondary: #EA7317;
1516
$warning: #FDD835;
1617
$danger: #EB5959;
1718
$success: #2ECC71;
1819
$info: #58A09A;
1920
$brand: #4B68FF;
2021

22+
2123
$data: (
2224
#4B68FF,
2325
#A23B72,
@@ -31,6 +33,7 @@ $data: (
3133
--muted-text: #{$muted-text};
3234
--muted-graphic: #{$muted-graphic};
3335
--primary: #{$primary};
36+
--primary-graphic: #{$primary-graphic};
3437
--secondary: #{$secondary};
3538
--warning: #{$warning};
3639
--danger: #{$danger};

app/assets/stylesheets/notifications.scss

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,33 @@
77

88
.notification {
99
border-top: 1px solid $muted-graphic;
10+
display: grid;
11+
gap: 0.75em;
12+
grid-template-columns: max-content auto;
13+
align-items: center;
1014
padding: 0.5em;
1115

1216
@media screen and (min-width: $screen-md) {
1317
flex-direction: row;
1418
}
1519

16-
& > * {
17-
margin: 0 0.2em;
18-
}
19-
2020
&:last-of-type {
2121
border-bottom: 1px solid $muted-graphic;
2222
}
2323

24+
.notification-icon {
25+
color: $primary-graphic;
26+
}
27+
28+
.notification-content {
29+
display: flex;
30+
flex-direction: column;
31+
32+
.form-caption {
33+
margin: 0;
34+
}
35+
}
36+
2437
.notification--timestamp {
2538
line-break: strict;
2639
}

app/views/notifications/index.html.erb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424

2525
<% @notifications.each do |notif| %>
2626
<div class="notification">
27-
<div class="form-caption"><%= CGI.unescape_html(notif.created_at.strftime('%b&nbsp;%-d,&nbsp;%Y&nbsp;at&nbsp;%H:%M')).html_safe %></div>
28-
<a href="<%= notif.link %>"><%= render_pings_text(notif.content) %></a>
27+
<i class="notification-icon fas <%= notif.read? ? 'fa-envelope' : 'fa-envelope-open' %>"></i>
28+
<div class="notification-content">
29+
<div class="form-caption">
30+
<%= CGI.unescape_html(notif.created_at.strftime('%b&nbsp;%-d,&nbsp;%Y&nbsp;at&nbsp;%H:%M')).html_safe %>
31+
</div>
32+
<a href="<%= notif.link %>"><%= render_pings_text(notif.content) %></a>
33+
</div>
2934
</div>
3035
<% end %>
3136

0 commit comments

Comments
 (0)