Skip to content

Commit

Permalink
feat: add avatar slot to feed-item-row (#1267)
Browse files Browse the repository at this point in the history
* feat: add avatar slot to feed-item-row

* $attrs

* Update recipes/conversation_view/feed_item_row/feed_item_row_default.story.vue

Co-authored-by: Julio Ortega <julio.ortega@dialpad.com>

---------

Co-authored-by: Julio Ortega <julio.ortega@dialpad.com>
  • Loading branch information
braddialpad and juliodialpad authored Oct 20, 2023
1 parent 6a67cae commit 1cc8b71
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ export const argTypesData = {
},
},

avatar: {
control: 'text',
table: {
type: {
summary: 'VNode',
},
},
},

threading: {
name: 'threading',
control: 'text',
Expand Down
15 changes: 10 additions & 5 deletions recipes/conversation_view/feed_item_row/feed_item_row.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,17 @@
>
<!-- Avatar or time -->
<template #left>
<dt-avatar
<!-- @slot Slot to contain the avatar, overrides avatar props. -->
<slot
v-if="showHeader"
:full-name="displayName"
:image-src="avatarImageUrl"
:seed="avatarSeed"
/>
name="avatar"
>
<dt-avatar
:full-name="displayName"
:image-src="avatarImageUrl"
:seed="avatarSeed"
/>
</slot>
<!-- show time instead of avatar when headers not present -->
<div
v-if="!showHeader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
<template v-if="$attrs.default">
<span v-html="$attrs.default" />
</template>
<template
v-if="$attrs.avatar"
#avatar
>
<span
v-html="$attrs.avatar"
/>
</template>
<template
v-if="$attrs.threading"
#threading
Expand Down

0 comments on commit 1cc8b71

Please sign in to comment.