Skip to content

Commit

Permalink
♻ refactor(Overlay): merge code from BlazorComponent and refactor (#1763
Browse files Browse the repository at this point in the history
)
  • Loading branch information
capdiem authored Feb 29, 2024
1 parent bcaee4f commit 1e7226a
Show file tree
Hide file tree
Showing 16 changed files with 1,308 additions and 802 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@
Color="orange"
BackgroundColor="orange"
Hover
Class="mr-2"></MRating>
Class="mr-2">
</MRating>
<span class="primary--text text-subtitle-2">64 Reviews</span>
</MCardTitle>

<FadeTransition>
<ShowTransitionElement Value="@context.Hover" Class="text-center">
<MOverlay Contained Value="@context.Hover"
Color="#036358">
<MButton>See more info</MButton>
</MOverlay>
</ShowTransitionElement>
</FadeTransition>
<MOverlay Contained
Value="@context.Hover"
Class="text-center"
Color="#036358">
<MButton>See more info</MButton>
</MOverlay>
</MCard>
</MHover>
126 changes: 0 additions & 126 deletions src/Masa.Blazor/Components/Dialog/MDialog.cs

This file was deleted.

45 changes: 45 additions & 0 deletions src/Masa.Blazor/Components/Dialog/MDialog.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
@namespace Masa.Blazor
@inherits BBootable

<CascadingValue Value="IsDark" Name="IsDark">

@ComputedActivatorContent

<CascadingValue Value="this" IsFixed>
<div class="@CssProvider.GetClass()"
style="@CssProvider.GetStyle()"
id="@Id"
@ref="Ref"
role="dialog">
@if (IsBooted)
{
<div class="@CssProvider.GetClass("content")"
style="@CssProvider.GetStyle("content")"
@onkeydown="@Keydown"
@ref="@ContentRef"
@attributes="@ContentAttrs">

<Transition Name="@Transition">
<ShowTransitionElement Value="@IsActive"
Class="@CssProvider.GetClass("innerContent")"
Style="@CssProvider.GetStyle("innerContent")"
ReferenceCaptureAction="r => DialogRef = r">
@ChildContent
</ShowTransitionElement>
</Transition>

</div>

if (ShowOverlay)
{
<MOverlay ScrimClass="@OverlayScrimClass"
Value="@IsActive"
ZIndex="@(ZIndex - 1)"
@ref="Overlay">
</MOverlay>
}
}
</div>
</CascadingValue>

</CascadingValue>
Loading

0 comments on commit 1e7226a

Please sign in to comment.