SidebarNavigation: move local and fediverse tabs to top-level
Fixes https://gitlab.com/soapbox-pub/soapbox/-/issues/1091
This commit is contained in:
parent
25e7070705
commit
c7e04a6826
|
@ -10,7 +10,7 @@ interface ISidebarNavigationLink {
|
||||||
/** URL to an SVG icon. */
|
/** URL to an SVG icon. */
|
||||||
icon: string,
|
icon: string,
|
||||||
/** Link label. */
|
/** Link label. */
|
||||||
text: React.ReactElement,
|
text: React.ReactNode,
|
||||||
/** Route to an internal page. */
|
/** Route to an internal page. */
|
||||||
to?: string,
|
to?: string,
|
||||||
/** Callback when the link is clicked. */
|
/** Callback when the link is clicked. */
|
||||||
|
|
|
@ -16,8 +16,6 @@ const messages = defineMessages({
|
||||||
bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
|
bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
|
||||||
lists: { id: 'column.lists', defaultMessage: 'Lists' },
|
lists: { id: 'column.lists', defaultMessage: 'Lists' },
|
||||||
developers: { id: 'navigation.developers', defaultMessage: 'Developers' },
|
developers: { id: 'navigation.developers', defaultMessage: 'Developers' },
|
||||||
all: { id: 'tabs_bar.all', defaultMessage: 'All' },
|
|
||||||
fediverse: { id: 'tabs_bar.fediverse', defaultMessage: 'Fediverse' },
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/** Desktop sidebar with links to different views in the app. */
|
/** Desktop sidebar with links to different views in the app. */
|
||||||
|
@ -70,26 +68,6 @@ const SidebarNavigation = () => {
|
||||||
text: intl.formatMessage(messages.developers),
|
text: intl.formatMessage(messages.developers),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (features.publicTimeline) {
|
|
||||||
menu.push(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (features.publicTimeline) {
|
|
||||||
menu.push({
|
|
||||||
to: '/timeline/local',
|
|
||||||
icon: features.federating ? require('@tabler/icons/users.svg') : require('@tabler/icons/world.svg'),
|
|
||||||
text: features.federating ? instance.title : intl.formatMessage(messages.all),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (features.publicTimeline && features.federating) {
|
|
||||||
menu.push({
|
|
||||||
to: '/timeline/fediverse',
|
|
||||||
icon: require('assets/icons/fediverse.svg'),
|
|
||||||
text: intl.formatMessage(messages.fediverse),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
|
@ -172,6 +150,24 @@ const SidebarNavigation = () => {
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{features.publicTimeline && (
|
||||||
|
<>
|
||||||
|
<SidebarNavigationLink
|
||||||
|
to='/timeline/local'
|
||||||
|
icon={features.federating ? require('@tabler/icons/users.svg') : require('@tabler/icons/world.svg')}
|
||||||
|
text={features.federating ? instance.title : <FormattedMessage id='tabs_bar.all' defaultMessage='All' />}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{features.federating && (
|
||||||
|
<SidebarNavigationLink
|
||||||
|
to='/timeline/fediverse'
|
||||||
|
icon={require('assets/icons/fediverse.svg')}
|
||||||
|
text={<FormattedMessage id='tabs_bar.fediverse' defaultMessage='Fediverse' />}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
{menu.length > 0 && (
|
{menu.length > 0 && (
|
||||||
<DropdownMenu items={menu}>
|
<DropdownMenu items={menu}>
|
||||||
<SidebarNavigationLink
|
<SidebarNavigationLink
|
||||||
|
|
Loading…
Reference in New Issue