diff --git a/native/calendar/entry.react.js b/native/calendar/entry.react.js --- a/native/calendar/entry.react.js +++ b/native/calendar/entry.react.js @@ -44,13 +44,18 @@ } from 'lib/types/entry-types'; import type { LoadingStatus } from 'lib/types/loading-types'; import type { Dispatch } from 'lib/types/redux-types'; -import { type ThreadInfo, threadPermissions } from 'lib/types/thread-types'; +import { + type ThreadInfo, + type ResolvedThreadInfo, + threadPermissions, +} from 'lib/types/thread-types'; import { useServerCall, useDispatchActionPromise, type DispatchActionPromise, } from 'lib/utils/action-utils'; import { dateString } from 'lib/utils/date-utils'; +import { useResolvedThreadInfo } from 'lib/utils/entity-helpers'; import { ServerError } from 'lib/utils/errors'; import sleep from 'lib/utils/sleep'; @@ -96,10 +101,9 @@ ); } -type BaseProps = { +type SharedProps = { +navigation: TabNavigationProp<'Calendar'>, +entryInfo: EntryInfoWithHeight, - +threadInfo: ThreadInfo, +visible: boolean, +active: boolean, +makeActive: (entryKey: string, active: boolean) => void, @@ -108,8 +112,13 @@ +onPressWhitespace: () => void, +entryRef: (entryKey: string, entry: ?InternalEntry) => void, }; +type BaseProps = { + ...SharedProps, + +threadInfo: ThreadInfo, +}; type Props = { - ...BaseProps, + ...SharedProps, + +threadInfo: ResolvedThreadInfo, // Redux state +calendarQuery: () => CalendarQuery, +online: boolean, @@ -787,9 +796,12 @@ const callSaveEntry = useServerCall(saveEntry); const callDeleteEntry = useServerCall(deleteEntry); + const { threadInfo: unresolvedThreadInfo, ...restProps } = props; + const threadInfo = useResolvedThreadInfo(unresolvedThreadInfo); + return ( ); },