From 0b231ad38a99a1305e19a34482e4c8566960c6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Tue, 27 Aug 2024 21:36:43 +0200 Subject: [PATCH] Link to source code in sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/sidebar-menu.tsx | 31 ++++++++++++++++++++++++++--- src/components/thumb-navigation.tsx | 16 +++++++++------ src/locales/en.json | 1 + src/locales/pl.json | 1 + 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/components/sidebar-menu.tsx b/src/components/sidebar-menu.tsx index bf7fe784c..44fa178e9 100644 --- a/src/components/sidebar-menu.tsx +++ b/src/components/sidebar-menu.tsx @@ -13,10 +13,13 @@ import { Stack, Divider, HStack, Icon, Text } from 'soapbox/components/ui'; import ProfileStats from 'soapbox/features/ui/components/profile-stats'; import { useAppDispatch, useAppSelector, useFeatures, useInstance } from 'soapbox/hooks'; import { makeGetOtherAccounts } from 'soapbox/selectors'; +import sourceCode from 'soapbox/utils/code'; +import { isStandalone } from 'soapbox/utils/state'; import type { List as ImmutableList } from 'immutable'; import type { Account as AccountEntity } from 'soapbox/normalizers'; + const messages = defineMessages({ profile: { id: 'account.profile', defaultMessage: 'Profile' }, preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' }, @@ -36,6 +39,7 @@ const messages = defineMessages({ close: { id: 'lightbox.close', defaultMessage: 'Close' }, login: { id: 'account.login', defaultMessage: 'Log in' }, register: { id: 'account.register', defaultMessage: 'Sign up' }, + sourceCode: { id: 'navigation.source_code', defaultMessage: 'Source code' }, }); interface ISidebarLink { @@ -90,6 +94,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { const [sidebarVisible, setSidebarVisible] = useState(sidebarOpen); const touchStart = useRef(0); const touchEnd = useRef(null); + const standalone = useAppSelector(isStandalone); const instance = useInstance(); const restrictUnauth = instance.pleroma.metadata.restrict_unauthenticated; @@ -361,6 +366,15 @@ const SidebarMenu: React.FC = (): JSX.Element | null => { + + + +