Skip to content
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

Merged
merged 9 commits into from
Jul 6, 2020
Merged

Conversation

MitchellNZ
Copy link
Contributor

More details can be found at #1089

@stsrki I have added a LoadingClass to Layout 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.

@@ -3,6 +3,10 @@
{
<section @ref="@ElementRef" id="@ElementId" class="@ClassNames" style="@StyleNames" @attributes="@Attributes">
<CascadingValue Value=this>
@if ( Loading )
{
<div class="@LoadingClass"></div>
Copy link
Collaborator

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>
}

Copy link
Contributor Author

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!

private bool bodyClassApplied;
private bool loading;

private string loadingClass = "b-layout-loading-spinner";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this as ClassBuilder.

Copy link
Contributor Author

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
Copy link
Collaborator

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

@@ -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>
Copy link
Collaborator

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?

Copy link
Contributor Author

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

@stsrki stsrki merged commit 60224c5 into Megabit:dev092 Jul 6, 2020
@stsrki
Copy link
Collaborator

stsrki commented Jul 6, 2020

Test and working like a charm. Excellent work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants