2022-08-27 11:52:29 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
module Pajamas
|
|
|
|
class AvatarComponentPreview < ViewComponent::Preview
|
|
|
|
# Avatar
|
|
|
|
# ----
|
|
|
|
# See its design reference [here](https://design.gitlab.com/components/avatar).
|
|
|
|
def default
|
|
|
|
user
|
|
|
|
end
|
|
|
|
|
|
|
|
# We show user avatars in a circle.
|
2023-01-13 00:05:48 +05:30
|
|
|
# @param size select {{ Pajamas::AvatarComponent::SIZE_OPTIONS }}
|
2022-08-27 11:52:29 +05:30
|
|
|
def user(size: 64)
|
|
|
|
render(Pajamas::AvatarComponent.new(User.first, size: size))
|
|
|
|
end
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
# @param size select {{ Pajamas::AvatarComponent::SIZE_OPTIONS }}
|
2022-08-27 11:52:29 +05:30
|
|
|
def project(size: 64)
|
|
|
|
render(Pajamas::AvatarComponent.new(Project.first, size: size))
|
|
|
|
end
|
|
|
|
|
2023-01-13 00:05:48 +05:30
|
|
|
# @param size select {{ Pajamas::AvatarComponent::SIZE_OPTIONS }}
|
2022-08-27 11:52:29 +05:30
|
|
|
def group(size: 64)
|
|
|
|
render(Pajamas::AvatarComponent.new(Group.first, size: size))
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|