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.4.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.test4 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.test3 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.test2 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.alpha4 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.alpha2 app/helpers/playbook/application_helper.rb
playbook_ui-7.4.0.pre.alpha1 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha12 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha11 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha10 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha9 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha8 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha7 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha6 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha5 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha4 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha3 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha2 app/helpers/playbook/application_helper.rb
playbook_ui-7.3.0.pre.alpha1 app/helpers/playbook/application_helper.rb