Changeset View
Changeset View
Standalone View
Standalone View
lib/utils/drawer-utils.react.js
// @flow | // @flow | ||||
import { values } from './objects.js'; | import { values } from './objects.js'; | ||||
import { threadInFilterList, threadIsChannel } from '../shared/thread-utils.js'; | import { threadInFilterList, threadIsChannel } from '../shared/thread-utils.js'; | ||||
import { communitySubthreads } from '../types/thread-types-enum.js'; | import { communitySubthreads } from '../types/thread-types-enum.js'; | ||||
import type { | import type { | ||||
RawThreadInfo, | RawThreadInfo, | ||||
ThreadInfo, | ThreadInfo, | ||||
ResolvedThreadInfo, | ResolvedThreadInfo, | ||||
} from '../types/thread-types.js'; | } from '../types/thread-types.js'; | ||||
export type CommunityDrawerItemData<T> = { | export type CommunityDrawerItemData<T> = { | ||||
+threadInfo: ThreadInfo, | +threadInfo: ThreadInfo, | ||||
+itemChildren?: $ReadOnlyArray<CommunityDrawerItemData<T>>, | +itemChildren: $ReadOnlyArray<CommunityDrawerItemData<T>>, | ||||
+hasSubchannelsButton: boolean, | +hasSubchannelsButton: boolean, | ||||
+labelStyle: T, | +labelStyle: T, | ||||
}; | }; | ||||
function createRecursiveDrawerItemsData<LabelStyleType>( | function createRecursiveDrawerItemsData<LabelStyleType>( | ||||
childThreadInfosMap: { +[id: string]: $ReadOnlyArray<ThreadInfo> }, | childThreadInfosMap: { +[id: string]: $ReadOnlyArray<ThreadInfo> }, | ||||
communities: $ReadOnlyArray<ResolvedThreadInfo>, | communities: $ReadOnlyArray<ResolvedThreadInfo>, | ||||
labelStyles: $ReadOnlyArray<LabelStyleType>, | labelStyles: $ReadOnlyArray<LabelStyleType>, | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |