mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-13 07:33:48 +00:00
Refactored inner scrolling into its own component
This commit is contained in:
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});";
|
||||
}
|
||||
Reference in new issue
Block a user