Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Avatar to RBUI #105

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/phlex_ui/avatar.rb → lib/rbui/avatar/avatar.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module PhlexUI
module RBUI
class Avatar < Base
SIZES = {
xs: "h-4 w-4 text-[0.5rem]",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module PhlexUI
module RBUI
class AvatarFallback < Base
def view_template(&)
span(**attrs, &)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module PhlexUI
module RBUI
class AvatarImage < Base
def initialize(src:, alt: "", **attrs)
@src = src
Expand Down
6 changes: 3 additions & 3 deletions test/phlex_ui/hover_card_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def test_render_with_all_items
end
PhlexUI.HoverCardContent do |card_content|
card_content.div(class: "flex justify-between space-x-4") do
PhlexUI.Avatar do
PhlexUI.AvatarImage(src: "https://avatars.githubusercontent.com/u/246692?v=4", alt: "joeldrapper")
PhlexUI.AvatarFallback { "JD" }
RBUI.Avatar do
RBUI.AvatarImage(src: "https://avatars.githubusercontent.com/u/246692?v=4", alt: "joeldrapper")
RBUI.AvatarFallback { "JD" }
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions test/phlex_ui/avatar_test.rb → test/rbui/avatar_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class PhlexUI::AvatarTest < Minitest::Test

def test_render_with_all_items
output = phlex_context do
PhlexUI.Avatar do
PhlexUI.AvatarImage(src: "https://avatars.githubusercontent.com/u/246692?v=4", alt: "joeldrapper")
PhlexUI.AvatarFallback { "JD" }
RBUI.Avatar do
RBUI.AvatarImage(src: "https://avatars.githubusercontent.com/u/246692?v=4", alt: "joeldrapper")
RBUI.AvatarFallback { "JD" }
end
end

Expand Down