Files
decePubClient/Components/ToastHost.razor
T
thepraandClaude Opus 5.5 ed3bf57e5b Small screens, small things; CLAUDE.md on phones
On touch the "on the wall of" link gets a 44px hit area (it truncates, so padding), an event's venue address wraps,
and on a phone toasts sit above the round New post button. A table's scroll box and the administration's statistics
strip are marked as strips that scroll sideways on purpose (data-scroll-x), which the phone sweep allows. CLAUDE.md gains
a Phones section: width variants for layout and the pointer for hit sizes, touch.css, the 44px rule, the bottom sheets
(ResponsiveBottom, SheetOnNarrow, PhoneSheet), Back closing overlays (IDOverlayHost, OverlayService), ConfirmService,
what a tap does on touch, the feed on a phone; and the phone tests under Testing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
2026-10-07 00:20:56 +02:00

43 lines
1.3 KiB
Plaintext

@implements IDisposable
@* Shows ToastService's messages at the bottom end of the screen. Placed once, in MainLayout. *@
@if (Toast.Messages.Count > 0)
{
@* (on a phone above the round New post button) *@
<DToast class="z-[1000] max-md:bottom-20">
@foreach (var message in Toast.Messages)
{
<DAlert @key="message.Id" Color="ColorOf(message.Severity)" class="max-w-sm">
<ChildContent>
<span class="break-words">@message.Text</span>
</ChildContent>
<Actions>
<DButton Size="DSize.Xs" Shape="DButtonShape.Circle" Variant="DButtonVariant.Ghost" aria-label="@Localizer["Close"]"
OnClick="() => Toast.Close(message.Id)">
<i class="ion-md-close"></i>
</DButton>
</Actions>
</DAlert>
}
</DToast>
}
@code {
[Inject] ToastService Toast { get; set; }
[Inject] CoalescingStringLocalizer Localizer { get; set; }
protected override void OnInitialized() => Toast.Changed += OnChanged;
void OnChanged() => _ = InvokeAsync(StateHasChanged);
static DAlertColor ColorOf(ToastSeverity severity) => severity switch
{
ToastSeverity.Success => DAlertColor.Success,
ToastSeverity.Warning => DAlertColor.Warning,
ToastSeverity.Error => DAlertColor.Error,
_ => DAlertColor.Info
};
public void Dispose() => Toast.Changed -= OnChanged;
}