Skip to content

Commit

Permalink
feat: improve design of add product dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rw committed Jan 26, 2024
1 parent b01a26d commit 0ebab46
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions GrocyScanner.Core/GrocyScanner.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.15" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
Expand Down
1 change: 1 addition & 0 deletions GrocyScanner.Service/GrocyScanner.Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.15" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="MudBlazor" Version="6.13.0" />
Expand Down
3 changes: 1 addition & 2 deletions GrocyScanner.Service/Pages/Scanner.razor
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@
{
CloseOnEscapeKey = false,
DisableBackdropClick = true,
CloseButton = false,
FullScreen = true
CloseButton = false
});

Barcode = string.Empty;
Expand Down
18 changes: 8 additions & 10 deletions GrocyScanner.Service/Shared/Components/AddProductDialog.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@using GrocyScanner.Core.Models
@using GrocyScanner.Core.Providers
@using GrocyScanner.Core.GrocyClient
@using Humanizer

@inject IProductProvider ProductProvider
@inject IGrocyClient GrocyClient
Expand All @@ -12,14 +13,14 @@
<MudCard Outlined="true">
@if (!string.IsNullOrEmpty(Product.ImageUrl))
{
<div class="py-2">
<MudCardMedia Image="@Product.ImageUrl" Height="150" Style="background-size: contain;"></MudCardMedia>
<div class="py-2 d-flex align-items-center justify-content-center">
<img class="rounded" src="@Product.ImageUrl" height="150" alt="product image"/>
</div>
}

<MudCardContent>
<MudText Typo="Typo.subtitle1" Color="Color.Info">@Product.Gtin</MudText>
<MudText Typo="Typo.h4" Class="fw-bold">@Product.Name</MudText>
<MudText Typo="Typo.h5" Class="fw-bold">@Product.Gtin</MudText>
<MudText Typo="Typo.h4" Class="fw-bold">@Product.Name.Humanize()</MudText>

<MudDatePicker
Variant="Variant.Filled"
Expand All @@ -35,20 +36,17 @@
Label="Price"
Margin="Margin.Dense"
Variant="Variant.Filled"
Min="0.0"/>
Min="0.0"
Max="int.MaxValue"/>
<MudNumericField
@bind-Value="FormAmount"
Format="N0"
Label="Amount"
Margin="Margin.Dense"
Variant="Variant.Filled"
Min="0"
Min="1"
Max="999"/>
</MudCardContent>

<MudCardActions>

</MudCardActions>
</MudCard>
}
@if (IsLoading)
Expand Down

0 comments on commit 0ebab46

Please sign in to comment.