From 5f4a9b5b45134b8429dbd9955c6a2c32e65fd95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sat, 4 May 2024 17:44:54 +0200 Subject: [PATCH] Remove links from footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- src/components/sidebar-navigation.tsx | 22 ++++- src/features/settings/index.tsx | 8 +- src/features/ui/components/link-footer.tsx | 93 +++++----------------- 3 files changed, 45 insertions(+), 78 deletions(-) diff --git a/src/components/sidebar-navigation.tsx b/src/components/sidebar-navigation.tsx index c32728ce7..7c81b3137 100644 --- a/src/components/sidebar-navigation.tsx +++ b/src/components/sidebar-navigation.tsx @@ -10,10 +10,12 @@ import DropdownMenu, { Menu } from './dropdown-menu'; import SidebarNavigationLink from './sidebar-navigation-link'; const messages = defineMessages({ - follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, + followRequests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' }, bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' }, lists: { id: 'column.lists', defaultMessage: 'Lists' }, events: { id: 'column.events', defaultMessage: 'Events' }, + profileDirectory: { id: 'navigation_bar.profile_directory', defaultMessage: 'Profile directory' }, + followedTags: { id: 'navigation_bar.followed_tags', defaultMessage: 'Followed hashtags' }, developers: { id: 'navigation.developers', defaultMessage: 'Developers' }, drafts: { id: 'navigation.drafts', defaultMessage: 'Drafts' }, }); @@ -42,7 +44,7 @@ const SidebarNavigation = () => { if (account.locked || followRequestsCount > 0) { menu.push({ to: '/follow_requests', - text: intl.formatMessage(messages.follow_requests), + text: intl.formatMessage(messages.followRequests), icon: require('@tabler/icons/outline/user-plus.svg'), count: followRequestsCount, }); @@ -72,6 +74,22 @@ const SidebarNavigation = () => { }); } + if (features.profileDirectory) { + menu.push({ + to: '/directory', + text: intl.formatMessage(messages.profileDirectory), + icon: require('@tabler/icons/outline/address-book.svg'), + }); + } + + if (features.followedHashtagsList) { + menu.push({ + to: '/followed_tags', + text: intl.formatMessage(messages.followedTags), + icon: require('@tabler/icons/outline/hash.svg'), + }); + } + if (isDeveloper) { menu.push({ to: '/developers', diff --git a/src/features/settings/index.tsx b/src/features/settings/index.tsx index 434445c4e..c61fdccd8 100644 --- a/src/features/settings/index.tsx +++ b/src/features/settings/index.tsx @@ -19,15 +19,17 @@ const messages = defineMessages({ changePassword: { id: 'settings.change_password', defaultMessage: 'Change Password' }, configureMfa: { id: 'settings.configure_mfa', defaultMessage: 'Configure MFA' }, deleteAccount: { id: 'settings.delete_account', defaultMessage: 'Delete Account' }, + domainBlocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' }, editProfile: { id: 'settings.edit_profile', defaultMessage: 'Edit Profile' }, exportData: { id: 'column.export_data', defaultMessage: 'Export data' }, + filters: { id: 'navigation_bar.filters', defaultMessage: 'Filters' }, importData: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' }, mfaDisabled: { id: 'mfa.disabled', defaultMessage: 'Disabled' }, mfaEnabled: { id: 'mfa.enabled', defaultMessage: 'Enabled' }, mutes: { id: 'settings.mutes', defaultMessage: 'Mutes' }, + mutesAndBlocks: { id: 'settings.mutes_blocks', defaultMessage: 'Mutes and blocks' }, other: { id: 'settings.other', defaultMessage: 'Other Options' }, preferences: { id: 'settings.preferences', defaultMessage: 'Preferences' }, - privacy: { id: 'settings.privacy', defaultMessage: 'Privacy' }, profile: { id: 'settings.profile', defaultMessage: 'Profile' }, security: { id: 'settings.security', defaultMessage: 'Security' }, sessions: { id: 'settings.sessions', defaultMessage: 'Active sessions' }, @@ -69,13 +71,15 @@ const Settings = () => { - + + {(features.filters || features.filtersV2) && } + {features.federating && } diff --git a/src/features/ui/components/link-footer.tsx b/src/features/ui/components/link-footer.tsx index 95654de0a..01ac4788a 100644 --- a/src/features/ui/components/link-footer.tsx +++ b/src/features/ui/components/link-footer.tsx @@ -1,88 +1,33 @@ -import clsx from 'clsx'; import React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Link } from 'react-router-dom'; -import { logOut } from 'soapbox/actions/auth'; import { Text } from 'soapbox/components/ui'; import emojify from 'soapbox/features/emoji'; -import { useSoapboxConfig, useOwnAccount, useFeatures, useAppDispatch } from 'soapbox/hooks'; +import { useSoapboxConfig } from 'soapbox/hooks'; import sourceCode from 'soapbox/utils/code'; -interface IFooterLink { - to: string; - className?: string; - onClick?: React.EventHandler; - children: React.ReactNode; -} - -const FooterLink: React.FC = ({ children, className, ...rest }): JSX.Element => { - return ( -
- {children} -
- ); -}; - const LinkFooter: React.FC = (): JSX.Element => { - const { account } = useOwnAccount(); - const features = useFeatures(); const soapboxConfig = useSoapboxConfig(); - const dispatch = useAppDispatch(); - - const onClickLogOut: React.EventHandler = (e) => { - dispatch(logOut()); - e.preventDefault(); - }; - return ( -
-
- {account && <> - {features.profileDirectory && ( - - )} - - - {(features.filters || features.filtersV2) && ( - - )} - {features.followedHashtagsList && ( - - )} - {features.federating && ( - - )} - {account.admin && ( - - )} - {account.locked && ( - - )} - - } -
- - - {soapboxConfig.linkFooterMessage ? ( - - ) : ( - {sourceCode.repository}, - code_version: sourceCode.version, - }} - /> - )} - -
+ + {soapboxConfig.linkFooterMessage ? ( + + ) : ( + {sourceCode.repository}, + code_version: sourceCode.version, + }} + /> + )} + ); };