-
Notifications
You must be signed in to change notification settings - Fork 377
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
[FluentPersona] Hide name functionality #1706
Conversation
…oes not render <div class="name> when true. - Added functionality of only displaying <div class="name> if the `HideName` property is false and either the `Name` property is not null or whitespace, or the `ChildContent` property is not null. - Added `@attributes="@AdditionalAttributes"` to `FluentPersona.razor` <div> tag - Added example to `PersonPage.razor` - Added unit tests
…oes not render <div class="name> when true. - Added functionality of only displaying <div class="name> if the `HideName` property is false and either the `Name` property is not null or whitespace, or the `ChildContent` property is not null. - Added `@attributes="@AdditionalAttributes"` to `FluentPersona.razor` <div> tag - Added example to `PersonPage.razor` - Added unit tests
…fluentui-blazor into fluentpersona-hidename
@microsoft-github-policy-service agree |
Thank you for your excellent work. Two comments:
|
No problem, happy to contribute. To answer your comments:
|
Yes, I understand the purpose of this property, but it seems unnecessary when it is possible to allow the I've just extracted only the In combination with <FluentPersona Name="Lydia Bauer"
ImageSize="50px"
Status="PresenceStatus.Busy"
StatusSize="PresenceBadgeSize.Small">
</FluentPersona>
<FluentPersona Initials="LB" ImageSize="50px" />
<FluentPersona ImageSize="50px" /> |
Yeah I understand you can do it by modifying the |
I don't think that's a good thing. Yes, it's probably simpler in your case, but then we could add |
So, I'm assuming this PR canbe closed then as the gist of it is now part of #1710? |
You're totally right! Closing it now. |
Thank you, and don't hesitate to suggest new features / PR. You've done a great job. |
Pull Request
📖 Description
Changes involve the addition of a new feature that allows only the initials of a person to be rendered. This is achieved through the introduction of a new
HideName
property in theFluentPersona
class. Additionally, theFluentPersona.razor
file has been updated to accommodate this new feature, as well as not rendering<div class="name">
when bothChildContent
andName
properties are null. Changes also include additional attributes to be passed to thediv
element in order for events to work (e.g.@onmouseover
).🎫 Issues
FluentPersona
component renders<div class="name">
even if bothName
andChildContent
properties are empty.Which results in the element taking additional empty space within the container.
This can cause problems when using
FluentPersona
component as a button or when trying to align it with other elements.Additionally
FluentPersona
component does not have the ability to use events like@onmouseover
.👩💻 Reviewer Notes
PersonaPage.razor
file. This section describes a new feature where only the initials of a person are shown when theHideName
property is set to true or when theName
andChildContent
properties are not set.The
div
tag in theFluentPersona.razor
file has been updated to include@attributes="@AdditionalAttributes"
. This allows for additional attributes to be passed to thediv
element.The
name
div in theFluentPersona.razor
file has been updated to only display if theHideName
property is false and either theName
property is not null or whitespace, or theChildContent
property is not null.A new property
HideName
has been added to theFluentPersona
class in theFluentPersona.razor.cs
file. This property is a boolean that determines whether the name should be displayed or not.📑 Test Plan
FluentPersonaTests
has been updated to accommodate these new changes.✅ Checklist
General
Component-specific