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

Avatar colored background code example #306

Open
szuperaz opened this issue Jun 10, 2022 · 0 comments
Open

Avatar colored background code example #306

szuperaz opened this issue Jun 10, 2022 · 0 comments
Labels
enhancement New feature or request theming-v2

Comments

@szuperaz
Copy link
Contributor

Add this to sample app, and create a code example guide:

Avatar: If possible, add a random color for the avatar’s bg. You can find 16 accessible colors here.

Implementation idea: create a custom avatar that users the default avatar component but sets background color dynamically

<ng-template
  #avatarTemplate
  let-name="name"
  let-imageUrl="imageUrl"
  let-size="size"
  let-user="user"
  let-channel="channel"
>
  <stream-avatar
    style="--str-chat__avatar-background-color: customColor"
    [name]="name"
    [imageUrl]="imageUrl"
    [size]="size"
    [user]="user"
    [channel]="channel"
  ></stream-avatar>
</ng-template>
@szuperaz szuperaz added enhancement New feature or request theming-v2 labels Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request theming-v2
Projects
None yet
Development

No branches or pull requests

1 participant