mirror of
https://github.com/status-im/nft-faucet.git
synced 2025-02-24 12:38:30 +00:00
21 lines
505 B
C#
21 lines
505 B
C#
|
using Microsoft.AspNetCore.Components;
|
||
|
|
||
|
namespace NftFaucet.Extensions;
|
||
|
|
||
|
public static class NavigationManagerExtensions
|
||
|
{
|
||
|
public static void NavigateToRelative(this NavigationManager uriHelper, string relativePath)
|
||
|
{
|
||
|
var newUri = uriHelper.BaseUri;
|
||
|
if (!newUri.EndsWith("/"))
|
||
|
newUri += "/";
|
||
|
|
||
|
if (relativePath.StartsWith("/"))
|
||
|
relativePath = relativePath.Substring(1);
|
||
|
|
||
|
newUri += relativePath;
|
||
|
|
||
|
uriHelper.NavigateTo(newUri);
|
||
|
}
|
||
|
}
|