-
-
Notifications
You must be signed in to change notification settings - Fork 530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Layout Improvements #1090
Layout Improvements #1090
Conversation
Source/Blazorise/Layout.razor
Outdated
@@ -3,6 +3,10 @@ | |||
{ | |||
<section @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" @attributes="@Attributes"> | |||
<CascadingValue Value=this> | |||
@if ( Loading ) | |||
{ | |||
<div class="@LoadingClass"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking of adding additional [Parameter] public RenderFragment LoadingTemplate { get; set; }
, and then add it like:
@if ( LoadingTemplate != null )
{
@LoadingTemplate
}
else
{
<div class="@LoadingClass"></div>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see, looks good!
Source/Blazorise/Layout.razor.cs
Outdated
private bool bodyClassApplied; | ||
private bool loading; | ||
|
||
private string loadingClass = "b-layout-loading-spinner"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this as ClassBuilder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, was just doing this quickly to get feedback on templating idea :)
} | ||
|
||
[Parameter] | ||
public string LoadingClass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make LoadingClass as custom class to be added into loading ClassBuilder
docs/_docs/components/bar.md
Outdated
@@ -59,8 +59,8 @@ The bar component has the following structure: | |||
</BarStart> | |||
<BarEnd> | |||
<BarItem> | |||
<Button Color="Color.Primary">Sign up</Button> | |||
<Button Color="Color.Secondary">Log in</Button> | |||
<button Color="Color.Primary">Sign up</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why button
instead of Button
? Is this a mistake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Yes this is a mistake.
Must've auto save formatting
Test and working like a charm. Excellent work! |
More details can be found at #1089
@stsrki I have added a
LoadingClass
toLayout
to represent what you suggested on #1084.This can be overridden with CSS for a spinner or progress bar, but I have also provided a default.
Let me know what you think, didn't want to spend too much time on that right now.