Changeset View
Changeset View
Standalone View
Standalone View
lib/utils/drawer-utils.react.js
// @flow | // @flow | ||||
import { threadIsChannel } from '../shared/thread-utils.js'; | import { threadIsChannel } from '../shared/thread-utils.js'; | ||||
import { | import { | ||||
type ThreadInfo, | type ThreadInfo, | ||||
type ResolvedThreadInfo, | type ResolvedThreadInfo, | ||||
communitySubthreads, | communitySubthreads, | ||||
} 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 64 Lines • Show Last 20 Lines |