Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32216507
D13084.1765167366.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D13084.1765167366.diff
View Options
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
@@ -5,6 +5,7 @@
import { values } from 'lib/utils/objects.js';
import type { NUXTipRouteNames } from '../navigation/route-names.js';
+import { MutedTabTipRouteName } from '../navigation/route-names.js';
const nuxTip = Object.freeze({
COMMUNITY_DRAWER: 'community_drawer',
@@ -24,7 +25,7 @@
[nuxTip.COMMUNITY_DRAWER]: {
nextTip: nuxTip.MUTED,
tooltipLocation: 'below',
- nextRouteName: undefined, //TODO: update to the next screens name
+ nextRouteName: MutedTabTipRouteName,
},
[nuxTip.MUTED]: {
nextTip: undefined,
diff --git a/native/navigation/app-navigator.react.js b/native/navigation/app-navigator.react.js
--- a/native/navigation/app-navigator.react.js
+++ b/native/navigation/app-navigator.react.js
@@ -7,13 +7,17 @@
import ActionResultModal from './action-result-modal.react.js';
import { CommunityDrawerNavigator } from './community-drawer-navigator.react.js';
import CommunityDrawerTip from './community-drawer-tip.react.js';
+import MutedTabTip from './muted-tab-tip.react.js';
import { createOverlayNavigator } from './overlay-navigator.react.js';
import type {
OverlayNavigationProp,
OverlayNavigationHelpers,
} from './overlay-navigator.react.js';
import type { RootNavigationProp } from './root-navigator.react.js';
-import { CommunityDrawerTipRouteName } from './route-names.js';
+import {
+ CommunityDrawerTipRouteName,
+ MutedTabTipRouteName,
+} from './route-names.js';
import {
UserAvatarCameraModalRouteName,
ThreadAvatarCameraModalRouteName,
@@ -159,6 +163,7 @@
name={CommunityDrawerTipRouteName}
component={CommunityDrawerTip}
/>
+ <App.Screen name={MutedTabTipRouteName} component={MutedTabTip} />
<App.Screen name={TogglePinModalRouteName} component={TogglePinModal} />
</App.Navigator>
{pushHandler}
diff --git a/native/navigation/muted-tab-tip.react.js b/native/navigation/muted-tab-tip.react.js
new file mode 100644
--- /dev/null
+++ b/native/navigation/muted-tab-tip.react.js
@@ -0,0 +1,42 @@
+// @flow
+
+import * as React from 'react';
+
+import { useCurrentUserFID } from 'lib/utils/farcaster-utils.js';
+
+import ChatTabBarButton from '../chat/chat-tab-bar-button.react.js';
+import { backgroundChatThreadListOptions } from '../chat/chat.react.js';
+import {
+ type NUXTipsOverlayProps,
+ createNUXTipsOverlay,
+} from '../tooltip/nux-tips-overlay.react.js';
+
+const mutedTabTipTextBase =
+ 'When you mute a chat, it automatically gets moved to this tab.';
+const mutedTabTipTextIfFID =
+ ' When Comm automatically adds you to a community associated with a ' +
+ 'Farcaster channel you follow, we mute them by default.';
+
+function WrappedChatTabBarButton(): React.Node {
+ const { title, tabBarIcon } = backgroundChatThreadListOptions;
+ return <ChatTabBarButton title={title} tabBarIcon={tabBarIcon} />;
+}
+
+function MutedTabTip(props: NUXTipsOverlayProps<'MutedTabTip'>): React.Node {
+ const fid = useCurrentUserFID();
+ console.log(fid);
+ const text = React.useMemo(() => {
+ if (!fid) {
+ return mutedTabTipTextBase;
+ }
+ return mutedTabTipTextBase + mutedTabTipTextIfFID;
+ }, [fid]);
+
+ const MutedTabTipComponentType: React.ComponentType<
+ NUXTipsOverlayProps<'MutedTabTip'>,
+ > = createNUXTipsOverlay(WrappedChatTabBarButton, text);
+
+ return <MutedTabTipComponentType {...props} />;
+}
+
+export default MutedTabTip;
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
@@ -168,6 +168,7 @@
export const ThreadSettingsNotificationsRouteName =
'ThreadSettingsNotifications';
export const CommunityDrawerTipRouteName = 'CommunityDrawerTip';
+export const MutedTabTipRouteName = 'MutedTabTip';
export type RootParamList = {
+LoggedOutModal: void,
@@ -197,7 +198,9 @@
+RestoreSIWEBackup: RestoreSIWEBackupParams,
};
-export type NUXTipRouteNames = typeof CommunityDrawerTipRouteName;
+export type NUXTipRouteNames =
+ | typeof CommunityDrawerTipRouteName
+ | typeof MutedTabTipRouteName;
export type MessageTooltipRouteNames =
| typeof RobotextMessageTooltipModalRouteName
@@ -227,6 +230,7 @@
+VideoPlaybackModal: VideoPlaybackModalParams,
+TogglePinModal: TogglePinModalParams,
+CommunityDrawerTip: NUXTipsOverlayParams,
+ +MutedTabTip: NUXTipsOverlayParams,
...TooltipModalParamList,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 8, 4:16 AM (9 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5847026
Default Alt Text
D13084.1765167366.diff (4 KB)
Attached To
Mode
D13084: [native] Create muted tab tip
Attached
Detach File
Event Timeline
Log In to Comment