From 0e060c4564a379fd45a5305611daa39c16202142 Mon Sep 17 00:00:00 2001 From: beolafsen <76835718+beolafsen@users.noreply.github.com> Date: Fri, 1 Dec 2023 07:34:17 +0100 Subject: [PATCH] Extend the Section component with "Visible" parameter --- Oqtane.Client/Modules/Controls/Section.razor | 44 +++++++++++--------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/Oqtane.Client/Modules/Controls/Section.razor b/Oqtane.Client/Modules/Controls/Section.razor index 91f91724..951fa971 100644 --- a/Oqtane.Client/Modules/Controls/Section.razor +++ b/Oqtane.Client/Modules/Controls/Section.razor @@ -1,27 +1,30 @@ @namespace Oqtane.Modules.Controls @inherits LocalizableComponent -
-
- -
@_heading
-
+@if (IsVisible) +{ + -
- -   - +
+
-
-
-
-
-
- @if (ChildContent != null) - { - @ChildContent - } -
+
+ @if (ChildContent != null) + { + @ChildContent + } +
+} @code { private string _heading = string.Empty; @@ -40,6 +43,9 @@ [Parameter] public string Expanded { get; set; } // optional - will default to false if not provided + [Parameter] + public bool IsVisible { get; set; } = true; + protected override void OnParametersSet() { base.OnParametersSet(); // must be included to call method in LocalizableComponent