Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e2a577de
authored
Mar 08, 2025
by
Netfan
Committed by
GitHub
Mar 08, 2025
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat: add size prop to avatar component and update logo component for size handling (#5684)
1 parent
89d963c8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue
packages/@core/ui-kit/shadcn-ui/src/components/logo/logo.vue
packages/@core/ui-kit/shadcn-ui/src/components/avatar/avatar.vue
View file @
e2a577d
...
...
@@ -16,6 +16,7 @@ interface Props extends AvatarFallbackProps, AvatarImageProps, AvatarRootProps {
class
?:
ClassType
;
dot
?:
boolean
;
dotClass
?:
ClassType
;
size
?:
number
;
}
defineOptions
({
...
...
@@ -32,10 +33,23 @@ const props = withDefaults(defineProps<Props>(), {
const
text
=
computed
(()
=>
{
return
props
.
alt
.
slice
(
-
2
).
toUpperCase
();
});
const
rootStyle
=
computed
(()
=>
{
return
props
.
size
!==
undefined
&&
props
.
size
>
0
?
{
height
:
`
${
props
.
size
}
px`
,
width
:
`
${
props
.
size
}
px`
,
}
:
{};
});
</
script
>
<
template
>
<div
:class=
"props.class"
class=
"relative flex flex-shrink-0 items-center"
>
<div
:class=
"props.class"
:style=
"rootStyle"
class=
"relative flex flex-shrink-0 items-center"
>
<Avatar
:class=
"props.class"
class=
"size-full"
>
<AvatarImage
:alt=
"alt"
:src=
"src"
/>
<AvatarFallback>
{{
text
}}
</AvatarFallback>
...
...
packages/@core/ui-kit/shadcn-ui/src/components/logo/logo.vue
View file @
e2a577d
...
...
@@ -52,7 +52,8 @@ withDefaults(defineProps<Props>(), {
v-if=
"src"
:alt=
"text"
:src=
"src"
class=
"relative w-8 rounded-none bg-transparent"
:size=
"logoSize"
class=
"relative rounded-none bg-transparent"
/>
<span
v-if=
"!collapsed"
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment