Module: Playbook::ApplicationHelper

Includes:
Webpacker::Helper, Webpacker::React::Helpers
Defined in:
app/helpers/playbook/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_webpacker_instanceObject



13
14
15
# File 'app/helpers/playbook/application_helper.rb', line 13

def current_webpacker_instance
  Playbook.webpacker
end

#dark_modeObject



17
18
19
20
21
22
23
# File 'app/helpers/playbook/application_helper.rb', line 17

def dark_mode
  if cookies[:dark_mode] == "true"
    true
  else
    false
  end
end

#dark_mode_props(props) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'app/helpers/playbook/application_helper.rb', line 25

def dark_mode_props(props)
  if cookies[:dark_mode] == "true"
    props.merge(dark: dark_mode)
  elsif cookies[:dark_mode] == "false"
    props.merge(dark: dark_mode)
  else
    props
  end
end