Skip to content

Commit

Permalink
Update pin icon
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jan 25, 2024
1 parent af6e879 commit aa6c177
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion models/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@ public function isPinned($userId = null): bool

public function getPinIcon($userId = null): ?Icon
{
return $this->isPinned($userId) ? Icon::get('thumb-tack') : null;
if ($this->isPinned($userId)) {
return Icon::get('map-pin')
->tooltip(Yii::t('MailModule.base', 'Pinned'))
->color(Yii::$app->view->theme->variable('danger', 'red'));
}

return null;
}
}
4 changes: 2 additions & 2 deletions widgets/PinLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function run()
if ($this->message->isPinned()) {
return Link::none(Yii::t('MailModule.base', 'Unpin'))
->action('mail.conversation.linkAction', Url::toUnpinConversation($this->message))
->icon('thumb-tack');
->icon('map-pin');
}

return Link::none(Yii::t('MailModule.base', 'Pin'))
->action('mail.conversation.linkAction', Url::toPinConversation($this->message))
->icon('thumb-tack');
->icon('map-pin');
}
}

0 comments on commit aa6c177

Please sign in to comment.