Skip to content

Commit

Permalink
Add icons for keychange and expiration timer in-conversation items
Browse files Browse the repository at this point in the history
The shield matches the Android app's key change notification, and the
clock icon was easy to do and makes it easier to visually distinguish
those items in the conversation history.

FREEBIE
  • Loading branch information
scottnonnenberg committed Aug 4, 2017
1 parent c714fb6 commit 11372b4
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 35 deletions.
4 changes: 2 additions & 2 deletions background.html
Expand Up @@ -192,7 +192,7 @@ <h3>{{ welcomeToSignal }}</h3>
<span href='#' class='retry'>{{ resend }}</span>
</script>
<script type='text/x-tmpl-mustache' id='keychange'>
<span class='content' dir='auto'>{{ content }}</span>
<span class='content' dir='auto'><span class='shield icon'></span> {{ content }}</span>
</script>
<script type='text/x-tmpl-mustache' id='verified-change'>
<span class='content' dir='auto'><span class='{{ icon }} icon'></span> {{ content }}</span>
Expand All @@ -216,7 +216,7 @@ <h3>{{ welcomeToSignal }}</h3>
<span class='hourglass'><span class='sand'></span></span>
</script>
<script type='text/x-tmpl-mustache' id='expirationTimerUpdate'>
<span class='content'>{{ content }}</span>
<span class='content'><span class='icon clock'></span> {{ content }}</span>
</script>
<script type='text/x-tmpl-mustache' id='new-group-update'>
<div class='conversation-header'>
Expand Down
2 changes: 1 addition & 1 deletion js/views/message_view.js
Expand Up @@ -76,7 +76,7 @@

Whisper.KeyChangeView = Whisper.View.extend({
tagName: 'li',
className: 'keychange',
className: 'keychange advisory',
templateName: 'keychange',
id: function() {
return this.model.id;
Expand Down
33 changes: 18 additions & 15 deletions stylesheets/_conversation.scss
Expand Up @@ -662,33 +662,36 @@ li.entry .error-icon-container {
}
}
}
.message-list li.keychange {
.advisory .icon {
height: 1.25em;
width: 1.25em;
vertical-align: text-bottom;
display: inline-block;

&.verified {
@include color-svg('/images/verified-check.svg', $grey_d);
}
&.shield {
@include color-svg('/images/shield.svg', $grey_d);
}
&.clock {
@include color-svg('/images/clock.svg', $grey_d);
}
}

.keychange {
text-align: center;
.content {
cursor: pointer;
display: inline-block;
padding: 5px 10px;
background: #fff5c4;
color: $grey_d;
border-radius: $border-radius;
}
}

.verified-change {
text-align: center;
.icon {
height: 1.25em;
width: 1.25em;
vertical-align: text-bottom;
display: inline-block;

&.verified {
@include color-svg('/images/verified-check.svg', $grey_d);
}
&.shield {
@include color-svg('/images/shield.svg', $grey_d);
}
}

.content {
cursor: pointer;
Expand Down
3 changes: 3 additions & 0 deletions stylesheets/android-dark.scss
Expand Up @@ -93,6 +93,9 @@ $text-dark_l2: darken($text-dark, 30%);
.verified {
@include color-svg('/images/verified-check.svg', $text-dark);
}
.clock {
@include color-svg('/images/clock.svg', $text-dark);
}
}

.inactive .conversation-header {
Expand Down
40 changes: 24 additions & 16 deletions stylesheets/manifest.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion test/index.html
Expand Up @@ -187,7 +187,7 @@ <h3>{{ welcomeToSignal }}</h3>
<span href='#' class='retry'>{{ resend }}</span>
</script>
<script type='text/x-tmpl-mustache' id='keychange'>
<span class='content' dir='auto'>{{ content }}</span>
<span class='content' dir='auto'><span class='shield icon'></span> {{ content }}</span>
</script>
<script type='text/x-tmpl-mustache' id='verified-change'>
<span class='content' dir='auto'><span class='{{ icon }} icon'></span> {{ content }}</span>
Expand All @@ -206,6 +206,12 @@ <h3>{{ welcomeToSignal }}</h3>
</div>
</div>
</script>
<script type='text/x-tmpl-mustache' id='hourglass'>
<span class='hourglass'><span class='sand'></span></span>
</script>
<script type='text/x-tmpl-mustache' id='expirationTimerUpdate'>
<span class='content'><span class='icon clock'></span> {{ content }}</span>
</script>
<script type='text/x-tmpl-mustache' id='new-group-update'>
<div class='conversation-header'>
<button class='back'></button>
Expand Down

0 comments on commit 11372b4

Please sign in to comment.