Skip to content

Commit

Permalink
Start adding deload button
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamMorrow committed Jul 4, 2024
1 parent 8498118 commit b5901eb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion LiftLog.Ui/Shared/Presentation/Menu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@onpointerdown:preventDefault="true" @onpointerdown:stopPropagation="true"
@onpointerdown=@(_=>JSRuntime.InvokeVoidAsync("AppUtils.callOn", menu, "close"))></div>
}
<md-menu @attributes="AdditionalAttributes" positioning="popover" @ref="menu" @ondialog-close=@(()=>{_open = false;StateHasChanged();}) >
<md-menu @attributes="AdditionalAttributes" class="text-left" positioning="popover" @ref="menu" @ondialog-close=@(()=>{_open = false;StateHasChanged();}) >
@ChildContent
</md-menu>
@code {
Expand Down
4 changes: 3 additions & 1 deletion LiftLog.Ui/Shared/Presentation/RestTimer.razor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using Microsoft.AspNetCore.Components;

namespace LiftLog.Ui.Shared.Presentation;

public partial class RestTimer : IDisposable
public partial class RestTimer : ComponentBase, IDisposable
{
private const string TimespanFormatStr = @"m\:ss";
private Timer? _timer;
Expand Down
23 changes: 22 additions & 1 deletion LiftLog.Ui/Shared/Presentation/SessionComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ else
@if(IsInActiveScreen && !IsReadonly)
{
<Microsoft.AspNetCore.Components.Sections.SectionContent SectionName="TrailingTitleButton">
<AppButton class="text-lg" Type=AppButtonType.Text OnClick=SaveSession>Finish</AppButton>
<IconButton Type=IconButtonType.Standard Icon="assignment_turned_in" OnClick=SaveSession />
<IconButton id="@moreButtonId" Type=IconButtonType.Standard Icon="more_vert" OnClick="@(()=>_menu?.Open())" />
<Menu @ref="_menu" anchor="@moreButtonId" >
<MenuItem Icon="trending_down" Label="Deload" OnClick="() => _deloadDialog?.Open()"/>
</Menu>
</Microsoft.AspNetCore.Components.Sections.SectionContent>
}

Expand Down Expand Up @@ -111,6 +115,20 @@ else
</div>
</Dialog>


<Dialog @ref="_deloadDialog">
<span slot="headline">Remove Exercise?</span>
<span slot="content" class="block text-left">
Exercise will be removed from the current session, future sessions will
not be impacted.
</span>
<div slot="actions">
<AppButton Type="AppButtonType.Text" slot="footer" OnClick="() => { _deloadDialog?.Close(); }">Cancel</AppButton>
<AppButton Type="AppButtonType.Text" slot="footer" OnClick="RemoveExerciseHandler">Remove</AppButton>
</div>
</Dialog>


<Dialog @ref="_updatePlanDialog">
<span slot="headline">Update Plan</span>
<span slot="content" class="block text-left">
Expand Down Expand Up @@ -150,10 +168,13 @@ else
private (int ExerciseIndex, int PotentialSetIndex)? setAdditionalActions;
private int? _exerciseToEditIndex;
private int? _exerciseToRemoveIndex;
private string moreButtonId = "a" + Guid.NewGuid();
private FullScreenDialog? _editExerciseDialog;
private Dialog? _removeExerciseDialog;
private Dialog? _updatePlanDialog;
private Dialog? _deloadDialog;
private Dialog? setAdditionalActionsDialog;
private Menu? _menu;

[EditorRequired] [Parameter] public Session Session { get; set; } = null!;

Expand Down

0 comments on commit b5901eb

Please sign in to comment.