Add "Collections" link to main navigation (#38065)
This commit is contained in:
@@ -14,6 +14,8 @@ import AddIcon from '@/material-icons/400-24px/add.svg?react';
|
|||||||
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
|
import AlternateEmailIcon from '@/material-icons/400-24px/alternate_email.svg?react';
|
||||||
import BookmarksActiveIcon from '@/material-icons/400-24px/bookmarks-fill.svg?react';
|
import BookmarksActiveIcon from '@/material-icons/400-24px/bookmarks-fill.svg?react';
|
||||||
import BookmarksIcon from '@/material-icons/400-24px/bookmarks.svg?react';
|
import BookmarksIcon from '@/material-icons/400-24px/bookmarks.svg?react';
|
||||||
|
import CollectionsActiveIcon from '@/material-icons/400-24px/category-fill.svg?react';
|
||||||
|
import CollectionsIcon from '@/material-icons/400-24px/category.svg?react';
|
||||||
import HomeActiveIcon from '@/material-icons/400-24px/home-fill.svg?react';
|
import HomeActiveIcon from '@/material-icons/400-24px/home-fill.svg?react';
|
||||||
import HomeIcon from '@/material-icons/400-24px/home.svg?react';
|
import HomeIcon from '@/material-icons/400-24px/home.svg?react';
|
||||||
import InfoIcon from '@/material-icons/400-24px/info.svg?react';
|
import InfoIcon from '@/material-icons/400-24px/info.svg?react';
|
||||||
@@ -48,6 +50,7 @@ import { selectUnreadNotificationGroupsCount } from 'mastodon/selectors/notifica
|
|||||||
import { useAppSelector, useAppDispatch } from 'mastodon/store';
|
import { useAppSelector, useAppDispatch } from 'mastodon/store';
|
||||||
|
|
||||||
import { AnnualReportNavItem } from '../annual_report/nav_item';
|
import { AnnualReportNavItem } from '../annual_report/nav_item';
|
||||||
|
import { areCollectionsEnabled } from '../collections/utils';
|
||||||
|
|
||||||
import { DisabledAccountBanner } from './components/disabled_account_banner';
|
import { DisabledAccountBanner } from './components/disabled_account_banner';
|
||||||
import { FollowedTagsPanel } from './components/followed_tags_panel';
|
import { FollowedTagsPanel } from './components/followed_tags_panel';
|
||||||
@@ -71,6 +74,10 @@ const messages = defineMessages({
|
|||||||
direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },
|
direct: { id: 'navigation_bar.direct', defaultMessage: 'Private mentions' },
|
||||||
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' },
|
favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favorites' },
|
||||||
bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },
|
bookmarks: { id: 'navigation_bar.bookmarks', defaultMessage: 'Bookmarks' },
|
||||||
|
collections: {
|
||||||
|
id: 'navigation_bar.collections',
|
||||||
|
defaultMessage: 'Collections',
|
||||||
|
},
|
||||||
preferences: {
|
preferences: {
|
||||||
id: 'navigation_bar.preferences',
|
id: 'navigation_bar.preferences',
|
||||||
defaultMessage: 'Preferences',
|
defaultMessage: 'Preferences',
|
||||||
@@ -325,6 +332,16 @@ export const NavigationPanel: React.FC<{ multiColumn?: boolean }> = ({
|
|||||||
activeIconComponent={BookmarksActiveIcon}
|
activeIconComponent={BookmarksActiveIcon}
|
||||||
text={intl.formatMessage(messages.bookmarks)}
|
text={intl.formatMessage(messages.bookmarks)}
|
||||||
/>
|
/>
|
||||||
|
{areCollectionsEnabled() && (
|
||||||
|
<ColumnLink
|
||||||
|
transparent
|
||||||
|
to='/collections'
|
||||||
|
icon='collections'
|
||||||
|
iconComponent={CollectionsIcon}
|
||||||
|
activeIconComponent={CollectionsActiveIcon}
|
||||||
|
text={intl.formatMessage(messages.collections)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<ColumnLink
|
<ColumnLink
|
||||||
transparent
|
transparent
|
||||||
to='/conversations'
|
to='/conversations'
|
||||||
|
|||||||
@@ -772,6 +772,7 @@
|
|||||||
"navigation_bar.automated_deletion": "Automated post deletion",
|
"navigation_bar.automated_deletion": "Automated post deletion",
|
||||||
"navigation_bar.blocks": "Blocked users",
|
"navigation_bar.blocks": "Blocked users",
|
||||||
"navigation_bar.bookmarks": "Bookmarks",
|
"navigation_bar.bookmarks": "Bookmarks",
|
||||||
|
"navigation_bar.collections": "Collections",
|
||||||
"navigation_bar.direct": "Private mentions",
|
"navigation_bar.direct": "Private mentions",
|
||||||
"navigation_bar.domain_blocks": "Blocked domains",
|
"navigation_bar.domain_blocks": "Blocked domains",
|
||||||
"navigation_bar.favourites": "Favorites",
|
"navigation_bar.favourites": "Favorites",
|
||||||
|
|||||||
1
app/javascript/material-icons/400-24px/category-fill.svg
Normal file
1
app/javascript/material-icons/400-24px/category-fill.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m260-520 220-360 220 360H260ZM700-80q-75 0-127.5-52.5T520-260q0-75 52.5-127.5T700-440q75 0 127.5 52.5T880-260q0 75-52.5 127.5T700-80Zm-580-20v-320h320v320H120Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 265 B |
1
app/javascript/material-icons/400-24px/category.svg
Normal file
1
app/javascript/material-icons/400-24px/category.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24"><path d="m260-520 220-360 220 360H260ZM700-80q-75 0-127.5-52.5T520-260q0-75 52.5-127.5T700-440q75 0 127.5 52.5T880-260q0 75-52.5 127.5T700-80Zm-580-20v-320h320v320H120Zm580-60q42 0 71-29t29-71q0-42-29-71t-71-29q-42 0-71 29t-29 71q0 42 29 71t71 29Zm-500-20h160v-160H200v160Zm202-420h156l-78-126-78 126Zm78 0ZM360-340Zm340 80Z"/></svg>
|
||||||
|
After Width: | Height: | Size: 421 B |
Reference in New Issue
Block a user