Link to /follow_requests in SidebarMenu
Signed-off-by: marcin mikolajczak <git@mkljczk.pl>
This commit is contained in:
parent
dde9188afb
commit
859f39a9d3
1 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,7 @@ const messages = defineMessages({
|
||||||
invites: { id: 'navigation_bar.invites', defaultMessage: 'Invites' },
|
invites: { id: 'navigation_bar.invites', defaultMessage: 'Invites' },
|
||||||
developers: { id: 'navigation.developers', defaultMessage: 'Developers' },
|
developers: { id: 'navigation.developers', defaultMessage: 'Developers' },
|
||||||
addAccount: { id: 'profile_dropdown.add_account', defaultMessage: 'Add an existing account' },
|
addAccount: { id: 'profile_dropdown.add_account', defaultMessage: 'Add an existing account' },
|
||||||
|
followRequests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },
|
||||||
});
|
});
|
||||||
|
|
||||||
interface ISidebarLink {
|
interface ISidebarLink {
|
||||||
|
@ -87,6 +88,7 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
|
||||||
const otherAccounts: ImmutableList<AccountEntity> = useAppSelector((state) => getOtherAccounts(state));
|
const otherAccounts: ImmutableList<AccountEntity> = useAppSelector((state) => getOtherAccounts(state));
|
||||||
const sidebarOpen = useAppSelector((state) => state.sidebar.sidebarOpen);
|
const sidebarOpen = useAppSelector((state) => state.sidebar.sidebarOpen);
|
||||||
const settings = useAppSelector((state) => getSettings(state));
|
const settings = useAppSelector((state) => getSettings(state));
|
||||||
|
const followRequestsCount = useAppSelector((state) => state.user_lists.follow_requests.items.count());
|
||||||
|
|
||||||
const closeButtonRef = React.useRef(null);
|
const closeButtonRef = React.useRef(null);
|
||||||
|
|
||||||
|
@ -177,6 +179,15 @@ const SidebarMenu: React.FC = (): JSX.Element | null => {
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{(account.locked || followRequestsCount > 0) && (
|
||||||
|
<SidebarLink
|
||||||
|
to='/follow_requests'
|
||||||
|
icon={require('@tabler/icons/user-plus.svg')}
|
||||||
|
text={intl.formatMessage(messages.followRequests)}
|
||||||
|
onClick={onClose}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
{features.bookmarks && (
|
{features.bookmarks && (
|
||||||
<SidebarLink
|
<SidebarLink
|
||||||
to='/bookmarks'
|
to='/bookmarks'
|
||||||
|
|
Loading…
Reference in a new issue