Sha256: 783d8807486825919bf38c95121a8a90b82e50742c7458c3a8d02c2b5bb2bb66

Contents?: true

Size: 715 Bytes

Versions: 65

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

require "webpacker"
require "webpacker/react/railtie" if defined?(Rails)
require "webpacker/react/helpers"
require "webpacker/react/component"

module Playbook
  module ApplicationHelper
    include ::Webpacker::Helper
    include ::Webpacker::React::Helpers

    def current_webpacker_instance
      Playbook.webpacker
    end

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

    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

  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
playbook_ui-7.10.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.9.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.8.4 app/helpers/playbook/application_helper.rb
playbook_ui-7.8.3 app/helpers/playbook/application_helper.rb
playbook_ui-7.8.2 app/helpers/playbook/application_helper.rb
playbook_ui-7.8.1 app/helpers/playbook/application_helper.rb
playbook_ui-7.8.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.7.0.pre.alpha1 app/helpers/playbook/application_helper.rb
playbook_ui-7.7.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.6.2.pre.alpha1 app/helpers/playbook/application_helper.rb
playbook_ui-7.6.2 app/helpers/playbook/application_helper.rb
playbook_ui-7.6.1.pre.alpha1 app/helpers/playbook/application_helper.rb
playbook_ui-7.6.1 app/helpers/playbook/application_helper.rb
playbook_ui-7.6.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.5.1 app/helpers/playbook/application_helper.rb
playbook_ui-7.5.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.2 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.1 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.alpha6 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.alpha5 app/helpers/playbook/application_helper.rb