Skip to content

Commit

Permalink
feat: update blocks for mud blazor
Browse files Browse the repository at this point in the history
  • Loading branch information
thelegendaryzubat committed Jan 17, 2022
1 parent 50aa944 commit 3456112
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@if (Options.EntityUrl is not null)
{
<a href="@Options.EntityUrl">
<Button>
<MudButton>
@{
if (string.IsNullOrEmpty(Block.ButtonText))
{
Expand All @@ -17,10 +17,10 @@
</span>
}
}
</Button>
</MudButton>
</a>
}
else
{
<AntBlockErrorComponent Error="@LocalizationProvider["Not Entity url provided"]"></AntBlockErrorComponent>
<MudBlockErrorComponent Error="@LocalizationProvider["Not Entity url provided"]"></MudBlockErrorComponent>
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
@inherits FilesBlockComponent<MudBlazorBlocklyListOptions>
@using global::MudBlazor
@inherits FilesBlockComponent<MudBlazorBlocklyListOptions>
@if (Options.Storage is not null)
{
<ul>
@foreach (var file in Block.Files)
{
<li>
<AntDesign.Icon Type="paper-clip"/> <a target="_blank" rel="noopener noreferrer" title="@file.FileName" href="@Options.Storage.PublicUri(file)">@file.FileName</a><span class="filesize">&nbsp;(@file.HumanSize)</span>
<MudIcon Icon="@Icons.Filled.AttachFile"/> <a target="_blank" rel="noopener noreferrer" title="@file.FileName" href="@Options.Storage.PublicUri(file)">@file.FileName</a><span class="filesize">&nbsp;(@file.HumanSize)</span>
</li>
}
</ul>
}
else
{
<AntBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></AntBlockErrorComponent>
<MudBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></MudBlockErrorComponent>
}
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
@inherits GalleryBlockComponent<MudBlazorBlocklyListOptions>
@using Sitko.Core.Storage
@inherits GalleryBlockComponent<MudBlazorBlocklyListOptions>
@if (Options.Storage is not null)
{
if (Block.Pictures.Any())
{
@if (Block.Pictures.Count > 1)
{
<div class="block-content">
<Carousel Autoplay="TimeSpan.FromSeconds(2)">
@foreach (var image in Block.Pictures)
{
<CarouselSlick>
<img src="@Options.Storage.PublicUri(image).ToString()" alt="Image: @image.FileName"/>
</CarouselSlick>
}
</Carousel>
<MudCarousel AutoCycle="TimeSpan.FromSeconds(2)" ItemsSource="Block.Pictures">
<ItemTemplate>
<img src="@Options.Storage.PublicUri(context).ToString()" alt="Image: @context.FileName"/>
</ItemTemplate>
</MudCarousel>
</div>
}
else
Expand All @@ -27,5 +25,5 @@
}
else
{
<AntBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></AntBlockErrorComponent>
<MudBlockErrorComponent Error="@LocalizationProvider["Storage is not configured"]"></MudBlockErrorComponent>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="block-content">
<blockquote class="twitter-tweet" @ref="ContainerRef">
<div class="preloader">
<a href="@Block.Url"><Icon Spin="true" Type="spin"></Icon> Loading tweet...</a>
<a href="@Block.Url"><MudProgressCircular Indeterminate="true"></MudProgressCircular > Loading tweet...</a>
</div>
</blockquote>
</div>

0 comments on commit 3456112

Please sign in to comment.