nicolium: fix timeline display conditions
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -157,7 +157,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
const { isOpen } = useRegistrationStatus();
|
||||
|
||||
const instance = useInstance();
|
||||
const restrictUnauth = instance.pleroma.metadata.restrict_unauthenticated;
|
||||
const timelineAccess = instance.configuration.timelines_access;
|
||||
|
||||
const containerRef = React.useRef<HTMLDivElement>(null);
|
||||
|
||||
@ -388,20 +388,22 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
<>
|
||||
<Divider />
|
||||
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/local'
|
||||
icon={require('@phosphor-icons/core/regular/planet.svg')}
|
||||
text={
|
||||
features.federating ? (
|
||||
<FormattedMessage id='tabs_bar.local' defaultMessage='Local' />
|
||||
) : (
|
||||
<FormattedMessage id='tabs_bar.all' defaultMessage='All' />
|
||||
)
|
||||
}
|
||||
onClick={closeSidebar}
|
||||
/>
|
||||
{timelineAccess.live_feeds.local !== 'disabled' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/local'
|
||||
icon={require('@phosphor-icons/core/regular/planet.svg')}
|
||||
text={
|
||||
features.federating ? (
|
||||
<FormattedMessage id='tabs_bar.local' defaultMessage='Local' />
|
||||
) : (
|
||||
<FormattedMessage id='tabs_bar.all' defaultMessage='All' />
|
||||
)
|
||||
}
|
||||
onClick={closeSidebar}
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.bubbleTimeline && (
|
||||
{features.bubbleTimeline && timelineAccess.live_feeds.bubble !== 'disabled' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/bubble'
|
||||
icon={require('@phosphor-icons/core/regular/graph.svg')}
|
||||
@ -410,7 +412,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.federating && (
|
||||
{features.federating && timelineAccess.live_feeds.remote !== 'disabled' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/fediverse'
|
||||
icon={require('@phosphor-icons/core/regular/fediverse-logo.svg')}
|
||||
@ -419,14 +421,15 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.wrenchedTimeline && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/wrenched'
|
||||
icon={require('@phosphor-icons/core/regular/wrench.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.wrenched' defaultMessage='Wrenched' />}
|
||||
onClick={closeSidebar}
|
||||
/>
|
||||
)}
|
||||
{features.wrenchedTimeline &&
|
||||
timelineAccess.live_feeds.wrenched !== 'disabled' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/wrenched'
|
||||
icon={require('@phosphor-icons/core/regular/wrench.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.wrenched' defaultMessage='Wrenched' />}
|
||||
onClick={closeSidebar}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
@ -519,7 +522,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
{features.publicTimeline && !restrictUnauth.timelines.local && (
|
||||
{features.publicTimeline && timelineAccess.live_feeds.local === 'public' && (
|
||||
<>
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/local'
|
||||
@ -534,7 +537,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
onClick={closeSidebar}
|
||||
/>
|
||||
|
||||
{features.bubbleTimeline && !restrictUnauth.timelines.bubble && (
|
||||
{features.bubbleTimeline && timelineAccess.live_feeds.bubble === 'public' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/bubble'
|
||||
icon={require('@phosphor-icons/core/regular/graph.svg')}
|
||||
@ -543,7 +546,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.federating && !restrictUnauth.timelines.federated && (
|
||||
{features.federating && timelineAccess.live_feeds.remote === 'public' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/fediverse'
|
||||
icon={require('@phosphor-icons/core/regular/fediverse-logo.svg')}
|
||||
@ -552,7 +555,7 @@ const DropdownNavigation: React.FC = React.memo((): React.JSX.Element | null =>
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.wrenchedTimeline && !restrictUnauth.timelines.wrenched && (
|
||||
{features.wrenchedTimeline && timelineAccess.live_feeds.wrenched === 'public' && (
|
||||
<DropdownNavigationLink
|
||||
to='/timeline/wrenched'
|
||||
icon={require('@phosphor-icons/core/regular/wrench.svg')}
|
||||
|
||||
@ -91,7 +91,7 @@ const SidebarNavigation: React.FC<ISidebarNavigation> = React.memo(({ shrink })
|
||||
);
|
||||
const { data: draftCount = 0 } = useDraftStatusesCountQuery();
|
||||
|
||||
const restrictUnauth = instance.pleroma.metadata.restrict_unauthenticated;
|
||||
const timelineAccess = instance.configuration.timelines_access;
|
||||
|
||||
const menu = useMemo((): Menu => {
|
||||
const menu: Menu = [];
|
||||
@ -371,16 +371,21 @@ const SidebarNavigation: React.FC<ISidebarNavigation> = React.memo(({ shrink })
|
||||
|
||||
{features.publicTimeline && (
|
||||
<>
|
||||
{features.wrenchedTimeline && (account ?? !restrictUnauth.timelines.wrenched) && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/wrenched'
|
||||
icon={require('@phosphor-icons/core/regular/wrench.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/wrench-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.wrenched' defaultMessage='Wrenched' />}
|
||||
/>
|
||||
)}
|
||||
{features.wrenchedTimeline &&
|
||||
(account
|
||||
? timelineAccess.live_feeds.wrenched !== 'disabled'
|
||||
: timelineAccess.live_feeds.wrenched === 'public') && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/wrenched'
|
||||
icon={require('@phosphor-icons/core/regular/wrench.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/wrench-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.wrenched' defaultMessage='Wrenched' />}
|
||||
/>
|
||||
)}
|
||||
|
||||
{(account ?? !restrictUnauth.timelines.local) && (
|
||||
{(account
|
||||
? timelineAccess.live_feeds.local !== 'disabled'
|
||||
: timelineAccess.live_feeds.local === 'public') && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/local'
|
||||
icon={require('@phosphor-icons/core/regular/planet.svg')}
|
||||
@ -395,23 +400,29 @@ const SidebarNavigation: React.FC<ISidebarNavigation> = React.memo(({ shrink })
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.bubbleTimeline && (account ?? !restrictUnauth.timelines.bubble) && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/bubble'
|
||||
icon={require('@phosphor-icons/core/regular/graph.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/graph-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.bubble' defaultMessage='Bubble' />}
|
||||
/>
|
||||
)}
|
||||
{features.bubbleTimeline &&
|
||||
(account
|
||||
? timelineAccess.live_feeds.bubble !== 'disabled'
|
||||
: timelineAccess.live_feeds.bubble === 'public') && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/bubble'
|
||||
icon={require('@phosphor-icons/core/regular/graph.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/graph-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.bubble' defaultMessage='Bubble' />}
|
||||
/>
|
||||
)}
|
||||
|
||||
{features.federating && (account ?? !restrictUnauth.timelines.federated) && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/fediverse'
|
||||
icon={require('@phosphor-icons/core/regular/fediverse-logo.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/fediverse-logo-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.fediverse' defaultMessage='Fediverse' />}
|
||||
/>
|
||||
)}
|
||||
{features.federating &&
|
||||
(account
|
||||
? timelineAccess.live_feeds.remote !== 'disabled'
|
||||
: timelineAccess.live_feeds.remote === 'public') && (
|
||||
<SidebarNavigationLink
|
||||
to='/timeline/fediverse'
|
||||
icon={require('@phosphor-icons/core/regular/fediverse-logo.svg')}
|
||||
activeIcon={require('@phosphor-icons/core/fill/fediverse-logo-fill.svg')}
|
||||
text={<FormattedMessage id='tabs_bar.fediverse' defaultMessage='Fediverse' />}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user