about summary refs log tree commit diff
path: root/src/lib
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-04-27 05:54:18 +0100
committerGitHub <noreply@github.com>2024-04-27 05:54:18 +0100
commitce85375c856549371e1e561e21bb5932baca8ea6 (patch)
tree7938f91a11ff2d2459707ac19f09774f30857150 /src/lib
parent1af59ca8a7db308325f8964a131d544882cff6e8 (diff)
downloadvoidsky-ce85375c856549371e1e561e21bb5932baca8ea6.tar.zst
[Clipclops] New routes with placeholder screens (#3725)
* add new routes with placeholder screens

* gate content

* add filled envelope style

* swap filled state

* switch to `useAgent`
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/analytics/types.ts1
-rw-r--r--src/lib/hooks/useNavigationTabState.ts5
-rw-r--r--src/lib/routes/router.ts2
-rw-r--r--src/lib/routes/types.ts10
-rw-r--r--src/lib/statsig/gates.ts1
5 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/analytics/types.ts b/src/lib/analytics/types.ts
index b4eb0ddcb..33b8bddbd 100644
--- a/src/lib/analytics/types.ts
+++ b/src/lib/analytics/types.ts
@@ -76,6 +76,7 @@ export type TrackPropertiesMap = {
   'MobileShell:SearchButtonPressed': {}
   'MobileShell:NotificationsButtonPressed': {}
   'MobileShell:FeedsButtonPressed': {}
+  'MobileShell:MessagesButtonPressed': {}
   // NOTIFICATIONS events
   'Notificatons:OpenApp': {}
   // LISTS events
diff --git a/src/lib/hooks/useNavigationTabState.ts b/src/lib/hooks/useNavigationTabState.ts
index 3a05fe524..7fc0c65be 100644
--- a/src/lib/hooks/useNavigationTabState.ts
+++ b/src/lib/hooks/useNavigationTabState.ts
@@ -1,4 +1,5 @@
 import {useNavigationState} from '@react-navigation/native'
+
 import {getTabState, TabState} from 'lib/routes/helpers'
 
 export function useNavigationTabState() {
@@ -10,13 +11,15 @@ export function useNavigationTabState() {
       isAtNotifications:
         getTabState(state, 'Notifications') !== TabState.Outside,
       isAtMyProfile: getTabState(state, 'MyProfile') !== TabState.Outside,
+      isAtMessages: getTabState(state, 'MessagesList') !== TabState.Outside,
     }
     if (
       !res.isAtHome &&
       !res.isAtSearch &&
       !res.isAtFeeds &&
       !res.isAtNotifications &&
-      !res.isAtMyProfile
+      !res.isAtMyProfile &&
+      !res.isAtMessages
     ) {
       // HACK for some reason useNavigationState will give us pre-hydration results
       //      and not update after, so we force isAtHome if all came back false
diff --git a/src/lib/routes/router.ts b/src/lib/routes/router.ts
index 8c8be3739..45f9c85fd 100644
--- a/src/lib/routes/router.ts
+++ b/src/lib/routes/router.ts
@@ -1,4 +1,4 @@
-import {RouteParams, Route} from './types'
+import {Route, RouteParams} from './types'
 
 export class Router {
   routes: [string, Route][] = []
diff --git a/src/lib/routes/types.ts b/src/lib/routes/types.ts
index ac5cb0bce..f9a592711 100644
--- a/src/lib/routes/types.ts
+++ b/src/lib/routes/types.ts
@@ -38,6 +38,8 @@ export type CommonNavigatorParams = {
   AccessibilitySettings: undefined
   Search: {q?: string}
   Hashtag: {tag: string; author?: string}
+  MessagesConversation: {conversation: string}
+  MessagesSettings: undefined
 }
 
 export type BottomTabNavigatorParams = CommonNavigatorParams & {
@@ -46,6 +48,7 @@ export type BottomTabNavigatorParams = CommonNavigatorParams & {
   FeedsTab: undefined
   NotificationsTab: undefined
   MyProfileTab: undefined
+  MessagesTab: undefined
 }
 
 export type HomeTabNavigatorParams = CommonNavigatorParams & {
@@ -68,12 +71,17 @@ export type MyProfileTabNavigatorParams = CommonNavigatorParams & {
   MyProfile: undefined
 }
 
+export type MessagesTabNavigatorParams = CommonNavigatorParams & {
+  MessagesList: undefined
+}
+
 export type FlatNavigatorParams = CommonNavigatorParams & {
   Home: undefined
   Search: {q?: string}
   Feeds: undefined
   Notifications: undefined
   Hashtag: {tag: string; author?: string}
+  MessagesList: undefined
 }
 
 export type AllNavigatorParams = CommonNavigatorParams & {
@@ -87,6 +95,8 @@ export type AllNavigatorParams = CommonNavigatorParams & {
   Notifications: undefined
   MyProfileTab: undefined
   Hashtag: {tag: string; author?: string}
+  MessagesTab: undefined
+  MessagesList: undefined
 }
 
 // NOTE
diff --git a/src/lib/statsig/gates.ts b/src/lib/statsig/gates.ts
index ab040a974..5cd603920 100644
--- a/src/lib/statsig/gates.ts
+++ b/src/lib/statsig/gates.ts
@@ -3,6 +3,7 @@ export type Gate =
   | 'autoexpand_suggestions_on_profile_follow_v2'
   | 'disable_min_shell_on_foregrounding_v2'
   | 'disable_poll_on_discover_v2'
+  | 'dms'
   | 'hide_vertical_scroll_indicators'
   | 'show_follow_back_label_v2'
   | 'start_session_with_following_v2'