-
-
Notifications
You must be signed in to change notification settings - Fork 359
Avatar Issue #3627
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
base: main
Are you sure you want to change the base?
Avatar Issue #3627
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
@moulichan99 great job.
First off, make sure to complete the PR original post in full. It needs the original issue ID, a brief description, and the checkboxes ticked please. You will also need to include a Changeset as this modifies component code. Instructions are provided above.
Minus these small adjustments detailed below, the only other thing missing is documentation to show users how to implement and utilize this new feature. This will need to be present for both React and Svelte docs.
https://www.skeleton.dev/docs/components/avatar/react
https://www.skeleton.dev/docs/components/avatar/svelte
I'd recommend a new section above "Fallback" like so:
## Initials
Provide an `initials` array to define what part of the name is used to generate initials. Use index values to identify each desired name, and `-1` to represent the last possible name.
(example)
Per the example, feel free remove the initials
showcase in the Fallback example and description. Then showcase 2-3 avatars with mixed usage in this new example block, including:
- Default value (no prop defined) - moved from Fallback
- All initials for a three word name, ex:
[0, 1, 2]
- Two initials from a three word name,
[0, -1]
As per the name, something like "Jane Michelle Doe" will work.
@moulichan99 just checking if you can address the feedback items above. If so an ETA would be welcome. |
addressing it today. |
@endigo9740 Pushed the review comment changes can you pls check ? |
Linked Issue
Closes #{https://github.com/skeletonlabs/skeleton/issues/3613#issuecomment-3151324428}
Description
Prevent more then 2 avatar initials by adjusting the getInitials function to output max 2 chars.
Reasoning:
The name prop is also used in the img's alt property.
So we want the alt to show the full name but want to prevent more then 2 letters in each avatar.
Checklist
Please read and apply all contribution requirements.
docs/
,feature/
,chore/
,bugfix/
main
branchpnpm check
in the root of the monorepopnpm format
in the root of the monorepopnpm lint
in the root of the monorepopnpm test
in the root of the monorepo/package
projects, please supply a ChangesetChangesets
View our documentation to learn more about Changesets. To create a Changeset:
pnpm changeset
and follow the prompts