[Glitch] Add UI support for disabled live feeds

Port 2fa5dd6d1f to glitch-soc

Co-authored-by: diondiondion <mail@diondiondion.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-10-23 11:59:43 +02:00
parent deed31ba8c
commit b11bd2bdbb
6 changed files with 72 additions and 17 deletions

View File

@@ -47,6 +47,7 @@ import {
me,
} from 'flavours/glitch/initial_state';
import { transientSingleColumn } from 'flavours/glitch/is_mobile';
import { canViewFeed } from 'flavours/glitch/permissions';
import { selectUnreadNotificationGroupsCount } from 'flavours/glitch/selectors/notifications';
import { useAppSelector, useAppDispatch } from 'flavours/glitch/store';
@@ -208,7 +209,7 @@ export const NavigationPanel: React.FC<{ multiColumn?: boolean }> = ({
multiColumn = false,
}) => {
const intl = useIntl();
const { signedIn, disabledAccountId } = useIdentity();
const { signedIn, permissions, disabledAccountId } = useIdentity();
const location = useLocation();
const showSearch = useBreakpoint('full') && !multiColumn;
const dispatch = useAppDispatch();
@@ -286,13 +287,12 @@ export const NavigationPanel: React.FC<{ multiColumn?: boolean }> = ({
/>
)}
{(signedIn ||
localLiveFeedAccess === 'public' ||
remoteLiveFeedAccess === 'public') && (
{(canViewFeed(signedIn, permissions, localLiveFeedAccess) ||
canViewFeed(signedIn, permissions, remoteLiveFeedAccess)) && (
<ColumnLink
transparent
to={
signedIn || localLiveFeedAccess === 'public'
canViewFeed(signedIn, permissions, localLiveFeedAccess)
? '/public/local'
: '/public/remote'
}