Class: Irelia::Notification::Component

Inherits:
Component
  • Object
show all
Defined in:
app/components/irelia/notification/component.rb

Instance Method Summary collapse

Methods inherited from Component

#add_css_classes, after_initialize, #html_options, inherited, #initialize, run_after_initialize_hooks

Constructor Details

This class inherits a constructor from Irelia::Component

Instance Method Details

#icon_classObject



7
8
9
10
11
12
13
14
15
16
# File 'app/components/irelia/notification/component.rb', line 7

def icon_class
  icons = {
    notice: "fa fa-info-circle",
    success: "fa fa-check-circle",
    warning: "fa fa-exclamation-triangle",
    alert: "fa fa-exclamation-circle"
  }

  icons[variant]
end

#variantsObject



18
19
20
21
22
23
24
25
26
# File 'app/components/irelia/notification/component.rb', line 18

def variants
  class_names(
    "irelia-notification",
    "irelia-notification--notice": variant == :notice,
    "irelia-notification--success": variant == :success,
    "irelia-notification--warning": variant == :warning,
    "irelia-notification--alert": variant == :alert
  )
end