Sha256: 85f2990218a3c836fa1a008fda0e4dedb2fcdf67879695aab38fbaf210cac7e3

Contents?: true

Size: 741 Bytes

Versions: 39

Compression:

Stored size: 741 Bytes

Contents

module ToastHelper
  def toast_notice(text)
    toast_for('success', 'check-circle', text)
  end

  def toast_alert(text)
    toast_for('error', 'times-circle', text)
  end

  def toast_info(text)
    toast_for('info', 'info-circle', text)
  end

  private

  def toast_for(type, icon, text)
    "<div class='toast mu-toast-#{type}' role='alert'>
       <div class='toast-body'>
         <div class='d-flex align-items-center'>
           #{fa_icon icon, class: 'fa-lg me-3'}
           <span class='flex-grow-1 text-break'>#{text}</span>
           <button type='button' class='btn-close btn-close-white mx-2 flex-shrink-0' data-bs-dismiss='toast' aria-label='Close'></button>
         </div>
       </div>
     </div>".html_safe
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mumuki-laboratory-9.23.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.22.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.21.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.20.1 app/helpers/toast_helper.rb
mumuki-laboratory-9.20.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.19.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.18.1 app/helpers/toast_helper.rb
mumuki-laboratory-9.18.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.17.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.16.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.15.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.14.1 app/helpers/toast_helper.rb
mumuki-laboratory-9.14.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.13.2 app/helpers/toast_helper.rb
mumuki-laboratory-9.13.1 app/helpers/toast_helper.rb
mumuki-laboratory-9.13.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.12.1 app/helpers/toast_helper.rb
mumuki-laboratory-9.12.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.11.0 app/helpers/toast_helper.rb
mumuki-laboratory-9.10.0 app/helpers/toast_helper.rb