-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from NielsPilgaard/user-profile
User profile
- Loading branch information
Showing
11 changed files
with
153 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<MudCard Elevation="3"> | ||
<MudCardContent> | ||
<MudImage Src="@Child.PictureUrl" /> | ||
<MudTextField Label="Navn" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.AccountCircle" ReadOnly T="string" Text="@($"{Child.FirstName} {Child.LastName}")" /> | ||
@if (Child.DateOfBirth is not null) | ||
{ | ||
<MudTextFieldExtended Label="Alder" ReadOnly T="string"> | ||
<AdornmentStart> | ||
<MudIcon Color="Color.Default" Icon="@Icons.Material.Filled.Cake" Class="mr-2" /> | ||
<MudText Color="Color.Default">@Child.GetAge() år</MudText> | ||
</AdornmentStart> | ||
<AdornmentEnd> | ||
<MudText Color="Color.Default">@Child.DateOfBirth.Value.ToString("d")</MudText> | ||
</AdornmentEnd> | ||
</MudTextFieldExtended> | ||
} | ||
<MudTextField Label="Køn" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Person" ReadOnly T="string" Text="@Child.Gender.GetDisplayName()" /> | ||
<MudText Typo="Typo.body1" Class="mt-3">@Child.Description</MudText> | ||
</MudCardContent> | ||
</MudCard> | ||
|
||
@code | ||
{ | ||
[Parameter] | ||
public required ChildProfileDto Child { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<MudCard Elevation="3"> | ||
<MudCardContent> | ||
<MudImage ObjectPosition="ObjectPosition.Left" ObjectFit="ObjectFit.Fill" Style="border-radius: 50%" Src="@Profile.ProfilePictureUrl" /> | ||
<MudTextField Label="Brugernavn" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.AlternateEmail" ReadOnly T="string" Text="@UserName" /> | ||
<MudTextField Label="Område" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.Place" ReadOnly T="string" Text="@Profile.DisplayLocation()" /> | ||
<MudTextField Label="Navn" Adornment="Adornment.Start" AdornmentIcon="@Icons.Material.Filled.AccountCircle" ReadOnly T="string" Text="@($"{Profile.FirstName} {Profile.LastName}")" /> | ||
@if (Profile.DateOfBirth is not null) | ||
{ | ||
<MudTextFieldExtended Label="Alder" ReadOnly T="string"> | ||
<AdornmentStart> | ||
<MudIcon Color="Color.Default" Icon="@Icons.Material.Filled.Cake" Class="mr-2" /> | ||
<MudText Color="Color.Default">@Profile.GetAge() år</MudText> | ||
</AdornmentStart> | ||
<AdornmentEnd> | ||
<MudText Color="Color.Default">@Profile.DateOfBirth.Value.ToString("d")</MudText> | ||
</AdornmentEnd> | ||
</MudTextFieldExtended> | ||
} | ||
<MudText Class="mt-3" Typo="Typo.body1">@Profile.Description</MudText> | ||
</MudCardContent> | ||
</MudCard> | ||
|
||
@code | ||
{ | ||
[Parameter] | ||
public required string UserName { get; set; } | ||
|
||
[Parameter] | ||
public required ProfileDto Profile { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace Jordnaer.Shared; | ||
|
||
public class ChildProfileDto | ||
{ | ||
public required string FirstName { get; set; } | ||
|
||
public string? LastName { get; set; } | ||
|
||
public Gender Gender { get; set; } | ||
|
||
public DateTime? DateOfBirth { get; set; } | ||
|
||
public string? Description { get; set; } | ||
|
||
public string PictureUrl { get; set; } = ProfileConstants.Default_Profile_Picture; | ||
|
||
public int? GetAge() => DateOfBirth.GetAge(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters