Skip to content

Commit

Permalink
fix build warnings & refactor transition
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidVollmers committed Nov 26, 2023
1 parent ece8662 commit 4f507c9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/Tailwind/Ignis.Components.HeadlessUI/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public void Close(Action? continueWith = null)

if (Transition != null)
{
Transition.Leave(() => CloseCore(continueWith, async: true));
Transition.LeaveTransition(() => CloseCore(continueWith, async: true));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void Open(Action? continueWith = null)
_ = IsOpenChanged.InvokeAsync(_isOpen = true);

if (Transition != null)
FrameTracker.ExecuteOnNextFrame(this, () => Transition.Enter(() => OnAfterOpen(continueWith)));
FrameTracker.ExecuteOnNextFrame(this, () => Transition.EnterTransition(() => OnAfterOpen(continueWith)));
else if (continueWith != null) FrameTracker.ExecuteOnNextFrame(this, () => OnAfterOpen(continueWith));

Update();
Expand All @@ -64,7 +64,7 @@ public void Close(Action? continueWith = null)

if (Transition != null)
{
Transition.Leave(() => CloseCore(continueWith, async: true));
Transition.LeaveTransition(() => CloseCore(continueWith, async: true));
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public RadioGroupOption<T>? ActiveOption
}

/// <inheritdoc />
public IAriaComponentPart Label { get; set; }
public IAriaComponentPart? Label { get; set; }

/// <inheritdoc />
public string Id { get; } = "ignis-hui-radiogroup-" + Guid.NewGuid().ToString("N");
Expand Down
14 changes: 2 additions & 12 deletions packages/Tailwind/Ignis.Components.HeadlessUI/Transition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,16 @@ protected internal override void Update(bool async = false)
base.Update(async);
}

public void Leave(Action? continueWith = null)
{
LeaveTransition(continueWith);
}

public void Enter(Action? continueWith)
{
EnterTransition(continueWith);
}

/// <inheritdoc />
protected override void EnterTransition(Action? continueWith = null)
public override void EnterTransition(Action? continueWith = null)
{
_transitioningTo = _show = true;

WatchTransition(isEnter: true, continueWith);
}

/// <inheritdoc />
protected override void LeaveTransition(Action? continueWith = null)
public override void LeaveTransition(Action? continueWith = null)
{
_transitioningTo = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected TransitionBase(Type asComponent) : base(asComponent)
{
}

protected virtual void EnterTransition(Action? continueWith = null)
public virtual void EnterTransition(Action? continueWith = null)
{
if (_state != TransitionState.Default && _state != TransitionState.CanEnter) return;

Expand All @@ -104,7 +104,7 @@ protected virtual void EnterTransition(Action? continueWith = null)
});
}

protected virtual void LeaveTransition(Action? continueWith = null)
public virtual void LeaveTransition(Action? continueWith = null)
{
if (_state != TransitionState.Default && _state != TransitionState.CanLeave) return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{
private readonly ReactiveReference<string?> _binding;

private string _text = "Hello World!";
private string? _text = "Hello World!";

public SilentBinding()
{
Expand Down

0 comments on commit 4f507c9

Please sign in to comment.