diff --git a/web/app-list/app-list-item.react.js b/web/app-list/app-list-item.react.js --- a/web/app-list/app-list-item.react.js +++ b/web/app-list/app-list-item.react.js @@ -10,10 +10,10 @@ import css from './app-list-item.css'; import { useSelector } from '../redux/redux-utils.js'; import { navTabSelector } from '../selectors/nav-selectors.js'; -import type { NavigationTab } from '../types/nav-types.js'; +import type { WebNavigationTab } from '../types/nav-types.js'; type Props = { - +id: NavigationTab, + +id: WebNavigationTab, +name: string, +icon: Icon, +onClick: () => mixed, diff --git a/web/selectors/nav-selectors.js b/web/selectors/nav-selectors.js --- a/web/selectors/nav-selectors.js +++ b/web/selectors/nav-selectors.js @@ -10,7 +10,7 @@ import type { AppState } from '../redux/redux-setup.js'; import { - type NavigationTab, + type WebNavigationTab, type NavigationSettingsSection, } from '../types/nav-types.js'; @@ -117,7 +117,7 @@ }, ); -function navTabSelector(state: AppState): NavigationTab { +function navTabSelector(state: AppState): WebNavigationTab { return state.navInfo.tab; } diff --git a/web/sidebar/community-drawer-item-community-handlers.react.js b/web/sidebar/community-drawer-item-community-handlers.react.js --- a/web/sidebar/community-drawer-item-community-handlers.react.js +++ b/web/sidebar/community-drawer-item-community-handlers.react.js @@ -17,7 +17,7 @@ useOnClickThread, useThreadIsActive, } from '../selectors/thread-selectors.js'; -import type { NavigationTab } from '../types/nav-types.js'; +import type { WebNavigationTab } from '../types/nav-types.js'; export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemCommunityHandler) => void, @@ -99,14 +99,14 @@ } const communityDrawerItemCommunityHandlers: { - +[tab: NavigationTab]: React.ComponentType, + +[tab: WebNavigationTab]: React.ComponentType, } = Object.freeze({ chat: ChatDrawerItemCommunityHandler, calendar: CalendarDrawerItemCommunityHandler, }); function getCommunityDrawerItemCommunityHandler( - tab: NavigationTab, + tab: WebNavigationTab, ): React.ComponentType { return ( communityDrawerItemCommunityHandlers[tab] ?? ChatDrawerItemCommunityHandler diff --git a/web/sidebar/community-drawer-item-handlers.react.js b/web/sidebar/community-drawer-item-handlers.react.js --- a/web/sidebar/community-drawer-item-handlers.react.js +++ b/web/sidebar/community-drawer-item-handlers.react.js @@ -10,7 +10,7 @@ useOnClickThread, useThreadIsActive, } from '../selectors/thread-selectors.js'; -import type { NavigationTab } from '../types/nav-types.js'; +import type { WebNavigationTab } from '../types/nav-types.js'; export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemHandler) => void, @@ -59,14 +59,14 @@ } const communityDrawerItemHandlers: { - +[tab: NavigationTab]: React.ComponentType, + +[tab: WebNavigationTab]: React.ComponentType, } = Object.freeze({ chat: ChatDrawerItemHandler, calendar: CalendarDrawerItemHandler, }); function getCommunityDrawerItemHandler( - tab: NavigationTab, + tab: WebNavigationTab, ): React.ComponentType { return communityDrawerItemHandlers[tab] ?? ChatDrawerItemHandler; } diff --git a/web/sidebar/community-drawer-item.react.js b/web/sidebar/community-drawer-item.react.js --- a/web/sidebar/community-drawer-item.react.js +++ b/web/sidebar/community-drawer-item.react.js @@ -15,13 +15,13 @@ getExpandButton, } from './community-drawer-utils.react.js'; import ThreadAvatar from '../avatars/thread-avatar.react.js'; -import type { NavigationTab } from '../types/nav-types.js'; +import type { WebNavigationTab } from '../types/nav-types.js'; export type DrawerItemProps = { +itemData: CommunityDrawerItemData, +paddingLeft: number, +expandable?: boolean, - +handlerType: NavigationTab, + +handlerType: WebNavigationTab, }; function CommunityDrawerItem(props: DrawerItemProps): React.Node { diff --git a/web/sidebar/community-drawer-utils.react.js b/web/sidebar/community-drawer-utils.react.js --- a/web/sidebar/community-drawer-utils.react.js +++ b/web/sidebar/community-drawer-utils.react.js @@ -9,7 +9,7 @@ import CommunityDrawerItemChat from './community-drawer-item.react.js'; import { ExpandButton } from './expand-buttons.react.js'; import SubchannelsButton from './subchannels-button.react.js'; -import type { NavigationTab } from '../types/nav-types.js'; +import type { WebNavigationTab } from '../types/nav-types.js'; const indentation = 14; const subchannelsButtonIndentation = 24; @@ -29,7 +29,7 @@ paddingLeft: number, threadInfo: ThreadInfo, expandable: boolean, - handlerType: NavigationTab, + handlerType: WebNavigationTab, }): React.Node { if (!expanded) { return null; diff --git a/web/types/nav-types.js b/web/types/nav-types.js --- a/web/types/nav-types.js +++ b/web/types/nav-types.js @@ -12,8 +12,8 @@ } from 'lib/types/user-types.js'; import { tID, tShape } from 'lib/utils/validation-utils.js'; -export type NavigationTab = 'calendar' | 'chat' | 'settings'; -const navigationTabValidator = t.enums.of(['calendar', 'chat', 'settings']); +export type WebNavigationTab = 'calendar' | 'chat' | 'settings'; +const webNavigationTabValidator = t.enums.of(['calendar', 'chat', 'settings']); export type LoginMethod = 'form' | 'qr-code'; const loginMethodValidator = t.enums.of(['form', 'qr-code']); @@ -36,7 +36,7 @@ export type NavInfo = { ...$Exact, - +tab: NavigationTab, + +tab: WebNavigationTab, +activeChatThreadID: ?string, +pendingThread?: ThreadInfo, +settingsSection?: NavigationSettingsSection, @@ -49,7 +49,7 @@ export const navInfoValidator: TInterface = tShape<$Exact>({ startDate: t.String, endDate: t.String, - tab: navigationTabValidator, + tab: webNavigationTabValidator, activeChatThreadID: t.maybe(tID), pendingThread: t.maybe(threadInfoValidator), settingsSection: t.maybe(navigationSettingsSectionValidator),