feat: add plugin button and navigation slots for enhanced plugin integration across various components
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
import { CreateTab } from './sidebar/CreateTab';
|
||||
import { HiddenSpacesTabs } from './sidebar/SpaceTabs';
|
||||
import { useHomeHidden } from '../../hooks/useSidebarItems';
|
||||
import { PluginSidebarSlot } from '../../features/settings/plugins/PluginSidebarSlot';
|
||||
|
||||
export function SidebarNav() {
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
@@ -37,6 +38,7 @@ export function SidebarNav() {
|
||||
<SpaceTabs scrollRef={scrollRef} />
|
||||
<SidebarStackSeparator />
|
||||
<SidebarStack>
|
||||
<PluginSidebarSlot location="sidebar-actions" />
|
||||
<ExploreTab />
|
||||
<CreateTab />
|
||||
</SidebarStack>
|
||||
@@ -47,6 +49,7 @@ export function SidebarNav() {
|
||||
<>
|
||||
<SidebarStackSeparator />
|
||||
<SidebarStack>
|
||||
<PluginSidebarSlot location="sidebar-actions" />
|
||||
<SearchTab />
|
||||
<UnverifiedTab />
|
||||
<InboxTab />
|
||||
|
||||
@@ -44,6 +44,8 @@ import { useClosedNavCategoriesAtom } from '../../../state/hooks/closedNavCatego
|
||||
import { useRoomsUnread } from '../../../state/hooks/unread';
|
||||
import { useMarkRoomsAsRead } from '../../../hooks/useMarkAsRead';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { PluginButtonSlot } from '../../../features/settings/plugins/PluginButtonSlot';
|
||||
import { PluginNavSlot } from '../../../features/settings/plugins/PluginNavSlot';
|
||||
import { useSetting } from '../../../state/hooks/settings';
|
||||
import { settingsAtom } from '../../../state/settings';
|
||||
import {
|
||||
@@ -228,6 +230,7 @@ export function Direct() {
|
||||
</NavItemContent>
|
||||
</NavButton>
|
||||
</NavItem>
|
||||
<PluginNavSlot location="direct-messages" />
|
||||
</NavCategory>
|
||||
<NavCategory>
|
||||
<NavCategoryHeader>
|
||||
|
||||
@@ -57,6 +57,7 @@ import { useRoomsUnread } from '../../../state/hooks/unread';
|
||||
import { useMarkRoomsAsRead } from '../../../hooks/useMarkAsRead';
|
||||
import { useClosedNavCategoriesAtom } from '../../../state/hooks/closedNavCategories';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { PluginNavSlot } from '../../../features/settings/plugins/PluginNavSlot';
|
||||
import { useSetting } from '../../../state/hooks/settings';
|
||||
import { settingsAtom } from '../../../state/settings';
|
||||
import {
|
||||
@@ -152,7 +153,7 @@ function HomeHeader() {
|
||||
Home
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Box alignItems="Center" gap="100">
|
||||
<IconButton aria-pressed={!!menuAnchor} variant="Background" onClick={handleOpenMenu}>
|
||||
<Icon src={Icons.VerticalDots} size="200" />
|
||||
</IconButton>
|
||||
@@ -409,6 +410,7 @@ export function Home() {
|
||||
</NavItemContent>
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
<PluginNavSlot location="channel-list" />
|
||||
</NavCategory>
|
||||
<NavCategory>
|
||||
<NavCategoryHeader>
|
||||
@@ -420,6 +422,7 @@ export function Home() {
|
||||
Rooms
|
||||
</RoomNavCategoryButton>
|
||||
</NavCategoryHeader>
|
||||
<PluginNavSlot location="home-section" />
|
||||
<div
|
||||
style={{
|
||||
position: 'relative',
|
||||
|
||||
@@ -82,6 +82,7 @@ import { useMentionClickHandler } from '../../../hooks/useMentionClickHandler';
|
||||
import { useSpoilerClickHandler } from '../../../hooks/useSpoilerClickHandler';
|
||||
import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize';
|
||||
import { BackRouteHandler } from '../../../components/BackRouteHandler';
|
||||
import { PluginButtonSlot } from '../../../features/settings/plugins/PluginButtonSlot';
|
||||
import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
|
||||
import { allRoomsAtom } from '../../../state/room-list/roomList';
|
||||
import { usePowerLevels } from '../../../hooks/usePowerLevels';
|
||||
@@ -701,7 +702,9 @@ export function Notifications() {
|
||||
Notification Messages
|
||||
</Text>
|
||||
</Box>
|
||||
<Box grow="Yes" basis="No" />
|
||||
<Box grow="Yes" basis="No" justifyContent="End" alignItems="Center">
|
||||
<PluginButtonSlot location="search-notification-section" />
|
||||
</Box>
|
||||
</Box>
|
||||
</PageHeader>
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ import { useUserProfile } from '../../../hooks/useUserProfile';
|
||||
import { Modal500 } from '../../../components/Modal500';
|
||||
import { AccountSwitcher } from '../../../components/account-switcher';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { PluginButtonSlot } from '../../../features/settings/plugins/PluginButtonSlot';
|
||||
import { getLoginPath } from '../../pathUtils';
|
||||
import { logoutClient } from '../../../../client/initMatrix';
|
||||
import { CustomStatusDialog } from '../../../components/custom-status';
|
||||
@@ -110,6 +111,10 @@ export function SettingsTab() {
|
||||
</MenuItem>
|
||||
</Box>
|
||||
<Line variant="Surface" size="300" />
|
||||
<Box direction="Row" gap="100" style={{ padding: config.space.S100 }}>
|
||||
<PluginButtonSlot location="user-menu" />
|
||||
</Box>
|
||||
<Line variant="Surface" size="300" />
|
||||
<Box direction="Column" gap="100" style={{ padding: config.space.S100 }}>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
|
||||
@@ -68,6 +68,7 @@ import { useClosedNavCategoriesAtom } from '../../../state/hooks/closedNavCatego
|
||||
import { useStateEvent } from '../../../hooks/useStateEvent';
|
||||
import { Membership, StateEvent } from '../../../../types/matrix/room';
|
||||
import { stopPropagation } from '../../../utils/keyboard';
|
||||
import { PluginNavSlot } from '../../../features/settings/plugins/PluginNavSlot';
|
||||
import { getMatrixToRoom } from '../../../plugins/matrix-to';
|
||||
import { getViaServers } from '../../../plugins/via-servers';
|
||||
import { useSetting } from '../../../state/hooks/settings';
|
||||
@@ -549,6 +550,7 @@ export function Space() {
|
||||
</NavItemContent>
|
||||
</NavLink>
|
||||
</NavItem>
|
||||
<PluginNavSlot location="channel-list" />
|
||||
</NavCategory>
|
||||
<NavCategory
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user