Skip to content

Commit

Permalink
feat(mudblazor): use new string icons
Browse files Browse the repository at this point in the history
Refs: BLOCKLY-T-2
  • Loading branch information
SonicGD committed Jan 19, 2022
1 parent 0092c2d commit 4738a8f
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ public MudCutBlockDescriptor(ILocalizationProvider<CutBlock> localizationProvide
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.ContentCut);
public override string Icon => Icons.Filled.ContentCut;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public MudFilesBlockDescriptor(ILocalizationProvider<FilesBlock> localizationPro
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.Attachment);
public override string Icon => Icons.Filled.Attachment;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public MudGalleryBlockDescriptor(ILocalizationProvider<GalleryBlock> localizatio
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.Photo);
public override string Icon => Icons.Filled.Photo;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public MudIframeBlockDescriptor(ILocalizationProvider<IframeBlock> localizationP
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.Code);
public override string Icon => Icons.Filled.Code;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public MudQuoteBlockDescriptor(ILocalizationProvider<QuoteBlock> localizationPro
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.FormatQuote);
public override string Icon => Icons.Filled.FormatQuote;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ public MudTextBlockDescriptor(ILocalizationProvider<TextBlock> localizationProvi
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.TextFields);
public override string Icon => Icons.Filled.TextFields;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public MudTwitchBlockDescriptor(ILocalizationProvider<TwitchBlock> localizationP
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Filled.Stream);
public override string Icon => Icons.Filled.Stream; // TODO: Get twitch icon
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public MudTwitterBlockDescriptor(ILocalizationProvider<TwitterBlock> localizatio
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Custom.Brands.Twitter);
public override string Icon => Icons.Custom.Brands.Twitter;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public MudYoutubeBlockDescriptor(ILocalizationProvider<YoutubeBlock> localizatio
{
}

public override RenderFragment Icon => builder => builder.AddIcon(Icons.Custom.Brands.YouTube);
public override string Icon => Icons.Custom.Brands.YouTube;
}
4 changes: 2 additions & 2 deletions src/Sitko.Blockly.MudBlazor/Forms/MudBlocklyForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</div>
<div class="block-controls block-controls-default">
<div class="block-mainicon" title="@blockDescriptor.Title">
@blockDescriptor.Icon
<MudIcon Icon="@blockDescriptor.Icon"></MudIcon>
</div>
<span title="@(block.Enabled ? LocalizationProvider["Disable block"] : LocalizationProvider["Enable block"])">
<MudButton Size="Size.Medium" OnClick="@(() => block.Enabled = !block.Enabled)" Class="block-disable-button">
Expand Down Expand Up @@ -85,7 +85,7 @@
foreach (var descriptor in BlockDescriptors)
{
<span class="add-block-button" title="@descriptor.Title">
<MudButton Disabled="!CanAdd(descriptor)" Size="@Size.Medium" OnClick="() => AddBlock(descriptor, afterBlock)">@descriptor.Icon</MudButton>
<MudButton Disabled="!CanAdd(descriptor)" Size="@Size.Medium" OnClick="() => AddBlock(descriptor, afterBlock)" StartIcon="@descriptor.Icon"></MudButton>
</span>
}
}
Expand Down

0 comments on commit 4738a8f

Please sign in to comment.