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

fix(avatar)!: make size property as abstract #2414

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions elements/pf-avatar/BaseAvatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class AvatarLoadEvent extends Event {
* @summary For displaying a user's avatar image
*/

export class BaseAvatar extends LitElement {
export abstract class BaseAvatar extends LitElement {
static readonly styles = [style];

/** The URL to the user's custom avatar image. */
Expand All @@ -26,15 +26,15 @@ export class BaseAvatar extends LitElement {
@property({ reflect: true }) alt?: string = 'Avatar image';

/** Size of the Avatar */
@property({ reflect: true }) size: 'sm'|'md'|'lg'|'xl' = 'sm';
abstract size?: string;
anujsingla marked this conversation as resolved.
Show resolved Hide resolved

/** Whether or not the Avatar image is dark */
@property({ type: Boolean, reflect: true }) dark = false;

render() {
return this.src != null ? html`
<img
size=${this.size}
size=${this.size ?? ''}
alt=${this.alt ?? ''}
@load="${(e: Event) => this.dispatchEvent(new AvatarLoadEvent(e))}"
src=${this.src}>
Expand Down