From 1ef6c55d441c8965a6cca52f9a7b77462123cdd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Mon, 25 Apr 2022 22:44:15 +0200 Subject: [PATCH] maybe add some links to sidebar menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/sidebar_menu.tsx | 50 +++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/app/soapbox/components/sidebar_menu.tsx b/app/soapbox/components/sidebar_menu.tsx index 2de745577f..ad9471e410 100644 --- a/app/soapbox/components/sidebar_menu.tsx +++ b/app/soapbox/components/sidebar_menu.tsx @@ -6,13 +6,14 @@ import { Link, NavLink } from 'react-router-dom'; import { logOut, switchAccount } from 'soapbox/actions/auth'; import { fetchOwnAccounts } from 'soapbox/actions/auth'; +import { getSettings } from 'soapbox/actions/settings'; +import { closeSidebar } from 'soapbox/actions/sidebar'; import Account from 'soapbox/components/account'; import { Stack } from 'soapbox/components/ui'; import ProfileStats from 'soapbox/features/ui/components/profile_stats'; import { useAppSelector, useSoapboxConfig, useFeatures } from 'soapbox/hooks'; - -import { closeSidebar } from '../actions/sidebar'; -import { makeGetAccount, makeGetOtherAccounts } from '../selectors'; +import { makeGetAccount, makeGetOtherAccounts } from 'soapbox/selectors'; +import { getBaseURL } from 'soapbox/utils/accounts'; import { HStack, Icon, IconButton, Text } from './ui'; @@ -32,6 +33,10 @@ const messages = defineMessages({ importData: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' }, accountMigration: { id: 'navigation_bar.account_migration', defaultMessage: 'Move account' }, logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, + bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' }, + lists: { id: 'column.lists', defaultMessage: 'Lists' }, + invites: { id: 'navigation_bar.invites', defaultMessage: 'Invites' }, + developers: { id: 'navigation.developers', defaultMessage: 'Developers' }, }); interface ISidebarLink { @@ -67,6 +72,9 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { const account = useAppSelector((state) => me ? getAccount(state, me) : null); const otherAccounts: ImmutableList = useAppSelector((state) => getOtherAccounts(state)); const sidebarOpen = useAppSelector((state) => state.sidebar.sidebarOpen); + const settings = useAppSelector((state) => getSettings(state)); + + const baseURL = account ? getBaseURL(account) : ''; const closeButtonRef = React.useRef(null); @@ -192,6 +200,42 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { onClick={onClose} /> + {features.bookmarks && ( + + )} + + {features.lists && ( + + )} + + {instance.invites_enabled && ( + + )} + + {settings.get('isDeveloper') && ( + + )} + {features.publicTimeline && <>