diff --git a/native/components/nux-tips-context.react.js b/native/components/nux-tips-context.react.js --- a/native/components/nux-tips-context.react.js +++ b/native/components/nux-tips-context.react.js @@ -4,20 +4,45 @@ import { values } from 'lib/utils/objects.js'; +import type { NUXTipRouteNames } from '../navigation/route-names.js'; + const nuxTip = Object.freeze({ - MUTED: 'muted', COMMUNITY_DRAWER: 'community_drawer', + MUTED: 'muted', }); -type NUXTip = $Values; +export type NUXTip = $Values; + +type NUXTipCallbackParams = { + +nextTip: ?NUXTip, + +tooltipLocation: 'below' | 'above', + +nextRouteName: ?NUXTipRouteNames, +}; + +const nuxTipCallbackParams: { [NUXTip]: NUXTipCallbackParams } = { + [nuxTip.COMMUNITY_DRAWER]: { + nextTip: nuxTip.MUTED, + tooltipLocation: 'below', + nextRouteName: undefined, //TODO: update to the next screens name + }, + [nuxTip.MUTED]: { + nextTip: undefined, + nextRouteName: undefined, + tooltipLocation: 'below', + }, +}; + +function getTipCallbackParams(currentTipKey: NUXTip): NUXTipCallbackParams { + return nuxTipCallbackParams[currentTipKey]; +} type TipProps = { - +x: ?number, - +y: ?number, - +width: ?number, - +height: ?number, - +pageX: ?number, - +pageY: ?number, + +x: number, + +y: number, + +width: number, + +height: number, + +pageX: number, + +pageY: number, }; export type NUXTipsContextType = { @@ -69,4 +94,4 @@ ); } -export { NUXTipsContext, NUXTipsContextProvider, nuxTip }; +export { NUXTipsContext, NUXTipsContextProvider, nuxTip, getTipCallbackParams }; diff --git a/native/navigation/overlay-navigator.react.js b/native/navigation/overlay-navigator.react.js --- a/native/navigation/overlay-navigator.react.js +++ b/native/navigation/overlay-navigator.react.js @@ -39,11 +39,11 @@ import { scrollBlockingModals, TabNavigatorRouteName, - NUXTipsOverlayRouteName, + CommunityDrawerTipRouteName, } from './route-names.js'; import { isMessageTooltipKey } from '../chat/utils.js'; -const newReanimatedRoutes = new Set([NUXTipsOverlayRouteName]); +const newReanimatedRoutes = new Set([CommunityDrawerTipRouteName]); export type OverlayNavigationHelpers = { diff --git a/native/navigation/route-names.js b/native/navigation/route-names.js --- a/native/navigation/route-names.js +++ b/native/navigation/route-names.js @@ -167,7 +167,7 @@ export const TagFarcasterChannelByNameRouteName = 'TagFarcasterChannelByName'; export const ThreadSettingsNotificationsRouteName = 'ThreadSettingsNotifications'; -export const NUXTipsOverlayRouteName = 'NUXTipsOverlay'; +export const CommunityDrawerTipRouteName = 'CommunityDrawerTip'; export type RootParamList = { +LoggedOutModal: void, @@ -197,6 +197,8 @@ +RestoreSIWEBackup: RestoreSIWEBackupParams, }; +export type NUXTipRouteNames = typeof CommunityDrawerTipRouteName; + export type MessageTooltipRouteNames = | typeof RobotextMessageTooltipModalRouteName | typeof MultimediaMessageTooltipModalRouteName @@ -224,7 +226,7 @@ +ThreadAvatarCameraModal: ThreadAvatarCameraModalParams, +VideoPlaybackModal: VideoPlaybackModalParams, +TogglePinModal: TogglePinModalParams, - +NUXTipsOverlay: NUXTipsOverlayParams, + +CommunityDrawerTip: NUXTipsOverlayParams, ...TooltipModalParamList, };