Refactored inner scrolling into its own component

This commit is contained in:
tsommer committed 2024-06-01 20:32:30 +02:00
1 parent 6c3412f3a6
commit fa80e5c1c0
7 files changed
+251 -226

No files matched your search

@@ -0,0 +1,7 @@
<div class="d-flex flex-column" style="@this.Height">
<div class="flex-auto overflow-auto">
@this.ChildContent
</div>
@this.FooterContent
</div>
@@ -0,0 +1,25 @@
using Microsoft.AspNetCore.Components;
namespace AIStudio.Components.Blocks;
public partial class InnerScrolling : ComponentBase
{
/// <summary>
/// Set the height of anything above the scrolling content; usually a header.
/// What we do is calc(100vh - THIS). Means, you can use multiple measures like
/// 230px - 3em. Default is 3em.
/// </summary>
[Parameter]
public string HeaderHeight { get; set; } = "3em";
[Parameter]
public RenderFragment? ChildContent { get; set; }
/// <summary>
/// Optional footer content, shown after the scrolling area.
/// </summary>
[Parameter]
public RenderFragment? FooterContent { get; set; }
private string Height => $"height: calc(100vh - {this.HeaderHeight});";
}