Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Mar 4, 2024
1 parent 1486abb commit cb1c8c3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 38 deletions.
10 changes: 5 additions & 5 deletions Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Models/Task.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
namespace Masa.Blazor.ProApp.Rcl.Models;
using System.ComponentModel.DataAnnotations;

namespace Masa.Blazor.ProApp.Rcl.Models;

public class TodoTask
{
public int Id { get; set; }

public string? Title { get; set; }

public string? Assignee { get; set; }
[Required] public string? Title { get; set; }

public string? Description { get; set; }

public DateOnly DueAt { get; set; }
[Required] public DateOnly DueAt { get; set; }

public bool Important { get; set; }

Expand Down
79 changes: 46 additions & 33 deletions Masa.Blazor.ProApp/Masa.Blazor.ProApp.Rcl/Pages/Todo.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
</MButton>
</div>

<MBottomSheet ContentClass="px-4 py-2">
<MBottomSheet @bind-Value="_newTaskSheet"
ContentClass="px-4 py-2">
<ActivatorContent>
<MButton Fixed Right Fab Color="primary"
Style="bottom: 72px;"
Expand All @@ -26,38 +27,42 @@
</MButton>
</ActivatorContent>
<ChildContent>
<MTextField @bind-Value="@_todoTask.Title"
Class="my-2"
Dense
Filled
Rounded
HideDetails="true"
Placeholder="Title"
PersistentPlaceholder>
</MTextField>

<MTextarea @bind-Value="@_todoTask.Description"
Dense
Filled
Rounded
HideDetails="true"
Placeholder="Description"
PersistentPlaceholder>
</MTextarea>

<div Class="d-flex align-center my-2">
<MButton Color="secondary" Text>
<MIcon Left>mdi-calendar-today-outline</MIcon>
Today
</MButton>
<MButton Icon>
<MIcon>mdi-flag-variant-outline</MIcon>
</MButton>
<MSpacer/>
<MButton Icon Color="primary">
<MIcon>mdi-arrow-up-circle</MIcon>
</MButton>
</div>
<MForm Model="_todoTask"
EnableValidation
OnInvalidSubmit="HandleOnSubmit">
<MTextField @bind-Value="@_todoTask.Title"
Class="my-2"
Dense
Filled
Rounded
HideDetails="true"
Placeholder="Title"
PersistentPlaceholder>
</MTextField>

<MTextarea @bind-Value="@_todoTask.Description"
Dense
Filled
Rounded
HideDetails="true"
Placeholder="Description"
PersistentPlaceholder>
</MTextarea>

<div Class="d-flex align-center my-2">
<MButton Color="secondary" Text>
<MIcon Left>mdi-calendar-today-outline</MIcon>
Today
</MButton>
<MButton Icon>
<MIcon>mdi-flag-variant-outline</MIcon>
</MButton>
<MSpacer/>
<MButton Icon Color="primary" Type="submit">
<MIcon>mdi-arrow-up-circle</MIcon>
</MButton>
</div>
</MForm>
</ChildContent>
</MBottomSheet>

Expand All @@ -67,12 +72,20 @@
@code {

private bool? _drawer = false;
private bool _newTaskSheet;

private string Category => Filter ?? "inbox";

private TodoTask _todoTask = new();

[Parameter] public string? Filter { get; set; }

private async Task HandleOnSubmit()
{
// TODO: Save the task
_newTaskSheet = false;
}


}

0 comments on commit cb1c8c3

Please sign in to comment.