Remove links from footer
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
4b3cc9e67b
commit
5f4a9b5b45
3 changed files with 45 additions and 78 deletions
|
@ -10,10 +10,12 @@ import DropdownMenu, { Menu } from './dropdown-menu';
|
||||||
import SidebarNavigationLink from './sidebar-navigation-link';
|
import SidebarNavigationLink from './sidebar-navigation-link';
|
||||||
|
|
||||||
const messages = defineMessages({
|
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' },
|
bookmarks: { id: 'column.bookmarks', defaultMessage: 'Bookmarks' },
|
||||||
lists: { id: 'column.lists', defaultMessage: 'Lists' },
|
lists: { id: 'column.lists', defaultMessage: 'Lists' },
|
||||||
events: { id: 'column.events', defaultMessage: 'Events' },
|
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' },
|
developers: { id: 'navigation.developers', defaultMessage: 'Developers' },
|
||||||
drafts: { id: 'navigation.drafts', defaultMessage: 'Drafts' },
|
drafts: { id: 'navigation.drafts', defaultMessage: 'Drafts' },
|
||||||
});
|
});
|
||||||
|
@ -42,7 +44,7 @@ const SidebarNavigation = () => {
|
||||||
if (account.locked || followRequestsCount > 0) {
|
if (account.locked || followRequestsCount > 0) {
|
||||||
menu.push({
|
menu.push({
|
||||||
to: '/follow_requests',
|
to: '/follow_requests',
|
||||||
text: intl.formatMessage(messages.follow_requests),
|
text: intl.formatMessage(messages.followRequests),
|
||||||
icon: require('@tabler/icons/outline/user-plus.svg'),
|
icon: require('@tabler/icons/outline/user-plus.svg'),
|
||||||
count: followRequestsCount,
|
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) {
|
if (isDeveloper) {
|
||||||
menu.push({
|
menu.push({
|
||||||
to: '/developers',
|
to: '/developers',
|
||||||
|
|
|
@ -19,15 +19,17 @@ const messages = defineMessages({
|
||||||
changePassword: { id: 'settings.change_password', defaultMessage: 'Change Password' },
|
changePassword: { id: 'settings.change_password', defaultMessage: 'Change Password' },
|
||||||
configureMfa: { id: 'settings.configure_mfa', defaultMessage: 'Configure MFA' },
|
configureMfa: { id: 'settings.configure_mfa', defaultMessage: 'Configure MFA' },
|
||||||
deleteAccount: { id: 'settings.delete_account', defaultMessage: 'Delete Account' },
|
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' },
|
editProfile: { id: 'settings.edit_profile', defaultMessage: 'Edit Profile' },
|
||||||
exportData: { id: 'column.export_data', defaultMessage: 'Export data' },
|
exportData: { id: 'column.export_data', defaultMessage: 'Export data' },
|
||||||
|
filters: { id: 'navigation_bar.filters', defaultMessage: 'Filters' },
|
||||||
importData: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' },
|
importData: { id: 'navigation_bar.import_data', defaultMessage: 'Import data' },
|
||||||
mfaDisabled: { id: 'mfa.disabled', defaultMessage: 'Disabled' },
|
mfaDisabled: { id: 'mfa.disabled', defaultMessage: 'Disabled' },
|
||||||
mfaEnabled: { id: 'mfa.enabled', defaultMessage: 'Enabled' },
|
mfaEnabled: { id: 'mfa.enabled', defaultMessage: 'Enabled' },
|
||||||
mutes: { id: 'settings.mutes', defaultMessage: 'Mutes' },
|
mutes: { id: 'settings.mutes', defaultMessage: 'Mutes' },
|
||||||
|
mutesAndBlocks: { id: 'settings.mutes_blocks', defaultMessage: 'Mutes and blocks' },
|
||||||
other: { id: 'settings.other', defaultMessage: 'Other Options' },
|
other: { id: 'settings.other', defaultMessage: 'Other Options' },
|
||||||
preferences: { id: 'settings.preferences', defaultMessage: 'Preferences' },
|
preferences: { id: 'settings.preferences', defaultMessage: 'Preferences' },
|
||||||
privacy: { id: 'settings.privacy', defaultMessage: 'Privacy' },
|
|
||||||
profile: { id: 'settings.profile', defaultMessage: 'Profile' },
|
profile: { id: 'settings.profile', defaultMessage: 'Profile' },
|
||||||
security: { id: 'settings.security', defaultMessage: 'Security' },
|
security: { id: 'settings.security', defaultMessage: 'Security' },
|
||||||
sessions: { id: 'settings.sessions', defaultMessage: 'Active sessions' },
|
sessions: { id: 'settings.sessions', defaultMessage: 'Active sessions' },
|
||||||
|
@ -69,13 +71,15 @@ const Settings = () => {
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardTitle title={intl.formatMessage(messages.privacy)} />
|
<CardTitle title={intl.formatMessage(messages.mutesAndBlocks)} />
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<List>
|
<List>
|
||||||
<ListItem label={intl.formatMessage(messages.mutes)} to='/mutes' />
|
<ListItem label={intl.formatMessage(messages.mutes)} to='/mutes' />
|
||||||
<ListItem label={intl.formatMessage(messages.blocks)} to='/blocks' />
|
<ListItem label={intl.formatMessage(messages.blocks)} to='/blocks' />
|
||||||
|
{(features.filters || features.filtersV2) && <ListItem label={intl.formatMessage(messages.filters)} to='/filters' />}
|
||||||
|
{features.federating && <ListItem label={intl.formatMessage(messages.domainBlocks)} to='/domain_blocks' />}
|
||||||
</List>
|
</List>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
|
|
||||||
|
|
|
@ -1,88 +1,33 @@
|
||||||
import clsx from 'clsx';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { Link } from 'react-router-dom';
|
|
||||||
|
|
||||||
import { logOut } from 'soapbox/actions/auth';
|
|
||||||
import { Text } from 'soapbox/components/ui';
|
import { Text } from 'soapbox/components/ui';
|
||||||
import emojify from 'soapbox/features/emoji';
|
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';
|
import sourceCode from 'soapbox/utils/code';
|
||||||
|
|
||||||
interface IFooterLink {
|
|
||||||
to: string;
|
|
||||||
className?: string;
|
|
||||||
onClick?: React.EventHandler<React.MouseEvent>;
|
|
||||||
children: React.ReactNode;
|
|
||||||
}
|
|
||||||
|
|
||||||
const FooterLink: React.FC<IFooterLink> = ({ children, className, ...rest }): JSX.Element => {
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<Link className={clsx('text-gray-700 hover:text-gray-800 hover:underline dark:text-gray-600 dark:hover:text-gray-500', className)} {...rest}>{children}</Link>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const LinkFooter: React.FC = (): JSX.Element => {
|
const LinkFooter: React.FC = (): JSX.Element => {
|
||||||
const { account } = useOwnAccount();
|
|
||||||
const features = useFeatures();
|
|
||||||
const soapboxConfig = useSoapboxConfig();
|
const soapboxConfig = useSoapboxConfig();
|
||||||
|
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
|
|
||||||
const onClickLogOut: React.EventHandler<React.MouseEvent> = (e) => {
|
|
||||||
dispatch(logOut());
|
|
||||||
e.preventDefault();
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='space-y-2'>
|
<Text theme='muted' size='sm'>
|
||||||
<div className='divide-x-dot flex flex-wrap items-center text-gray-600'>
|
{soapboxConfig.linkFooterMessage ? (
|
||||||
{account && <>
|
<span
|
||||||
{features.profileDirectory && (
|
className='inline-block align-middle'
|
||||||
<FooterLink to='/directory'><FormattedMessage id='navigation_bar.profile_directory' defaultMessage='Profile directory' /></FooterLink>
|
dangerouslySetInnerHTML={{ __html: emojify(soapboxConfig.linkFooterMessage) }}
|
||||||
)}
|
/>
|
||||||
<FooterLink to='/blocks'><FormattedMessage id='navigation_bar.blocks' defaultMessage='Blocks' /></FooterLink>
|
) : (
|
||||||
<FooterLink to='/mutes'><FormattedMessage id='navigation_bar.mutes' defaultMessage='Mutes' /></FooterLink>
|
<FormattedMessage
|
||||||
{(features.filters || features.filtersV2) && (
|
id='getting_started.open_source_notice'
|
||||||
<FooterLink to='/filters'><FormattedMessage id='navigation_bar.filters' defaultMessage='Filters' /></FooterLink>
|
defaultMessage='{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).'
|
||||||
)}
|
values={{
|
||||||
{features.followedHashtagsList && (
|
code_name: sourceCode.displayName,
|
||||||
<FooterLink to='/followed_tags'><FormattedMessage id='navigation_bar.followed_tags' defaultMessage='Followed hashtags' /></FooterLink>
|
code_link: <Text theme='subtle' tag='span'><a className='underline' href={sourceCode.url} rel='noopener' target='_blank'>{sourceCode.repository}</a></Text>,
|
||||||
)}
|
code_version: sourceCode.version,
|
||||||
{features.federating && (
|
}}
|
||||||
<FooterLink to='/domain_blocks'><FormattedMessage id='navigation_bar.domain_blocks' defaultMessage='Domain blocks' /></FooterLink>
|
/>
|
||||||
)}
|
)}
|
||||||
{account.admin && (
|
</Text>
|
||||||
<FooterLink to='/soapbox/config'><FormattedMessage id='navigation_bar.soapbox_config' defaultMessage='Soapbox config' /></FooterLink>
|
|
||||||
)}
|
|
||||||
{account.locked && (
|
|
||||||
<FooterLink to='/follow_requests'><FormattedMessage id='navigation_bar.follow_requests' defaultMessage='Follow requests' /></FooterLink>
|
|
||||||
)}
|
|
||||||
<FooterLink to='/logout' onClick={onClickLogOut}><FormattedMessage id='navigation_bar.logout' defaultMessage='Logout' /></FooterLink>
|
|
||||||
</>}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Text theme='muted' size='sm'>
|
|
||||||
{soapboxConfig.linkFooterMessage ? (
|
|
||||||
<span
|
|
||||||
className='inline-block align-middle'
|
|
||||||
dangerouslySetInnerHTML={{ __html: emojify(soapboxConfig.linkFooterMessage) }}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<FormattedMessage
|
|
||||||
id='getting_started.open_source_notice'
|
|
||||||
defaultMessage='{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).'
|
|
||||||
values={{
|
|
||||||
code_name: sourceCode.displayName,
|
|
||||||
code_link: <Text theme='subtle' tag='span'><a className='underline' href={sourceCode.url} rel='noopener' target='_blank'>{sourceCode.repository}</a></Text>,
|
|
||||||
code_version: sourceCode.version,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Text>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue