Skip to content

Commit cc41f3a

Browse files
committed
remove copy button from code block optionally
1 parent b667043 commit cc41f3a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Desktop/Ui/ErrorHandling/CodeBlock.razor

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
<pre class="code">
55
@Value
66
</pre>
7-
<MudIconButton Icon="@Icons.Material.Outlined.FileCopy" Size="Size.Small" Class="copy-code-button"
8-
@onclick="CopyTextToClipboard"/>
7+
@if (ShowCopyButton)
8+
{
9+
<MudIconButton Icon="@Icons.Material.Outlined.FileCopy" Size="Size.Small" Class="copy-code-button"
10+
@onclick="CopyTextToClipboard"/>
11+
}
912
</MudPaper>
1013

1114
<style>
@@ -35,6 +38,8 @@
3538

3639
@code {
3740
[Parameter] public required string Value { get; set; }
41+
42+
[Parameter] public bool ShowCopyButton { get; set; } = true;
3843

3944
private async Task CopyTextToClipboard()
4045
{

Desktop/Ui/Pages/Dash/Components/UpdateDialog.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<br />
5555
<MudText Typo="Typo.body1"> A new version of OpenShock Desktop is available.Would you like to update?</MudText>
5656

57-
<CodeBlock Value="@Updater.LatestReleaseInfo!.Value.Response.Body"/>
57+
<CodeBlock ShowCopyButton="false" Value="@Updater.LatestReleaseInfo!.Value.Response.Body"/>
5858
}
5959
else
6060
{

0 commit comments

Comments
 (0)