@planningcenter/chat-react-native 3.2.0-rc.14 → 3.2.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/build/navigation/index.d.ts +26 -10
  2. package/build/navigation/index.d.ts.map +1 -1
  3. package/build/navigation/index.js +5 -2
  4. package/build/navigation/index.js.map +1 -1
  5. package/build/screens/conversation_new/conversation_new_screen.d.ts +3 -0
  6. package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
  7. package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
  8. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts +5 -2
  9. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.d.ts.map +1 -1
  10. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js +2 -1
  11. package/build/screens/conversation_select_recipients/conversation_select_recipients_screen.js.map +1 -1
  12. package/build/screens/conversations/conversations_screen.d.ts +2 -1
  13. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  14. package/build/screens/conversations/conversations_screen.js +32 -1
  15. package/build/screens/conversations/conversations_screen.js.map +1 -1
  16. package/build/utils/destructure_chat_group_graph_id.d.ts +10 -0
  17. package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -0
  18. package/build/utils/destructure_chat_group_graph_id.js +8 -0
  19. package/build/utils/destructure_chat_group_graph_id.js.map +1 -0
  20. package/build/utils/index.d.ts +1 -0
  21. package/build/utils/index.d.ts.map +1 -1
  22. package/build/utils/index.js +1 -0
  23. package/build/utils/index.js.map +1 -1
  24. package/package.json +2 -2
  25. package/src/navigation/index.tsx +10 -2
  26. package/src/screens/conversation_new/conversation_new_screen.tsx +3 -0
  27. package/src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx +8 -2
  28. package/src/screens/conversations/conversations_screen.tsx +37 -2
  29. package/src/utils/destructure_chat_group_graph_id.ts +25 -0
  30. package/src/utils/index.ts +1 -0
@@ -27,10 +27,11 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
27
27
  readonly screenLayout: typeof ScreenLayout;
28
28
  readonly screens: {
29
29
  readonly ConversationSelectRecipients: {
30
- readonly screen: ({}: {
30
+ readonly screen: ({ route, }: {
31
31
  route: {
32
32
  params: {
33
- chat_group_graph_id?: string;
33
+ chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
34
+ group_source_app_name?: import("../types/resources/app_name").AppName;
34
35
  };
35
36
  };
36
37
  }) => React.JSX.Element;
@@ -55,12 +56,19 @@ export declare const NewConversationStack: import("@react-navigation/native").Ty
55
56
  team_ids?: number[];
56
57
  plan_id?: number;
57
58
  source_app_name: import("../types/resources/app_name").AppName;
59
+ chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
60
+ group_source_app_name?: import("../types/resources/app_name").AppName;
58
61
  };
59
62
  };
60
63
  }) => React.JSX.Element;
61
- readonly options: {
62
- readonly title: "New conversation";
63
- readonly headerLeft: () => null;
64
+ readonly options: ({ navigation, route }: {
65
+ route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
66
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
67
+ theme: ReactNavigation.Theme;
68
+ }) => {
69
+ title: string;
70
+ headerLeft: () => null;
71
+ headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
64
72
  };
65
73
  };
66
74
  };
@@ -138,10 +146,11 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
138
146
  readonly screenLayout: typeof ScreenLayout;
139
147
  readonly screens: {
140
148
  readonly ConversationSelectRecipients: {
141
- readonly screen: ({}: {
149
+ readonly screen: ({ route, }: {
142
150
  route: {
143
151
  params: {
144
- chat_group_graph_id?: string;
152
+ chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
153
+ group_source_app_name?: import("../types/resources/app_name").AppName;
145
154
  };
146
155
  };
147
156
  }) => React.JSX.Element;
@@ -166,12 +175,19 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
166
175
  team_ids?: number[];
167
176
  plan_id?: number;
168
177
  source_app_name: import("../types/resources/app_name").AppName;
178
+ chat_group_graph_id?: import("../types/resources/group_resource").GraphId;
179
+ group_source_app_name?: import("../types/resources/app_name").AppName;
169
180
  };
170
181
  };
171
182
  }) => React.JSX.Element;
172
- readonly options: {
173
- readonly title: "New conversation";
174
- readonly headerLeft: () => null;
183
+ readonly options: ({ navigation, route }: {
184
+ route: import("@react-navigation/native").RouteProp<import("@react-navigation/native").ParamListBase, string>;
185
+ navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<import("@react-navigation/native").ParamListBase, string, undefined>;
186
+ theme: ReactNavigation.Theme;
187
+ }) => {
188
+ title: string;
189
+ headerLeft: () => null;
190
+ headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
175
191
  };
176
192
  };
177
193
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AAOnF,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAA0B,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAO7C,eAAO,MAAM,oBAAoB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AAA;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAO7C,eAAO,MAAM,oBAAoB;;;;;;;;;uOAtBoC,mBACjE;;;;;;;;;;;;;;;;;;;;uBA2Jgoa,gBAAiB,KAAK;;;qCA3H7na,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;uBA2H4ka,gBAAiB,KAAK;;;;qCA3G7na,2BAA2B;;;;EAWtD,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;uBA8F8ma,gBAAiB,KAAK;;;qCApF7na,2BAA2B;;;;;;;;;;;;uBAoF4ka,gBAAiB,KAAK;;;;;;;;;;;uBAAtB,gBAAiB,KAAK;;;;qCA9C7na,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mDA8C6la,KAAK;;;iDA3H7na,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;mDA2H6la,KAAK;;;;iDA3G7na,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkGtD,CAAA;AAEF,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
@@ -37,10 +37,13 @@ export const NewConversationStack = createNativeStackNavigator({
37
37
  },
38
38
  ConversationNew: {
39
39
  screen: ConversationNewScreen,
40
- options: {
40
+ options: ({ navigation, route }) => ({
41
41
  title: 'New conversation',
42
42
  headerLeft: () => null,
43
- },
43
+ headerRight: (props) => (<HeaderRightButton {...props} onPress={() => navigation.popTo('Conversations', route.params)}>
44
+ Cancel
45
+ </HeaderRightButton>),
46
+ }),
44
47
  },
45
48
  },
46
49
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAA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AE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: {\n title: 'New conversation',\n headerLeft: () => null,\n },\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAE7D,OAAO,EACL,0BAA0B,GAE3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAA;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAA;AACnF,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAA;AAC3F,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,GACnC,MAAM,iFAAiF,CAAA;AACxF,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAA;AACpI,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,yBAAyB,EACzB,gCAAgC,GACjC,MA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,EAAE,yBAAyB;YACjC,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;gBAC5B,YAAY,EAAE,OAAO;gBACrB,KAAK,EAAE,sBAAsB;gBAC7B,WAAW,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,CACnD,CAAC,iBAAiB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CACvD;;UACF,EAAE,iBAAiB,CAAC,CACrB;aACF,CAAC;SACH;QACD,GAAG,EAAE;YACH,MAAM,EAAE,oBAAoB;YAC5B,OAAO,EAAE;gBACP,WAAW,EAAE,KAAK;gBAClB,YAAY,EAAE,OAAO;aACtB;SACF;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import { HeaderBackButton } from '@react-navigation/elements'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport React from 'react'\nimport { Icon } from '../components'\nimport { ConversationDetailsScreen } from '../screens/conversation_details_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { ConversationsScreen } from '../screens/conversations/conversations_screen'\nimport { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'\nimport {\n ConversationFilterReceipientsScreenOptions,\n ConversationFilterRecipientsScreen,\n} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'\nimport { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'\nimport { NotFound } from '../screens/not_found'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\nimport { HeaderRightButton } from './header'\nimport { ScreenLayout } from './screenLayout'\nimport {\n ConversationFiltersScreen,\n ConversationFiltersScreenOptions,\n} from '../screens/conversation_filters_screen'\nimport { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'\n\nexport const NewConversationStack = createNativeStackNavigator({\n initialRouteName: 'ConversationSelectRecipients',\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n ConversationSelectRecipients: {\n screen: ConversationSelectRecipientsScreen,\n options: ({ navigation }) => ({\n title: 'New conversation',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n ConversationFilterRecipients: {\n screen: ConversationFilterRecipientsScreen,\n options: ConversationFilterReceipientsScreenOptions,\n },\n ConversationNew: {\n screen: ConversationNewScreen,\n options: ({ navigation, route }) => ({\n title: 'New conversation',\n headerLeft: () => null,\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton\n {...props}\n onPress={() => navigation.popTo('Conversations', route.params)}\n >\n Cancel\n </HeaderRightButton>\n ),\n }),\n },\n },\n})\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n ConversationFilters: {\n screen: ConversationFiltersScreen,\n options: ConversationFiltersScreenOptions,\n },\n Conversation: {\n screen: ConversationScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: props => (\n <HeaderBackButton\n displayMode=\"minimal\"\n onPress={() => {\n if ((route.params as ConversationFiltersParams)?.chat_group_graph_id) {\n // Ensure that conversations with a graph id pass them back to the conversation list\n navigation.popTo('Conversations', route.params)\n } else {\n navigation.goBack()\n }\n }}\n {...props}\n />\n ),\n }),\n },\n ConversationDetails: {\n screen: ConversationDetailsScreen,\n options: ({ navigation }) => ({\n presentation: 'modal',\n title: 'Conversation details',\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderRightButton {...props} onPress={navigation.goBack}>\n Done\n </HeaderRightButton>\n ),\n }),\n },\n New: {\n screen: NewConversationStack,\n options: {\n headerShown: false,\n presentation: 'modal',\n },\n },\n SendGiphy: {\n screen: SendGiphyScreen,\n options: SendGiphyScreenOptions,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
@@ -1,11 +1,14 @@
1
1
  import { StaticScreenProps } from '@react-navigation/native';
2
2
  import React from 'react';
3
3
  import { AppName } from '../../types/resources/app_name';
4
+ import { GraphId } from '../../types/resources/group_resource';
4
5
  type ConversationNewScreenProps = StaticScreenProps<{
5
6
  group_id?: number;
6
7
  team_ids?: number[];
7
8
  plan_id?: number;
8
9
  source_app_name: AppName;
10
+ chat_group_graph_id?: GraphId;
11
+ group_source_app_name?: AppName;
9
12
  }>;
10
13
  export declare const ConversationNewScreen: ({ route }: ConversationNewScreenProps) => React.JSX.Element;
11
14
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_new_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,KAAK,0BAA0B,GAAG,iBAAiB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,OAAO,CAAA;CACzB,CAAC,CAAA;AAEF,eAAO,MAAM,qBAAqB,cAAe,0BAA0B,sBAW1E,CAAA"}
1
+ {"version":3,"file":"conversation_new_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAE9D,KAAK,0BAA0B,GAAG,iBAAiB,CAAC;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,OAAO,CAAA;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAEF,eAAO,MAAM,qBAAqB,cAAe,0BAA0B,sBAW1E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_new_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAUvE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAA8B,EAAE,EAAE;IAC7E,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAErE,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;QAC9E,KAAK,UAAU;YACb,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAG,CAAA;QACxE;YACE,OAAO,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;IACjC,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { GroupsForm } from './components/groups_form'\nimport { TeamsForm } from './components/team_form'\nimport { SourceAppErrorCard } from './components/source_app_error_card'\nimport { AppName } from '../../types/resources/app_name'\n\ntype ConversationNewScreenProps = StaticScreenProps<{\n group_id?: number\n team_ids?: number[]\n plan_id?: number\n source_app_name: AppName\n}>\n\nexport const ConversationNewScreen = ({ route }: ConversationNewScreenProps) => {\n const { group_id, team_ids, source_app_name, plan_id } = route.params\n\n switch (source_app_name) {\n case 'Groups':\n return group_id ? <GroupsForm groupId={group_id} /> : <SourceAppErrorCard />\n case 'Services':\n return <TeamsForm initialTeamIds={team_ids} initialPlanId={plan_id} />\n default:\n return <SourceAppErrorCard />\n }\n}\n"]}
1
+ {"version":3,"file":"conversation_new_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_new/conversation_new_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAA;AAavE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAA8B,EAAE,EAAE;IAC7E,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAErE,QAAQ,eAAe,EAAE,CAAC;QACxB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;QAC9E,KAAK,UAAU;YACb,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,EAAG,CAAA;QACxE;YACE,OAAO,CAAC,kBAAkB,CAAC,AAAD,EAAG,CAAA;IACjC,CAAC;AACH,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { GroupsForm } from './components/groups_form'\nimport { TeamsForm } from './components/team_form'\nimport { SourceAppErrorCard } from './components/source_app_error_card'\nimport { AppName } from '../../types/resources/app_name'\nimport { GraphId } from '../../types/resources/group_resource'\n\ntype ConversationNewScreenProps = StaticScreenProps<{\n group_id?: number\n team_ids?: number[]\n plan_id?: number\n source_app_name: AppName\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}>\n\nexport const ConversationNewScreen = ({ route }: ConversationNewScreenProps) => {\n const { group_id, team_ids, source_app_name, plan_id } = route.params\n\n switch (source_app_name) {\n case 'Groups':\n return group_id ? <GroupsForm groupId={group_id} /> : <SourceAppErrorCard />\n case 'Services':\n return <TeamsForm initialTeamIds={team_ids} initialPlanId={plan_id} />\n default:\n return <SourceAppErrorCard />\n }\n}\n"]}
@@ -1,8 +1,11 @@
1
1
  import { StaticScreenProps } from '@react-navigation/native';
2
2
  import React from 'react';
3
+ import { GraphId } from '../../types/resources/group_resource';
4
+ import { AppName } from '../../types/resources/app_name';
3
5
  type ConversationSelectRecipientsScreenProps = StaticScreenProps<{
4
- chat_group_graph_id?: string;
6
+ chat_group_graph_id?: GraphId;
7
+ group_source_app_name?: AppName;
5
8
  }>;
6
- export declare const ConversationSelectRecipientsScreen: ({}: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
9
+ export declare const ConversationSelectRecipientsScreen: ({ route, }: ConversationSelectRecipientsScreenProps) => React.JSX.Element;
7
10
  export {};
8
11
  //# sourceMappingURL=conversation_select_recipients_screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,KAAK,uCAAuC,GAAG,iBAAiB,CAAC;IAC/D,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC,CAAA;AAMF,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBA0E7F,CAAA"}
1
+ {"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAGxD,KAAK,uCAAuC,GAAG,iBAAiB,CAAC;IAC/D,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAMF,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBA2EzC,CAAA"}
@@ -10,7 +10,7 @@ import { platformFontWeightMedium, pluralize } from '../../utils';
10
10
  const ASPECT_RATIO = 16 / 9;
11
11
  const THUMBNAIL_WIDTH = 80;
12
12
  const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO;
13
- export const ConversationSelectRecipientsScreen = ({}) => {
13
+ export const ConversationSelectRecipientsScreen = ({ route, }) => {
14
14
  const styles = useStyles();
15
15
  const navigation = useNavigation();
16
16
  const { data: groups = [] } = useGroupsGroups();
@@ -21,6 +21,7 @@ export const ConversationSelectRecipientsScreen = ({}) => {
21
21
  params: {
22
22
  group_id: group.id,
23
23
  source_app_name: 'Groups',
24
+ ...route.params,
24
25
  },
25
26
  });
26
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE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EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;SAChC;QACD,iBAAiB,EAAE,EAAE;QACrB,GAAG,EAAE;YACH,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SAClD;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,OAAO,EAAE;YACP,UAAU,EAAE,wBAAwB;YACpC,UAAU,EAAE,CAAC;SACd;QACD,UAAU,EAAE;YACV,UAAU,EAAE,CAAC;SACd;QACD,YAAY,EAAE;YACZ,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;SACxC;QACD,UAAU,EAAE;YACV,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACrD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, Heading, Icon, Image, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { platformFontWeightMedium, pluralize } from '../../utils'\n\ntype ConversationSelectRecipientsScreenProps = StaticScreenProps<{\n chat_group_graph_id?: string\n}>\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nexport const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n\n const handleNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n },\n })\n }\n\n return (\n <ScrollView style={styles.container}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {groupsWithCreatePermission.map(group => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <PlatformPressable\n key={group.id}\n style={styles.row}\n onPress={() => handleNavigateToConversationNew(group)}\n accessibilityRole=\"link\"\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation.`}\n >\n <Image\n source={{ uri: group.headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n <View style={styles.rowContent}>\n <Text style={styles.rowName} numberOfLines={2}>\n {group.name}\n </Text>\n <Text variant=\"tertiary\">{group.membershipsCount} members</Text>\n </View>\n <Icon name=\"general.rightChevron\" size={16} style={styles.rowIconRight} />\n </PlatformPressable>\n )\n })}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('New', {\n screen: 'ConversationFilterRecipients',\n params: {\n source_app_name: 'Services',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n />\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n selectTeamsButton: {},\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n rowName: {\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n rowContent: {\n flexShrink: 1,\n },\n rowIconRight: {\n marginLeft: 'auto',\n color: theme.colors.fillColorNeutral030,\n },\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAOjE,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC,CAAA;A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AE,CAAC;SAChB;QACD,OAAO,EAAE;YACP,UAAU,EAAE,wBAAwB;YACpC,UAAU,EAAE,CAAC;SACd;QACD,UAAU,EAAE;YACV,UAAU,EAAE,CAAC;SACd;QACD,YAAY,EAAE;YACZ,UAAU,EAAE,MAAM;YAClB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;SACxC;QACD,UAAU,EAAE;YACV,YAAY,EAAE,QAAQ;YACtB,OAAO,EAAE,EAAE;YACX,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACrD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, Heading, Icon, Image, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { AppName } from '../../types/resources/app_name'\nimport { platformFontWeightMedium, pluralize } from '../../utils'\n\ntype ConversationSelectRecipientsScreenProps = StaticScreenProps<{\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}>\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nexport const ConversationSelectRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n\n const handleNavigateToConversationNew = (group: GroupsGroupResource) => {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: group.id,\n source_app_name: 'Groups',\n ...route.params,\n },\n })\n }\n\n return (\n <ScrollView style={styles.container}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {groupsWithCreatePermission.map(group => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <PlatformPressable\n key={group.id}\n style={styles.row}\n onPress={() => handleNavigateToConversationNew(group)}\n accessibilityRole=\"link\"\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation.`}\n >\n <Image\n source={{ uri: group.headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n <View style={styles.rowContent}>\n <Text style={styles.rowName} numberOfLines={2}>\n {group.name}\n </Text>\n <Text variant=\"tertiary\">{group.membershipsCount} members</Text>\n </View>\n <Icon name=\"general.rightChevron\" size={16} style={styles.rowIconRight} />\n </PlatformPressable>\n )\n })}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('New', {\n screen: 'ConversationFilterRecipients',\n params: {\n source_app_name: 'Services',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n />\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n selectTeamsButton: {},\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n rowName: {\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n rowContent: {\n flexShrink: 1,\n },\n rowIconRight: {\n marginLeft: 'auto',\n color: theme.colors.fillColorNeutral030,\n },\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}
@@ -1,10 +1,11 @@
1
1
  import { StaticScreenProps } from '@react-navigation/native';
2
2
  import React from 'react';
3
3
  import { GraphId } from '../../types/resources/group_resource';
4
+ import { AppName } from '../../types/resources/app_name';
4
5
  export type ConversationScreenProps = StaticScreenProps<{
5
6
  title?: string;
6
7
  chat_group_graph_id?: GraphId;
7
- group_source_app_name?: string;
8
+ group_source_app_name?: AppName;
8
9
  }>;
9
10
  export declare function ConversationsScreen({ route }: ConversationScreenProps): React.JSX.Element;
10
11
  //# sourceMappingURL=conversations_screen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAG9D,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B,CAAC,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,qBAiBrE"}
1
+ {"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAG9D,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAExD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC,CAAC,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,qBAkDrE"}
@@ -5,16 +5,47 @@ import { Conversations } from '../../components';
5
5
  import { ActionButton } from '../../components/display/action_button';
6
6
  import { ConversationsContextProvider } from '../../contexts/conversations_context';
7
7
  import { useCanCreateConversations } from '../../hooks';
8
+ import { destructureChatGroupGraphId } from '../../utils';
8
9
  import { ListHeaderComponent } from './components/list_header_component';
9
10
  export function ConversationsScreen({ route }) {
10
11
  const navigation = useNavigation();
11
12
  const canCreateConversations = useCanCreateConversations();
12
13
  const styles = useStyles();
14
+ const { chat_group_graph_id } = route.params;
15
+ const { sourceAppName, sourceId } = destructureChatGroupGraphId(chat_group_graph_id);
16
+ const handleNewConversationNavigation = () => {
17
+ if (sourceAppName === 'Services') {
18
+ return navigation.navigate('New', {
19
+ screen: 'ConversationNew',
20
+ params: {
21
+ team_ids: sourceId ? [sourceId] : [],
22
+ source_app_name: sourceAppName,
23
+ ...route.params,
24
+ },
25
+ });
26
+ }
27
+ if (sourceAppName === 'Groups') {
28
+ return navigation.navigate('New', {
29
+ screen: 'ConversationNew',
30
+ params: {
31
+ group_id: sourceId,
32
+ source_app_name: sourceAppName,
33
+ ...route.params,
34
+ },
35
+ });
36
+ }
37
+ return navigation.navigate('New', {
38
+ screen: 'ConversationSelectRecipients',
39
+ params: {
40
+ ...route.params,
41
+ },
42
+ });
43
+ };
13
44
  return (<View style={styles.container}>
14
45
  <ConversationsContextProvider args={route.params}>
15
46
  <Conversations ListHeaderComponent={ListHeaderComponent}/>
16
47
  </ConversationsContextProvider>
17
- <ActionButton visible={canCreateConversations} title="New conversation" onPress={() => navigation.navigate('New')}/>
48
+ <ActionButton visible={canCreateConversations} title="New conversation" onPress={handleNewConversationNavigation}/>
18
49
  </View>);
19
50
  }
20
51
  const useStyles = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAA;AACnF,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAQxE,MAAM,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAA2B;IACpE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,sBAAsB,GAAG,yBAAyB,EAAE,CAAA;IAC1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAC/C;QAAA,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,EAC1D;MAAA,EAAE,4BAA4B,CAC9B;MAAA,CAAC,YAAY,CACX,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAChC,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAE9C;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations } from '../../components'\nimport { ActionButton } from '../../components/display/action_button'\nimport { ConversationsContextProvider } from '../../contexts/conversations_context'\nimport { useCanCreateConversations } from '../../hooks'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { ListHeaderComponent } from './components/list_header_component'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n}>\n\nexport function ConversationsScreen({ route }: ConversationScreenProps) {\n const navigation = useNavigation()\n const canCreateConversations = useCanCreateConversations()\n const styles = useStyles()\n\n return (\n <View style={styles.container}>\n <ConversationsContextProvider args={route.params}>\n <Conversations ListHeaderComponent={ListHeaderComponent} />\n </ConversationsContextProvider>\n <ActionButton\n visible={canCreateConversations}\n title=\"New conversation\"\n onPress={() => navigation.navigate('New')}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;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BAClB,eAAe,EAAE,aAAa;oBAC9B,GAAG,KAAK,CAAC,MAAM;iBAChB;aACF,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE;YAChC,MAAM,EAAE,8BAA8B;YACtC,MAAM,EAAE;gBACN,GAAG,KAAK,CAAC,MAAM;aAChB;SACF,CAAC,CAAA;IACJ,CAAC,CAAA;IAED,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,4BAA4B,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAC/C;QAAA,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,EAC1D;MAAA,EAAE,4BAA4B,CAC9B;MAAA,CAAC,YAAY,CACX,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAChC,KAAK,CAAC,kBAAkB,CACxB,OAAO,CAAC,CAAC,+BAA+B,CAAC,EAE7C;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;SACzB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations } from '../../components'\nimport { ActionButton } from '../../components/display/action_button'\nimport { ConversationsContextProvider } from '../../contexts/conversations_context'\nimport { useCanCreateConversations } from '../../hooks'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { destructureChatGroupGraphId } from '../../utils'\nimport { ListHeaderComponent } from './components/list_header_component'\nimport { AppName } from '../../types/resources/app_name'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n}>\n\nexport function ConversationsScreen({ route }: ConversationScreenProps) {\n const navigation = useNavigation()\n const canCreateConversations = useCanCreateConversations()\n const styles = useStyles()\n\n const { chat_group_graph_id } = route.params\n const { sourceAppName, sourceId } = destructureChatGroupGraphId(chat_group_graph_id)\n\n const handleNewConversationNavigation = () => {\n if (sourceAppName === 'Services') {\n return navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: sourceId ? [sourceId] : [],\n source_app_name: sourceAppName,\n ...route.params,\n },\n })\n }\n if (sourceAppName === 'Groups') {\n return navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n group_id: sourceId,\n source_app_name: sourceAppName,\n ...route.params,\n },\n })\n }\n\n return navigation.navigate('New', {\n screen: 'ConversationSelectRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n return (\n <View style={styles.container}>\n <ConversationsContextProvider args={route.params}>\n <Conversations ListHeaderComponent={ListHeaderComponent} />\n </ConversationsContextProvider>\n <ActionButton\n visible={canCreateConversations}\n title=\"New conversation\"\n onPress={handleNewConversationNavigation}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n })\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import { AppName } from '../types/resources/app_name';
2
+ import { SourceType, GraphId } from '../types/resources/group_resource';
3
+ interface DestructuredChatGroupGraphIdType {
4
+ sourceAppName?: AppName;
5
+ sourceType?: SourceType;
6
+ sourceId?: number;
7
+ }
8
+ export declare function destructureChatGroupGraphId(chatGroupGraphId?: GraphId): DestructuredChatGroupGraphIdType;
9
+ export {};
10
+ //# sourceMappingURL=destructure_chat_group_graph_id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destructure_chat_group_graph_id.d.ts","sourceRoot":"","sources":["../../src/utils/destructure_chat_group_graph_id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAEvE,UAAU,gCAAgC;IACxC,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,UAAU,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,wBAAgB,2BAA2B,CACzC,gBAAgB,CAAC,EAAE,OAAO,GACzB,gCAAgC,CAalC"}
@@ -0,0 +1,8 @@
1
+ export function destructureChatGroupGraphId(chatGroupGraphId) {
2
+ if (!chatGroupGraphId)
3
+ return { sourceAppName: undefined, sourceType: undefined, sourceId: undefined };
4
+ const [sourceAppName, sourceType, sourceIdString] = chatGroupGraphId.split('-');
5
+ const sourceIdNumber = Number(sourceIdString);
6
+ return { sourceAppName, sourceType, sourceId: sourceIdNumber };
7
+ }
8
+ //# sourceMappingURL=destructure_chat_group_graph_id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"destructure_chat_group_graph_id.js","sourceRoot":"","sources":["../../src/utils/destructure_chat_group_graph_id.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,2BAA2B,CACzC,gBAA0B;IAE1B,IAAI,CAAC,gBAAgB;QACnB,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAA;IAEjF,MAAM,CAAC,aAAa,EAAE,UAAU,EAAE,cAAc,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAI7E,CAAA;IAED,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,CAAA;IAE7C,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;AAChE,CAAC","sourcesContent":["import { AppName } from '../types/resources/app_name'\nimport { SourceType, GraphId } from '../types/resources/group_resource'\n\ninterface DestructuredChatGroupGraphIdType {\n sourceAppName?: AppName\n sourceType?: SourceType\n sourceId?: number\n}\n\nexport function destructureChatGroupGraphId(\n chatGroupGraphId?: GraphId\n): DestructuredChatGroupGraphIdType {\n if (!chatGroupGraphId)\n return { sourceAppName: undefined, sourceType: undefined, sourceId: undefined }\n\n const [sourceAppName, sourceType, sourceIdString] = chatGroupGraphId.split('-') as [\n AppName,\n SourceType,\n string,\n ]\n\n const sourceIdNumber = Number(sourceIdString)\n\n return { sourceAppName, sourceType, sourceId: sourceIdNumber }\n}\n"]}
@@ -7,4 +7,5 @@ export * from './uri';
7
7
  export * from './cache';
8
8
  export * from './native_adapters';
9
9
  export * from './pluralize';
10
+ export * from './destructure_chat_group_graph_id';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA"}
@@ -7,4 +7,5 @@ export * from './uri';
7
7
  export * from './cache';
8
8
  export * from './native_adapters';
9
9
  export * from './pluralize';
10
+ export * from './destructure_chat_group_graph_id';
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\nexport * from './pluralize'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,mCAAmC,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\nexport * from './pluralize'\nexport * from './destructure_chat_group_graph_id'\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.2.0-rc.14",
3
+ "version": "3.2.0-rc.15",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -55,5 +55,5 @@
55
55
  "prettier": "^3.4.2",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "cd1530f3deb3fed080b1656e952ff74456e734c4"
58
+ "gitHead": "db2d008b8c241478a2dff4abee3f887e72959c4f"
59
59
  }
@@ -54,10 +54,18 @@ export const NewConversationStack = createNativeStackNavigator({
54
54
  },
55
55
  ConversationNew: {
56
56
  screen: ConversationNewScreen,
57
- options: {
57
+ options: ({ navigation, route }) => ({
58
58
  title: 'New conversation',
59
59
  headerLeft: () => null,
60
- },
60
+ headerRight: (props: NativeStackHeaderRightProps) => (
61
+ <HeaderRightButton
62
+ {...props}
63
+ onPress={() => navigation.popTo('Conversations', route.params)}
64
+ >
65
+ Cancel
66
+ </HeaderRightButton>
67
+ ),
68
+ }),
61
69
  },
62
70
  },
63
71
  })
@@ -4,12 +4,15 @@ import { GroupsForm } from './components/groups_form'
4
4
  import { TeamsForm } from './components/team_form'
5
5
  import { SourceAppErrorCard } from './components/source_app_error_card'
6
6
  import { AppName } from '../../types/resources/app_name'
7
+ import { GraphId } from '../../types/resources/group_resource'
7
8
 
8
9
  type ConversationNewScreenProps = StaticScreenProps<{
9
10
  group_id?: number
10
11
  team_ids?: number[]
11
12
  plan_id?: number
12
13
  source_app_name: AppName
14
+ chat_group_graph_id?: GraphId
15
+ group_source_app_name?: AppName
13
16
  }>
14
17
 
15
18
  export const ConversationNewScreen = ({ route }: ConversationNewScreenProps) => {
@@ -7,17 +7,22 @@ import { Button, Heading, Icon, Image, Text } from '../../components'
7
7
  import { useTheme } from '../../hooks'
8
8
  import { GroupsGroupResource } from '../../types'
9
9
  import { useGroupsGroups } from '../../hooks/use_groups_groups'
10
+ import { GraphId } from '../../types/resources/group_resource'
11
+ import { AppName } from '../../types/resources/app_name'
10
12
  import { platformFontWeightMedium, pluralize } from '../../utils'
11
13
 
12
14
  type ConversationSelectRecipientsScreenProps = StaticScreenProps<{
13
- chat_group_graph_id?: string
15
+ chat_group_graph_id?: GraphId
16
+ group_source_app_name?: AppName
14
17
  }>
15
18
 
16
19
  const ASPECT_RATIO = 16 / 9
17
20
  const THUMBNAIL_WIDTH = 80
18
21
  const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO
19
22
 
20
- export const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipientsScreenProps) => {
23
+ export const ConversationSelectRecipientsScreen = ({
24
+ route,
25
+ }: ConversationSelectRecipientsScreenProps) => {
21
26
  const styles = useStyles()
22
27
  const navigation = useNavigation()
23
28
  const { data: groups = [] } = useGroupsGroups()
@@ -29,6 +34,7 @@ export const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipie
29
34
  params: {
30
35
  group_id: group.id,
31
36
  source_app_name: 'Groups',
37
+ ...route.params,
32
38
  },
33
39
  })
34
40
  }
@@ -6,12 +6,14 @@ import { ActionButton } from '../../components/display/action_button'
6
6
  import { ConversationsContextProvider } from '../../contexts/conversations_context'
7
7
  import { useCanCreateConversations } from '../../hooks'
8
8
  import { GraphId } from '../../types/resources/group_resource'
9
+ import { destructureChatGroupGraphId } from '../../utils'
9
10
  import { ListHeaderComponent } from './components/list_header_component'
11
+ import { AppName } from '../../types/resources/app_name'
10
12
 
11
13
  export type ConversationScreenProps = StaticScreenProps<{
12
14
  title?: string
13
15
  chat_group_graph_id?: GraphId
14
- group_source_app_name?: string
16
+ group_source_app_name?: AppName
15
17
  }>
16
18
 
17
19
  export function ConversationsScreen({ route }: ConversationScreenProps) {
@@ -19,6 +21,39 @@ export function ConversationsScreen({ route }: ConversationScreenProps) {
19
21
  const canCreateConversations = useCanCreateConversations()
20
22
  const styles = useStyles()
21
23
 
24
+ const { chat_group_graph_id } = route.params
25
+ const { sourceAppName, sourceId } = destructureChatGroupGraphId(chat_group_graph_id)
26
+
27
+ const handleNewConversationNavigation = () => {
28
+ if (sourceAppName === 'Services') {
29
+ return navigation.navigate('New', {
30
+ screen: 'ConversationNew',
31
+ params: {
32
+ team_ids: sourceId ? [sourceId] : [],
33
+ source_app_name: sourceAppName,
34
+ ...route.params,
35
+ },
36
+ })
37
+ }
38
+ if (sourceAppName === 'Groups') {
39
+ return navigation.navigate('New', {
40
+ screen: 'ConversationNew',
41
+ params: {
42
+ group_id: sourceId,
43
+ source_app_name: sourceAppName,
44
+ ...route.params,
45
+ },
46
+ })
47
+ }
48
+
49
+ return navigation.navigate('New', {
50
+ screen: 'ConversationSelectRecipients',
51
+ params: {
52
+ ...route.params,
53
+ },
54
+ })
55
+ }
56
+
22
57
  return (
23
58
  <View style={styles.container}>
24
59
  <ConversationsContextProvider args={route.params}>
@@ -27,7 +62,7 @@ export function ConversationsScreen({ route }: ConversationScreenProps) {
27
62
  <ActionButton
28
63
  visible={canCreateConversations}
29
64
  title="New conversation"
30
- onPress={() => navigation.navigate('New')}
65
+ onPress={handleNewConversationNavigation}
31
66
  />
32
67
  </View>
33
68
  )
@@ -0,0 +1,25 @@
1
+ import { AppName } from '../types/resources/app_name'
2
+ import { SourceType, GraphId } from '../types/resources/group_resource'
3
+
4
+ interface DestructuredChatGroupGraphIdType {
5
+ sourceAppName?: AppName
6
+ sourceType?: SourceType
7
+ sourceId?: number
8
+ }
9
+
10
+ export function destructureChatGroupGraphId(
11
+ chatGroupGraphId?: GraphId
12
+ ): DestructuredChatGroupGraphIdType {
13
+ if (!chatGroupGraphId)
14
+ return { sourceAppName: undefined, sourceType: undefined, sourceId: undefined }
15
+
16
+ const [sourceAppName, sourceType, sourceIdString] = chatGroupGraphId.split('-') as [
17
+ AppName,
18
+ SourceType,
19
+ string,
20
+ ]
21
+
22
+ const sourceIdNumber = Number(sourceIdString)
23
+
24
+ return { sourceAppName, sourceType, sourceId: sourceIdNumber }
25
+ }
@@ -7,3 +7,4 @@ export * from './uri'
7
7
  export * from './cache'
8
8
  export * from './native_adapters'
9
9
  export * from './pluralize'
10
+ export * from './destructure_chat_group_graph_id'