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

Add examples and documentation for the Persona component. #843

Merged
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ο»Ώ<FluentPersona Name="Kevin Sturgis"
Status="PresenceStatus.Available"
StatusSize="PresenceBadgeSize.Small"
StatusTitle="He is available"
Image="https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/office-ui-fabric-react-assets/persona-male.png"
GillesTourreau marked this conversation as resolved.
Show resolved Hide resolved
ImageSize="50px">
</FluentPersona>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
ο»Ώ<div hidden="@this.Hidden">
<FluentPersona Name="Kevin Sturgis"
Status="PresenceStatus.Available"
StatusSize="PresenceBadgeSize.Small"
StatusTitle="He is available"
Image="https://res-1.cdn.office.net/files/fabric-cdn-prod_20230815.002/office-ui-fabric-react-assets/persona-male.png"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same... Could you use the @DataSource.SamplePicture image? To be independent of external resources (which can be removed later)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed both remarks.

ImageSize="50px"
DismissTitle="Hide Kevin"
OnDismissClick="@this.Dismiss">
</FluentPersona>
</div>

@code {
private bool Hidden { get; set; }

private void Dismiss()
{
this.Hidden = true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ο»Ώ<FluentPersona Name="Lydia Bauer"
ImageSize="50px"
Initials="LY">
</FluentPersona>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ο»Ώ<FluentPersona Name="Lydia Bauer"
ImageSize="50px"
Status="PresenceStatus.Busy"
StatusSize="PresenceBadgeSize.Small">
</FluentPersona>
35 changes: 35 additions & 0 deletions examples/Demo/Shared/Pages/Persona/PersonaPage.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
ο»Ώ@page "/Persona"
@using FluentUI.Demo.Shared.Pages.Persona.Examples

<h1>Persona</h1>
<p>A Persona is a visual representation of a person with an avatar. A status can be specified optionally.</p>

<h2>Examples</h2>
<DemoSection Title="Default" Component="typeof(PersonaDefault)">
<Description>
Display a person with his avatar and his status.
</Description>
</DemoSection>

<DemoSection Title="With no image (Default initials)" Component="typeof(PersonaNoImage)">
<Description>
If no image is specified, the initials of the person is automatically retrieved.
</Description>
</DemoSection>

<DemoSection Title="With no image (Specific initials)" Component="typeof(PersonaInitials)">
<Description>
Explicit initials for the person can be defined with the <code>Initials</code> property.
</Description>
</DemoSection>

<DemoSection Title="Dismiss action" Component="typeof(PersonaDismiss)">
<Description>
Display a "Dismiss" cross and raise an event.
</Description>
</DemoSection>

<h2>API Documentation</h2>
<ApiDocumentation Component="typeof(FluentPersona)" />


1 change: 1 addition & 0 deletions examples/Demo/Shared/Shared/DemoNavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<FluentNavLink Href="/Overflow" Icon="@(new Icons.Regular.Size20.MultiselectRtl())">Overflow</FluentNavLink>
<FluentNavLink Href="/Overlay" Icon="@(new Icons.Regular.Size20.CursorHover())">Overlay</FluentNavLink>
<FluentNavLink Href="/Panel" Icon="@(new Icons.Regular.Size20.PanelRight())">Panel</FluentNavLink>
<FluentNavLink Href="/Persona" Icon="@(new Icons.Regular.Size20.PersonAvailable())">Persona</FluentNavLink>
<FluentNavLink Href="/Popover" Icon="@(new Icons.Regular.Size20.TooltipQuote())">Popover</FluentNavLink>
<FluentNavLink Href="/Progress" Icon="@(new Icons.Regular.Size20.SquareHint())">Progress</FluentNavLink>
<FluentNavLink Href="/ProgressRing" Icon="@(new Icons.Regular.Size20.ArrowClockwiseDashes())">Progress Ring</FluentNavLink>
Expand Down
3 changes: 3 additions & 0 deletions examples/Demo/Shared/Shared/DemoNavMenuList.razor
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@
<li>
<FluentAnchor Href="Panel" Appearance=Appearance.Neutral>Panel</FluentAnchor>
</li>
<li>
<FluentAnchor Href="Persona" Appearance=Appearance.Neutral>Persona</FluentAnchor>
</li>
<li>
<FluentAnchor Href="Popover" Appearance=Appearance.Neutral>Popover</FluentAnchor>
</li>
Expand Down
1 change: 1 addition & 0 deletions examples/Demo/Shared/Shared/DemoNavMenuTree.razor
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<FluentNavMenuLink Href="/Overflow" Icon="@(new Icons.Regular.Size20.MultiselectRtl())" Text="Overflow" />
<FluentNavMenuLink Href="/Overlay" Icon="@(new Icons.Regular.Size20.CursorHover())" Text="Overlay" />
<FluentNavMenuLink Href="/Panel" Icon="@(new Icons.Regular.Size20.PanelRight())" Text="Panel" />
<FluentNavMenuLink Href="/Persona" Icon="@(new Icons.Regular.Size20.PersonAvailable())" Text="Persona" />
<FluentNavMenuLink Href="/Popover" Icon="@(new Icons.Regular.Size20.TooltipQuote())" Text="Popover" />
<FluentNavMenuLink Href="/Progress" Icon="@(new Icons.Regular.Size20.SquareHint())" Text="Progress" />
<FluentNavMenuLink Href="/ProgressRing" Icon="@(new Icons.Regular.Size20.ArrowClockwiseDashes())" Text="Progress Ring" />
Expand Down