Refactor categories view with tree structure and improve product caching
This commit is contained in:
@@ -23,19 +23,12 @@ else if (_product is null)
|
||||
else
|
||||
{
|
||||
<MudContainer MaxWidth="MaxWidth.Large" Class="py-6">
|
||||
@if (_product is not null)
|
||||
{
|
||||
<MudBreadcrumbs SeparatorIcon="@Icons.Material.Filled.ChevronRight" Class="mb-4">
|
||||
<MudBreadcrumbItem Href="@RouteConstants.Main.MainPage">دیجی کالا</MudBreadcrumbItem>
|
||||
@foreach (var node in _breadcrumbNodes)
|
||||
{
|
||||
<MudBreadcrumbItem Href="@($"{RouteConstants.Store.Products}?category={node.Id}")">@node.Title</MudBreadcrumbItem>
|
||||
}
|
||||
<MudBreadcrumbItem Disabled="true">@_product.Title</MudBreadcrumbItem>
|
||||
</MudBreadcrumbs>
|
||||
}
|
||||
<MudGrid Spacing="3">
|
||||
<MudItem xs="12" md="6">
|
||||
@if (_product is not null)
|
||||
{
|
||||
<MudBreadcrumbs Items="_breadcrumbItems" SeparatorIcon="@Icons.Material.Filled.ChevronRight" Class="mb-2" />
|
||||
}
|
||||
<MudPaper Class="rounded-lg pa-2">
|
||||
@if (!string.IsNullOrWhiteSpace(MainImageUrl))
|
||||
{
|
||||
@@ -69,20 +62,20 @@ else
|
||||
@((MarkupString)_product.FullInformation)
|
||||
</MudText>
|
||||
}
|
||||
@if (_categoryPaths.Count > 0)
|
||||
{
|
||||
<MudStack Spacing="1">
|
||||
<MudText Typo="Typo.caption" Class="mud-text-secondary">دستهبندیها</MudText>
|
||||
<MudStack Row="true" Spacing="1" Wrap="Wrap.Wrap">
|
||||
@foreach (var categoryPath in _categoryPaths)
|
||||
{
|
||||
<MudChip T="string" Variant="Variant.Outlined" Color="Color.Primary" OnClick="() => NavigateToCategory(categoryPath)">
|
||||
@GetCategoryLabel(categoryPath)
|
||||
</MudChip>
|
||||
}
|
||||
</MudStack>
|
||||
</MudStack>
|
||||
}
|
||||
@* @if (_categoryPaths.Count > 0) *@
|
||||
@* { *@
|
||||
@* <MudStack Spacing="1"> *@
|
||||
@* <MudText Typo="Typo.caption" Class="mud-text-secondary">دستهبندیها</MudText> *@
|
||||
@* <MudStack Row="true" Spacing="1" Wrap="Wrap.Wrap"> *@
|
||||
@* @foreach (var categoryPath in _categoryPaths) *@
|
||||
@* { *@
|
||||
@* <MudChip T="string" Variant="Variant.Outlined" Color="Color.Primary" OnClick="() => NavigateToCategory(categoryPath)"> *@
|
||||
@* @GetCategoryLabel(categoryPath) *@
|
||||
@* </MudChip> *@
|
||||
@* } *@
|
||||
@* </MudStack> *@
|
||||
@* </MudStack> *@
|
||||
@* } *@
|
||||
<MudDivider Class="my-2"/>
|
||||
<MudText Typo="Typo.h5" Color="Color.Primary">@FormatPrice(_product.Price)</MudText>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user