Skip to content

Commit

Permalink
Hide the previous button on the history and feed page
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamMorrow committed Oct 15, 2024
1 parent d78f44c commit 4611c01
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 6 additions & 1 deletion LiftLog.Ui/Shared/Presentation/WeightedExercise.razor
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
@if(!IsReadonly)
{
<div class="flex justify-end">
<IconButton data-cy="prev-exercise-btn" Type="IconButtonType.Standard" Icon="history" OnClick="ShowPrevious"/>
@if(ShowPreviousButton)
{
<IconButton data-cy="prev-exercise-btn" Type="IconButtonType.Standard" Icon="history" OnClick="ShowPrevious"/>
}
<IconButton data-cy="per-rep-weight-btn" Type=IconButtonType.Standard Icon=weight OnClick="ToggleExercisePerSetWeight"></IconButton>
<div>
<IconButton data-cy="more-exercise-btn" class="self-end" Type="IconButtonType.Standard" OnClick="() => { _menu?.Open(); }" Icon="more_horiz" id="@moreButtonId"/>
Expand Down Expand Up @@ -143,6 +146,8 @@

[Parameter] public bool IsReadonly { get; set; } = false;

[EditorRequired] [Parameter] public bool ShowPreviousButton { get; set; }

private void HandleNotesChange(string value)
{
EditorNotes = value;
Expand Down
7 changes: 5 additions & 2 deletions LiftLog.Ui/Shared/Smart/SessionComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ else
UpdateNotesForExercise=@((notes) => UpdateNotesForExercise(context.Index, notes))
OnEditExercise=@(() => BeginEditExercise(context.Index))
OnRemoveExercise=@(() => BeginRemoveExercise(context.Index))
IsReadonly=IsReadonly />
IsReadonly=IsReadonly
ShowPreviousButton=@(SessionTarget == SessionTarget.WorkoutSession) />
</ItemList>
}
@if (ShowBodyweight)
Expand Down Expand Up @@ -78,7 +79,9 @@ else
@if(IsInActiveScreen && !IsReadonly)
{
<Microsoft.AspNetCore.Components.Sections.SectionContent SectionName="TrailingTitleButton">
<AppButton class="text-lg" Type=AppButtonType.Text OnClick=SaveSession>Finish</AppButton>
<AppButton class="text-lg" Type=AppButtonType.Text OnClick=SaveSession>
@(SessionTarget == SessionTarget.WorkoutSession ? "Finish" : "Save")
</AppButton>
</Microsoft.AspNetCore.Components.Sections.SectionContent>
}
Expand Down

0 comments on commit 4611c01

Please sign in to comment.