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

[next] fix(NcAvatar): extend variable size of status icons #5961

Merged
merged 2 commits into from
Aug 14, 2024
Merged
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
91 changes: 76 additions & 15 deletions src/components/NcAvatar/NcAvatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
### Avatar with material design icon

```
<template>
<template>
<NcAvatar>
<template #icon>
<AccountMultiple :size="20" />
Expand All @@ -34,32 +34,93 @@ export default {
components: {
AccountMultiple,
},
}
</script>
}
</script>
```

### Avatar with preloaded status
```
<template>
<template>
<div class="grid">
<NcAvatar user="janedoe"
display-name="Jane Doe"
:size="44"
:preloaded-user-status="status.online">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:size="44"
:preloaded-user-status="status.away">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:size="44"
:preloaded-user-status="status.dnd">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:size="44"
:preloaded-user-status="status.custom">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:preloaded-user-status="status">
:preloaded-user-status="status.online">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:preloaded-user-status="status.away">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:preloaded-user-status="status.dnd">
</NcAvatar>
<NcAvatar user="janedoe"
display-name="Jane Doe"
:preloaded-user-status="status.custom">
</NcAvatar>
</div>
</template>
<script>

<script>
export default {
data() {
return {
status: {
icon: '',
status: 'dnd',
message: 'Not busy',
online: {
icon: '',
status: 'online',
message: 'Available',
},
away: {
icon: '',
status: 'away',
message: 'Away',
},
dnd: {
icon: '',
status: 'dnd',
message: 'Busy',
},
custom: {
icon: '📆',
status: 'online',
message: 'In a meeting',
}
},
}
},
}
</script>
}
</script>
<style>
.grid {
width: fit-content;
display: grid;
justify-content: center;
align-items: center;
gap: 8px;
grid-template-columns: repeat(4, 1fr);
}
</style>
```

### Avatar for non-users
Expand Down Expand Up @@ -814,14 +875,14 @@ export default {
position: absolute;
right: -4px;
bottom: -4px;
min-height: 18px;
min-width: 18px;
min-height: 14px;
min-width: 14px;
max-height: 18px;
max-width: 18px;
height: 40%;
width: 40%;
line-height: 15px;
font-size: var(--default-font-size);
line-height: 1;
font-size: clamp(var(--font-size-small), 85%, var(--default-font-size));
border: 2px solid var(--color-main-background);
background-color: var(--color-main-background);
background-repeat: no-repeat;
Expand Down
Loading