application_helper.rb 404 Bytes
Newer Older
Eugen Rochko's avatar
Eugen Rochko committed
1 2
# frozen_string_literal: true

Eugen Rochko's avatar
Eugen Rochko committed
3
module ApplicationHelper
Eugen Rochko's avatar
Eugen Rochko committed
4 5 6 7 8 9 10
  def twitter?
    user_signed_in? && !current_user.twitter.nil?
  end

  def mastodon?
    user_signed_in? && !current_user.mastodon.nil?
  end
Yamagishi Kazutoshi's avatar
Yamagishi Kazutoshi committed
11 12 13 14 15 16

  def fa_icon(name, **options)
    classes  = (options.delete(:class) || '').split(/\s+/)
    classes += ['fa', "fa-#{name}"]
    content_tag(:i, nil, options.merge(class: classes.join(' ')))
  end
Eugen Rochko's avatar
Eugen Rochko committed
17
end