Skip to content

Commit

Permalink
fix(mudblazor): set For and HelperText on form fields
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 18a02a0 commit b9017fe
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@inherits CutBlockForm<MudBlazorBlocklyFormOptions>
<MudItem>
<MudTextField @bind-Value="@Block.ButtonText" Label="@LocalizationProvider["Button text"]" />
<MudTooltip Text="@LocalizationProvider["Text on button when block rendered in preview list mode"]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info" />
</MudTooltip>
<MudTextField @bind-Value="@Block.ButtonText" For="() => Block.ButtonText" Label="@LocalizationProvider["Button text"]" HelperText="@LocalizationProvider["Text on button when block rendered in preview list mode"]"/>
</MudItem >
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
@inherits IFrameBlockForm<MudBlazorBlocklyFormOptions>
<!--suppress HtmlDeprecatedAttribute -->
<MudItem>
<MudTextField @bind-Value="@Block.Src" Placeholder="@LocalizationProvider["Source"]" Label="@LocalizationProvider["Url"]" />
<MudTooltip Text="@LocalizationProvider["Page url to embed"]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info" />
</MudTooltip>
<MudTextField @bind-Value="@Block.Src" Placeholder="@LocalizationProvider["Source"]" Label="@LocalizationProvider["Url"]" For="() => Block.Src" HelperText="@LocalizationProvider["Page url to embed"]"/>
</MudItem>
@if (!string.IsNullOrEmpty(Block.Src))
{
Expand Down
10 changes: 2 additions & 8 deletions src/Sitko.Blockly.MudBlazor/Forms/Blocks/MudQuoteBlockForm.razor
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
</MudItem>

<MudItem md="4" xs="12">
<MudTextField Placeholder="@LocalizationProvider["Author name, site title, etc..."]" @bind-Value="@Block.Author" Label="@LocalizationProvider["Source"]"/>
<MudTooltip Text="@LocalizationProvider["Author name, site title, etc..."]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info"/>
</MudTooltip>
<MudTextField Placeholder="@LocalizationProvider["Author name, site title, etc..."]" @bind-Value="@Block.Author" Label="@LocalizationProvider["Source"]" For="() => Block.Author" HelperText="@LocalizationProvider["Author name, site title, etc..."]"/>
</MudItem>

<MudItem md="4" xs="12">
<MudTextField Placeholder="@LocalizationProvider["Link"]" @bind-Value="@Block.Link" Label="@LocalizationProvider["Url"]"/>
<MudTooltip Text="@LocalizationProvider["Link to page where this quote comes from"]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info"/>
</MudTooltip>
<MudTextField Placeholder="@LocalizationProvider["Link"]" @bind-Value="@Block.Link" Label="@LocalizationProvider["Url"]" For="() => Block.Link" HelperText="@LocalizationProvider["Link to page where this quote comes from"]"/>
</MudItem>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
@inherits TwitchBlockForm<MudBlazorBlocklyFormOptions>

<MudItem>
<MudTextField T="string" @bind-Value="Block.Url" Placeholder="@LocalizationProvider["Twitch link"]" OnChange="OnChangeAsync" AllowClear="true" Label="@LocalizationProvider["Url"]"/>
<MudTooltip Text="@LocalizationProvider["Twitch video, channel or collection url"]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info" />
</MudTooltip>
<MudTextField T="string" @bind-Value="Block.Url" Placeholder="@LocalizationProvider["Twitch link"]" OnChange="OnChangeAsync" AllowClear="true" Label="@LocalizationProvider["Url"]" For="() => Block.Url" HelperText="@LocalizationProvider["Twitch video, channel or collection url"]"/>
</MudItem>
<div @ref="ContainerRef" class="twitch-video" id="[email protected]"></div>
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
@inherits TwitterBlockForm<MudBlazorBlocklyFormOptions>

<MudItem>
<MudTextField @bind-Value="Block.Url" Label="@LocalizationProvider["Url"]" Placeholder="@LocalizationProvider["Tweet link"]" AllowClear="true" OnChange="OnChangeAsync" T="string"/>
<MudTooltip Text="@LocalizationProvider["Full tweet url"]">
<MudIconButton Class="mx-2" Icon="@Icons.Material.Outlined.Info" />
</MudTooltip>
<MudTextField @bind-Value="Block.Url" Label="@LocalizationProvider["Url"]" Placeholder="@LocalizationProvider["Tweet link"]" AllowClear="true" OnChange="OnChangeAsync" For="() => Block.Url" HelperText="@LocalizationProvider["Full tweet url"]"/>
</MudItem>
<div @ref="ContainerRef" class="tweet">
</div>

0 comments on commit b9017fe

Please sign in to comment.