Skip to content

Commit

Permalink
make it more obvious when you're editing your profile
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsPilgaard committed Aug 14, 2024
1 parent 871298f commit 11649f7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
21 changes: 16 additions & 5 deletions src/web/Jordnaer/Pages/Profile/MyProfile.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@
return;
}

<MudButton Disabled="@(_userProfile.UserName is null)" Href="@($"/{_userProfile.UserName}")" Color="Color.Primary" StartIcon="@Icons.Material.Filled.KeyboardArrowLeft" EndIcon="@Icons.Material.Filled.Person">@(_userProfile.UserName is null ? "Sæt et brugernavn for at gøre din profil offentlig" : "Gå til offentlig profil")</MudButton>
<MudButton Disabled="@(_userProfile.UserName is null)"
Href="@($"/{_userProfile.UserName}")"
Size="Size.Large"
Class="mb-3"
Color="Color.Info"
Variant="Variant.Outlined"
StartIcon="@Icons.Material.Filled.KeyboardArrowLeft"
EndIcon="@Icons.Material.Filled.Person">
@(_userProfile.UserName is null
? "Sæt et brugernavn for at gøre din profil offentlig"
: "Se hvordan andre ser din profil")
</MudButton>

<EditForm Model="@_userProfile" OnValidSubmit="UpdateUserProfile">

Expand Down Expand Up @@ -124,10 +135,10 @@

protected override async Task OnInitializedAsync()
{
if (RenderStateService.IsPreRender)
{
return;
}
if (RenderStateService.IsPreRender)
{
return;
}

var userProfile = await ProfileCache.GetProfileAsync();
if (userProfile is null)
Expand Down
16 changes: 15 additions & 1 deletion src/web/Jordnaer/Pages/Profile/PublicProfile.razor
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,26 @@
Description="@($"Beskrivelse af {UserName}:\n {_profile?.Description}")"
Image="@_profile?.ProfilePictureUrl" />
<MudFab StartIcon="@Icons.Material.Filled.ArrowBack" Class="mb-5" Color="Color.Primary" OnClick="JsRuntime.GoBackAsync" />
<MudFab StartIcon="@Icons.Material.Filled.ArrowBack" Class="mb-5" Color="Color.Info" OnClick="JsRuntime.GoBackAsync" />
@if (_currentUserId != _profile?.Id)
{
<OpenChat Disabled="@_disableOpenChatButton" Recipients="_userIds" />
}
else
{
<MudButton Href="/profile"
Class="mb-5 ml-3"
Color="Color.Info"
Size="Size.Large"
Variant="Variant.Outlined"
StartIcon="@Icons.Material.Filled.Edit"
EndIcon="@Icons.Material.Filled.Person">
Redigér Profil
</MudButton>
}
<MudGrid>
<MudItem xs="12">
Expand Down

0 comments on commit 11649f7

Please sign in to comment.