diff --git a/app/soapbox/components/sidebar-navigation.tsx b/app/soapbox/components/sidebar-navigation.tsx index d436cb4cb9..e4d574a740 100644 --- a/app/soapbox/components/sidebar-navigation.tsx +++ b/app/soapbox/components/sidebar-navigation.tsx @@ -6,7 +6,6 @@ import { getSettings } from 'soapbox/actions/settings'; import DropdownMenu from 'soapbox/containers/dropdown_menu_container'; import ComposeButton from 'soapbox/features/ui/components/compose-button'; import { useAppSelector, useOwnAccount } from 'soapbox/hooks'; -import { getBaseURL } from 'soapbox/utils/accounts'; import { getFeatures } from 'soapbox/utils/features'; import SidebarNavigationLink from './sidebar-navigation-link'; @@ -23,7 +22,6 @@ const SidebarNavigation = () => { const followRequestsCount = useAppSelector((state) => state.user_lists.getIn(['follow_requests', 'items'], ImmutableOrderedSet()).count()); const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count()); - const baseURL = account ? getBaseURL(account) : ''; const features = getFeatures(instance); const makeMenu = (): Menu => { @@ -55,14 +53,6 @@ const SidebarNavigation = () => { }); } - if (instance.invites_enabled) { - menu.push({ - to: `${baseURL}/invites`, - icon: require('@tabler/icons/icons/mailbox.svg'), - text: , - }); - } - if (settings.get('isDeveloper')) { menu.push({ to: '/developers', diff --git a/app/soapbox/components/sidebar_menu.tsx b/app/soapbox/components/sidebar_menu.tsx index e407bdef76..2f8be96b1f 100644 --- a/app/soapbox/components/sidebar_menu.tsx +++ b/app/soapbox/components/sidebar_menu.tsx @@ -14,7 +14,6 @@ import { Stack } from 'soapbox/components/ui'; import ProfileStats from 'soapbox/features/ui/components/profile_stats'; import { useAppSelector, useFeatures } from 'soapbox/hooks'; import { makeGetAccount, makeGetOtherAccounts } from 'soapbox/selectors'; -import { getBaseURL } from 'soapbox/utils/accounts'; import { HStack, Icon, IconButton, Text } from './ui'; @@ -43,14 +42,15 @@ const messages = defineMessages({ }); interface ISidebarLink { - to: string, + href?: string, + to?: string, icon: string, text: string | JSX.Element, onClick: React.EventHandler, } -const SidebarLink: React.FC = ({ to, icon, text, onClick }) => ( - +const SidebarLink: React.FC = ({ href, to, icon, text, onClick }) => { + const body = (
@@ -58,8 +58,22 @@ const SidebarLink: React.FC = ({ to, icon, text, onClick }) => ( {text} - -); + ); + + if (to) { + return ( + + {body} + + ); + } + + return ( + + {body} + + ); +}; const getOtherAccounts = makeGetOtherAccounts(); @@ -76,8 +90,6 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { const sidebarOpen = useAppSelector((state) => state.sidebar.sidebarOpen); const settings = useAppSelector((state) => getSettings(state)); - const baseURL = account ? getBaseURL(account) : ''; - const closeButtonRef = React.useRef(null); const [switcher, setSwitcher] = React.useState(false); @@ -220,15 +232,6 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { /> )} - {instance.invites_enabled && ( - - )} - {settings.get('isDeveloper') && (