Skip to content

Commit

Permalink
DRY up emoji image urls in application helper (#6186)
Browse files Browse the repository at this point in the history
* DRY up emoji image urls

* Correct indentation error

* Change [] to () (codeclimate issue)
  • Loading branch information
seabl authored and jywarren committed Jan 4, 2020
1 parent 552bf76 commit 591f59a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ def emoji_names_list
end

def emoji_info
emoji_names = ["thumbs-up", "thumbs-down", "laugh", "hooray", "confused", "heart"]
emoji_names = %w(thumbs-up thumbs-down laugh hooray confused heart)
prefix = "https://github.githubassets.com/images/icons/emoji/unicode/"
emoji_image_map = {
"thumbs-up" => "https://github.githubassets.com/images/icons/emoji/unicode/1f44d.png",
"thumbs-down" => "https://github.githubassets.com/images/icons/emoji/unicode/1f44e.png",
"laugh" => "https://github.githubassets.com/images/icons/emoji/unicode/1f604.png",
"hooray" => "https://github.githubassets.com/images/icons/emoji/unicode/1f389.png",
"confused" => "https://github.githubassets.com/images/icons/emoji/unicode/1f615.png",
"heart" => "https://github.githubassets.com/images/icons/emoji/unicode/2764.png"
"thumbs-up" => "#{prefix}1f44d.png",
"thumbs-down" => "#{prefix}1f44e.png",
"laugh" => "#{prefix}1f604.png",
"hooray" => "#{prefix}1f389.png",
"confused" => "#{prefix}1f615.png",
"heart" => "#{prefix}2764.png"
}
[emoji_names, emoji_image_map]
end
Expand Down

0 comments on commit 591f59a

Please sign in to comment.