Neighbourhood.omg.lol/Components/Layout/AvatarMenuLinks.razor

57 lines
No EOL
2 KiB
Text

@inject CustomAuthenticationStateProvider AuthStateProvider;
@inject State State;
<a class="m s row">
<i class="emoji medium" data-emoji="👋">👋</i>
<span>Hey, @(State.Name ?? "there").</span>
</a>
<a class="m s row" href="/directory">
<i class="square fa-duotone fa-address-book"></i>
<span>Address Directory</span>
</a>
@foreach (AddressResponseData address in State.AddressList ?? new List<AddressResponseData>()) {
<a class="row @(address == State.SelectedAddress ? "active" : "")" @onclick="() => State.SelectedAddress = address">
<img class="tiny circle avatar" src="https://profiles.cache.lol/@address.Address/picture" alt="@address.Address" />
<span class="address"><i class="fa-solid fa-fw fa-at tiny"></i>@address.Address</span>
</a>
if (address.Address == State.SelectedAddressName) {
<a class="indent row" href="/person/@State.SelectedAddressName#profile">
<i class="fa-solid fa-id-card"></i>
<span>Profile</span>
</a>
<a class="indent row" href="/person/@State.SelectedAddressName#statuses">
<i class="fa-solid fa-message-smile"></i>
<span>Statuslog</span>
</a>
<a class="indent row" href="/person/@State.SelectedAddressName#pics">
<i class="fa-solid fa-images"></i>
<span>Pics</span>
</a>
<a class="indent row" href="/person/@State.SelectedAddressName#now">
<i class="fa-duotone fa-seedling"></i>
<span>/Now</span>
</a>
}
}
@if (FeatureFlags.Following && State.IsAuthorized) {
<a class="m s row" href="/feed">
<i class="square fa-solid fa-list-timeline"></i>
<span>Feed</span>
</a>
<FollowingList class="m s"></FollowingList>
}
@if (State.IsAuthorized) {
<a class="row" @onclick='() => AuthStateProvider.Logout()'>
<i class="fa-solid fa-door-open"></i>
<span>Logout</span>
</a>
}
else {
<a class="row" href="/login">
<i class="fa-solid fa-door-closed"></i>
<span>Login</span>
</a>
}
<a class="row medium-opacity">
<i class="fa-solid fa-circle-info tiny"></i>
<small>@App.Name - @App.Version</small>
</a>