-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Avatar Component #40
Add Avatar Component #40
Conversation
args: { | ||
size: 'default', | ||
src: 'foobar.jpg', | ||
fallback: 'https://placehold.co/40', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me, I might try to do a follow-up that uses content projection just to see how that works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disadvantage of the current approach (variables) vs. child-components is of course that it's not possible to use anything other than image URLs.
Spartan's approach of doubled components with child directives was the only alternative I was able to find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is possible via contentChild
in an app-avatar
component and then having app-avatar-image
and app-avatar-fallback
as children 🤔
|
||
render: (args) => ({ | ||
props: args, | ||
template: `<app-avatar ${argsToTemplate(args)}></app-avatar>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can also define the template shared for all stories somehow if it is the same for all.
Generally looks good :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Add an avatar component with Storybook page.
Fixes #30
Key Changes / Features
NgOptimizedImage
to optimize performanceFurther Resources
Checklist
General
Client (if applicable)
Screenshots