Sha256: 637be461ede8d0166146cb9521394afe4278ddf7fd54285d59dbeae563e0535c

Contents?: true

Size: 624 Bytes

Versions: 2

Compression:

Stored size: 624 Bytes

Contents

# frozen_string_literal: true

require "staticky/phlex/view_helpers"

class ApplicationComponent < Protos::Component
  include ViteHelpers

  class NullViewContext
    def root? = true
    def current_path = "/"
  end

  def helpers
    @_view_context ||= NullViewContext.new # rubocop:disable Naming/MemoizedInstanceVariableName
  end

  def asset_path(...)
    vite_asset_path(...)
  end

  def image_tag(path, alt:, **)
    img(src: asset_path(path), alt:, **)
  end

  def icon(...)
    render Icon.new(...)
  end

  def inline_link(text, url)
    render Protos::Typography::InlineLink.new(href: url) { text }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
staticky-0.3.1 site_template/app/views/application_component.rb
staticky-0.3.0 site_template/app/views/application_component.rb