Skip to content

Commit 0ebab46

Browse files
committed
feat: improve design of add product dialog
1 parent b01a26d commit 0ebab46

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

GrocyScanner.Core/GrocyScanner.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10+
<PackageReference Include="Humanizer" Version="2.14.1" />
1011
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.15" />
1112
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
1213
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />

GrocyScanner.Service/GrocyScanner.Service.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11+
<PackageReference Include="Humanizer" Version="2.14.1" />
1112
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="7.0.15" />
1213
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
1314
<PackageReference Include="MudBlazor" Version="6.13.0" />

GrocyScanner.Service/Pages/Scanner.razor

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@
121121
{
122122
CloseOnEscapeKey = false,
123123
DisableBackdropClick = true,
124-
CloseButton = false,
125-
FullScreen = true
124+
CloseButton = false
126125
});
127126

128127
Barcode = string.Empty;

GrocyScanner.Service/Shared/Components/AddProductDialog.razor

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@using GrocyScanner.Core.Models
22
@using GrocyScanner.Core.Providers
33
@using GrocyScanner.Core.GrocyClient
4+
@using Humanizer
45

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

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

2425
<MudDatePicker
2526
Variant="Variant.Filled"
@@ -35,20 +36,17 @@
3536
Label="Price"
3637
Margin="Margin.Dense"
3738
Variant="Variant.Filled"
38-
Min="0.0"/>
39+
Min="0.0"
40+
Max="int.MaxValue"/>
3941
<MudNumericField
4042
@bind-Value="FormAmount"
4143
Format="N0"
4244
Label="Amount"
4345
Margin="Margin.Dense"
4446
Variant="Variant.Filled"
45-
Min="0"
47+
Min="1"
4648
Max="999"/>
4749
</MudCardContent>
48-
49-
<MudCardActions>
50-
51-
</MudCardActions>
5250
</MudCard>
5351
}
5452
@if (IsLoading)

0 commit comments

Comments
 (0)