Skip to content

Comments

Migrate the typography components to align with Phlex conversions#168

Merged
stephannv merged 2 commits intoruby-ui:mainfrom
karinevieira:refactor/migrate_typography_components
Feb 19, 2025
Merged

Migrate the typography components to align with Phlex conversions#168
stephannv merged 2 commits intoruby-ui:mainfrom
karinevieira:refactor/migrate_typography_components

Conversation

@karinevieira
Copy link
Contributor

Phlex 2.0 follows a specific folder structure and naming convention for views and components.
For views, they should be placed in the app/views directory under the Views namespace, and must inherit from Views::Base.

# frozen_string_literal: true
class Views::Articles::Index < Views::Base
  def view_template
    h1 { "Articles" }
  end
end

For components, they should be placed in the app/components directory under the Components namespace, and must inherit from Components::Base.

class Components::Button < Components::Base
  def view_template
    button { "Click me" }
  end
end

This pull request continues the migration of the components that are currently in the app/views/components folder to app/components, in accordance with the Phlex conventions.

PS: I took the opportunity to remove unused files.

@stephannv stephannv merged commit 635d9c4 into ruby-ui:main Feb 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants