@planningcenter/chat-react-native 3.11.0-rc.12 → 3.11.0-rc.14

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.
@@ -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,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAU9E,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBA2IzC,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,KAAK,MAAM,OAAO,CAAA;AAMzB,OAAO,EAAE,uCAAuC,EAAE,MAAM,sBAAsB,CAAA;AAY9E,eAAO,MAAM,kCAAkC,eAE5C,uCAAuC,sBAyJzC,CAAA"}
@@ -9,10 +9,15 @@ import { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat
9
9
  import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams';
10
10
  import { TeamRecipientRow } from './components/team_recipient_row';
11
11
  import { GroupsRecipientRow } from './components/groups_recipient_row';
12
+ import { DefaultLoading } from '../../components/page/loading';
13
+ import { useAppGrants } from '../../hooks';
12
14
  const MAX_VISIBLE_RECIPIENTS = 5;
13
15
  export const ConversationSelectRecipientsScreen = ({ route, }) => {
14
16
  const styles = useStyles();
15
17
  const navigation = useNavigation();
18
+ const appGrants = useAppGrants();
19
+ const canCreateGroupsConversations = appGrants.data?.some(g => g.createConversations && g.appName === 'Groups');
20
+ const canCreateServicesConversations = appGrants.data?.some(g => g.createConversations && g.appName === 'Services');
16
21
  const { data: groups = [], isFetching: isGroupsFetching } = useGroupsGroups();
17
22
  const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
18
23
  const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS);
@@ -61,39 +66,39 @@ export const ConversationSelectRecipientsScreen = ({ route, }) => {
61
66
  });
62
67
  };
63
68
  return (<ScrollView contentContainerStyle={styles.contentContainer}>
64
- <View style={styles.section}>
65
- <View style={styles.sectionHeader}>
66
- <Heading variant="h3">My groups</Heading>
67
- </View>
68
- <View>
69
- {isGroupsFetching ? null : groupsWithCreatePermission.length === 0 ? (<BlankState subtitle="Join a group with chat enabled and permissions to start a new conversation." style={styles.blankState}/>) : (<>
70
- {visibleGroups.map(group => {
71
- return (<GroupsRecipientRow key={group.id} group={group} onPress={handleGroupsNavigateToConversationNew}/>);
72
- })}
73
- {hasMoreGroups && (<ViewMoreLinkRow onPress={handleGroupsViewMore} accessibilityHint="Navigate to a full list of your groups."/>)}
74
- {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
75
- </>)}
76
- </View>
77
- </View>
78
- <View style={styles.section}>
79
- <View style={styles.sectionHeader}>
80
- <Heading variant="h3">Teams I lead</Heading>
81
- {hasServiceTypes && (<Button style={styles.selectTeamsButton} onPress={() => navigation.navigate('New', {
82
- screen: 'ConversationFilterRecipients',
83
- params: {
84
- source_app_name: 'Services',
85
- },
86
- })} title="Select teams" variant="outline" iconNameLeft="general.search" size="sm"/>)}
87
- </View>
88
- <View>
89
- {isServiceTypesFetching ? null : hasServiceTypes ? (<>
90
- {visibleServiceTypes.map(serviceType => {
91
- return (<TeamRecipientRow key={serviceType.id} serviceType={serviceType} onPress={handleTeamsNavigateToConversationNew}/>);
92
- })}
93
- {hasMoreServiceTypes && (<ViewMoreLinkRow onPress={handleServiceTypesViewMore} accessibilityHint="Navigate to a full list of teams you lead."/>)}
94
- </>) : (<BlankState subtitle="You don't lead any teams." style={styles.blankState}/>)}
95
- </View>
96
- </View>
69
+ {canCreateGroupsConversations && (<View style={styles.section}>
70
+ <View style={styles.sectionHeader}>
71
+ <Heading variant="h3">My groups</Heading>
72
+ </View>
73
+ <View>
74
+ {isGroupsFetching ? (<DefaultLoading />) : groupsWithCreatePermission.length === 0 ? (<BlankState subtitle="Join a group with chat enabled and permissions to start a new conversation." style={styles.blankState}/>) : (<>
75
+ {visibleGroups.map(group => {
76
+ return (<GroupsRecipientRow key={group.id} group={group} onPress={handleGroupsNavigateToConversationNew}/>);
77
+ })}
78
+ {hasMoreGroups && (<ViewMoreLinkRow onPress={handleGroupsViewMore} accessibilityHint="Navigate to a full list of your groups."/>)}
79
+ {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
80
+ </>)}
81
+ </View>
82
+ </View>)}
83
+ {canCreateServicesConversations && (<View style={styles.section}>
84
+ <View style={styles.sectionHeader}>
85
+ <Heading variant="h3">Teams I lead</Heading>
86
+ {hasServiceTypes && (<Button style={styles.selectTeamsButton} onPress={() => navigation.navigate('New', {
87
+ screen: 'ConversationFilterRecipients',
88
+ params: {
89
+ source_app_name: 'Services',
90
+ },
91
+ })} title="Select teams" variant="outline" iconNameLeft="general.search" size="sm"/>)}
92
+ </View>
93
+ <View>
94
+ {isServiceTypesFetching ? (<DefaultLoading />) : hasServiceTypes ? (<>
95
+ {visibleServiceTypes.map(serviceType => {
96
+ return (<TeamRecipientRow key={serviceType.id} serviceType={serviceType} onPress={handleTeamsNavigateToConversationNew}/>);
97
+ })}
98
+ {hasMoreServiceTypes && (<ViewMoreLinkRow onPress={handleServiceTypesViewMore} accessibilityHint="Navigate to a full list of teams you lead."/>)}
99
+ </>) : (<BlankState subtitle="You don't lead any teams." style={styles.blankState}/>)}
100
+ </View>
101
+ </View>)}
97
102
  </ScrollView>);
98
103
  };
99
104
  const useStyles = () => {
@@ -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,aAAa,EAAE,MAAM,0BAA0B,CAA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U,CAAC,EAAG,CAC9E,CACH;QAAA,EAAE,IAAI,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,UAAU,CAAC,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,EAAE,GAAG,MAAM;SAC3B;QACD,OAAO,EAAE;YACP,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,CAAC;SACjB;QACD,iBAAiB,EAAE,EAAE;QACrB,UAAU,EAAE;YACV,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,EAAE;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { BlankState, Button, Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { ViewMoreLinkRow } from './components/view_more_link_row'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\nimport { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'\nimport { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'\nimport { TeamRecipientRow } from './components/team_recipient_row'\nimport { GroupsRecipientRow } from './components/groups_recipient_row'\n\nconst MAX_VISIBLE_RECIPIENTS = 5\n\nexport const ConversationSelectRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n\n const { data: groups = [], isFetching: isGroupsFetching } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_RECIPIENTS\n const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length\n const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups\n\n const handleGroupsNavigateToConversationNew = (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 const handleGroupsViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n const { serviceTypes, isFetching: isServiceTypesFetching } = useServiceTypesWithTeams()\n const visibleServiceTypes = serviceTypes.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreServiceTypes = serviceTypes.length > MAX_VISIBLE_RECIPIENTS\n const hasServiceTypes = serviceTypes.length > 0\n\n const handleTeamsNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {\n const teamIds = teams.map(team => team.id)\n\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: teamIds,\n source_app_name: 'Services',\n ...route.params,\n },\n })\n }\n\n const handleServiceTypesViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectTeamsILeadRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n return (\n <ScrollView contentContainerStyle={styles.contentContainer}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {isGroupsFetching ? null : groupsWithCreatePermission.length === 0 ? (\n <BlankState\n subtitle=\"Join a group with chat enabled and permissions to start a new conversation.\"\n style={styles.blankState}\n />\n ) : (\n <>\n {visibleGroups.map(group => {\n return (\n <GroupsRecipientRow\n key={group.id}\n group={group}\n onPress={handleGroupsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreGroups && (\n <ViewMoreLinkRow\n onPress={handleGroupsViewMore}\n accessibilityHint=\"Navigate to a full list of your groups.\"\n />\n )}\n {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}\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 {hasServiceTypes && (\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 size=\"sm\"\n />\n )}\n </View>\n <View>\n {isServiceTypesFetching ? null : hasServiceTypes ? (\n <>\n {visibleServiceTypes.map(serviceType => {\n return (\n <TeamRecipientRow\n key={serviceType.id}\n serviceType={serviceType}\n onPress={handleTeamsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreServiceTypes && (\n <ViewMoreLinkRow\n onPress={handleServiceTypesViewMore}\n accessibilityHint=\"Navigate to a full list of teams you lead.\"\n />\n )}\n </>\n ) : (\n <BlankState subtitle=\"You don't lead any teams.\" style={styles.blankState} />\n )}\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n gap: 24,\n paddingTop: 16,\n paddingBottom: 16 + bottom,\n },\n section: {\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 4,\n },\n selectTeamsButton: {},\n blankState: {\n marginTop: 24,\n marginBottom: 48,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/conversation_select_recipients/conversation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AAE,EAAE;QACrB,UAAU,EAAE;YACV,SAAS,EAAE,EAAE;YACb,YAAY,EAAE,EAAE;SACjB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { BlankState, Button, Heading } from '../../components'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { ConversationSelectRecipientsScreenProps } from './types/screen_props'\nimport { ViewMoreLinkRow } from './components/view_more_link_row'\nimport { GroupsWithoutChatDisclaimerRow } from './components/groups_without_chat_disclaimer_row'\nimport { useServiceTypesWithTeams } from '../conversation_filter_recipients/hooks/use_service_types_with_teams'\nimport { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'\nimport { TeamRecipientRow } from './components/team_recipient_row'\nimport { GroupsRecipientRow } from './components/groups_recipient_row'\nimport { DefaultLoading } from '../../components/page/loading'\nimport { useAppGrants } from '../../hooks'\n\nconst MAX_VISIBLE_RECIPIENTS = 5\n\nexport const ConversationSelectRecipientsScreen = ({\n route,\n}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const appGrants = useAppGrants()\n const canCreateGroupsConversations = appGrants.data?.some(\n g => g.createConversations && g.appName === 'Groups'\n )\n const canCreateServicesConversations = appGrants.data?.some(\n g => g.createConversations && g.appName === 'Services'\n )\n const { data: groups = [], isFetching: isGroupsFetching } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreGroups = groupsWithCreatePermission.length > MAX_VISIBLE_RECIPIENTS\n const hasGroupsWithoutChatPermission = groups.length > groupsWithCreatePermission.length\n const showGroupsDisclaimer = hasGroupsWithoutChatPermission && !hasMoreGroups\n\n const handleGroupsNavigateToConversationNew = (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 const handleGroupsViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectGroupRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n const { serviceTypes, isFetching: isServiceTypesFetching } = useServiceTypesWithTeams()\n const visibleServiceTypes = serviceTypes.slice(0, MAX_VISIBLE_RECIPIENTS)\n const hasMoreServiceTypes = serviceTypes.length > MAX_VISIBLE_RECIPIENTS\n const hasServiceTypes = serviceTypes.length > 0\n\n const handleTeamsNavigateToConversationNew = (teams: ServiceTypeWithTeams['teams']) => {\n const teamIds = teams.map(team => team.id)\n\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n team_ids: teamIds,\n source_app_name: 'Services',\n ...route.params,\n },\n })\n }\n\n const handleServiceTypesViewMore = () => {\n navigation.navigate('New', {\n screen: 'ConversationSelectTeamsILeadRecipients',\n params: {\n ...route.params,\n },\n })\n }\n\n return (\n <ScrollView contentContainerStyle={styles.contentContainer}>\n {canCreateGroupsConversations && (\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">My groups</Heading>\n </View>\n <View>\n {isGroupsFetching ? (\n <DefaultLoading />\n ) : groupsWithCreatePermission.length === 0 ? (\n <BlankState\n subtitle=\"Join a group with chat enabled and permissions to start a new conversation.\"\n style={styles.blankState}\n />\n ) : (\n <>\n {visibleGroups.map(group => {\n return (\n <GroupsRecipientRow\n key={group.id}\n group={group}\n onPress={handleGroupsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreGroups && (\n <ViewMoreLinkRow\n onPress={handleGroupsViewMore}\n accessibilityHint=\"Navigate to a full list of your groups.\"\n />\n )}\n {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}\n </>\n )}\n </View>\n </View>\n )}\n {canCreateServicesConversations && (\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading variant=\"h3\">Teams I lead</Heading>\n {hasServiceTypes && (\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 size=\"sm\"\n />\n )}\n </View>\n <View>\n {isServiceTypesFetching ? (\n <DefaultLoading />\n ) : hasServiceTypes ? (\n <>\n {visibleServiceTypes.map(serviceType => {\n return (\n <TeamRecipientRow\n key={serviceType.id}\n serviceType={serviceType}\n onPress={handleTeamsNavigateToConversationNew}\n />\n )\n })}\n {hasMoreServiceTypes && (\n <ViewMoreLinkRow\n onPress={handleServiceTypesViewMore}\n accessibilityHint=\"Navigate to a full list of teams you lead.\"\n />\n )}\n </>\n ) : (\n <BlankState subtitle=\"You don't lead any teams.\" style={styles.blankState} />\n )}\n </View>\n </View>\n )}\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n contentContainer: {\n gap: 24,\n paddingTop: 16,\n paddingBottom: 16 + bottom,\n },\n section: {\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingHorizontal: 16,\n paddingBottom: 4,\n },\n selectTeamsButton: {},\n blankState: {\n marginTop: 24,\n marginBottom: 48,\n },\n })\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.11.0-rc.12",
3
+ "version": "3.11.0-rc.14",
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": "7973035cbb1c1a8df6f00ee5aa5eca0ff5413161"
58
+ "gitHead": "54e327eceb8fea869658af455eb80d28fd362938"
59
59
  }
@@ -12,6 +12,8 @@ import { useServiceTypesWithTeams } from '../conversation_filter_recipients/hook
12
12
  import { ServiceTypeWithTeams } from '../conversation_filter_recipients/types'
13
13
  import { TeamRecipientRow } from './components/team_recipient_row'
14
14
  import { GroupsRecipientRow } from './components/groups_recipient_row'
15
+ import { DefaultLoading } from '../../components/page/loading'
16
+ import { useAppGrants } from '../../hooks'
15
17
 
16
18
  const MAX_VISIBLE_RECIPIENTS = 5
17
19
 
@@ -20,7 +22,13 @@ export const ConversationSelectRecipientsScreen = ({
20
22
  }: ConversationSelectRecipientsScreenProps) => {
21
23
  const styles = useStyles()
22
24
  const navigation = useNavigation()
23
-
25
+ const appGrants = useAppGrants()
26
+ const canCreateGroupsConversations = appGrants.data?.some(
27
+ g => g.createConversations && g.appName === 'Groups'
28
+ )
29
+ const canCreateServicesConversations = appGrants.data?.some(
30
+ g => g.createConversations && g.appName === 'Services'
31
+ )
24
32
  const { data: groups = [], isFetching: isGroupsFetching } = useGroupsGroups()
25
33
  const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)
26
34
  const visibleGroups = groupsWithCreatePermission.slice(0, MAX_VISIBLE_RECIPIENTS)
@@ -77,83 +85,91 @@ export const ConversationSelectRecipientsScreen = ({
77
85
 
78
86
  return (
79
87
  <ScrollView contentContainerStyle={styles.contentContainer}>
80
- <View style={styles.section}>
81
- <View style={styles.sectionHeader}>
82
- <Heading variant="h3">My groups</Heading>
83
- </View>
84
- <View>
85
- {isGroupsFetching ? null : groupsWithCreatePermission.length === 0 ? (
86
- <BlankState
87
- subtitle="Join a group with chat enabled and permissions to start a new conversation."
88
- style={styles.blankState}
89
- />
90
- ) : (
91
- <>
92
- {visibleGroups.map(group => {
93
- return (
94
- <GroupsRecipientRow
95
- key={group.id}
96
- group={group}
97
- onPress={handleGroupsNavigateToConversationNew}
88
+ {canCreateGroupsConversations && (
89
+ <View style={styles.section}>
90
+ <View style={styles.sectionHeader}>
91
+ <Heading variant="h3">My groups</Heading>
92
+ </View>
93
+ <View>
94
+ {isGroupsFetching ? (
95
+ <DefaultLoading />
96
+ ) : groupsWithCreatePermission.length === 0 ? (
97
+ <BlankState
98
+ subtitle="Join a group with chat enabled and permissions to start a new conversation."
99
+ style={styles.blankState}
100
+ />
101
+ ) : (
102
+ <>
103
+ {visibleGroups.map(group => {
104
+ return (
105
+ <GroupsRecipientRow
106
+ key={group.id}
107
+ group={group}
108
+ onPress={handleGroupsNavigateToConversationNew}
109
+ />
110
+ )
111
+ })}
112
+ {hasMoreGroups && (
113
+ <ViewMoreLinkRow
114
+ onPress={handleGroupsViewMore}
115
+ accessibilityHint="Navigate to a full list of your groups."
98
116
  />
99
- )
100
- })}
101
- {hasMoreGroups && (
102
- <ViewMoreLinkRow
103
- onPress={handleGroupsViewMore}
104
- accessibilityHint="Navigate to a full list of your groups."
105
- />
106
- )}
107
- {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
108
- </>
109
- )}
110
- </View>
111
- </View>
112
- <View style={styles.section}>
113
- <View style={styles.sectionHeader}>
114
- <Heading variant="h3">Teams I lead</Heading>
115
- {hasServiceTypes && (
116
- <Button
117
- style={styles.selectTeamsButton}
118
- onPress={() =>
119
- navigation.navigate('New', {
120
- screen: 'ConversationFilterRecipients',
121
- params: {
122
- source_app_name: 'Services',
123
- },
124
- })
125
- }
126
- title="Select teams"
127
- variant="outline"
128
- iconNameLeft="general.search"
129
- size="sm"
130
- />
131
- )}
117
+ )}
118
+ {showGroupsDisclaimer && <GroupsWithoutChatDisclaimerRow />}
119
+ </>
120
+ )}
121
+ </View>
132
122
  </View>
133
- <View>
134
- {isServiceTypesFetching ? null : hasServiceTypes ? (
135
- <>
136
- {visibleServiceTypes.map(serviceType => {
137
- return (
138
- <TeamRecipientRow
139
- key={serviceType.id}
140
- serviceType={serviceType}
141
- onPress={handleTeamsNavigateToConversationNew}
123
+ )}
124
+ {canCreateServicesConversations && (
125
+ <View style={styles.section}>
126
+ <View style={styles.sectionHeader}>
127
+ <Heading variant="h3">Teams I lead</Heading>
128
+ {hasServiceTypes && (
129
+ <Button
130
+ style={styles.selectTeamsButton}
131
+ onPress={() =>
132
+ navigation.navigate('New', {
133
+ screen: 'ConversationFilterRecipients',
134
+ params: {
135
+ source_app_name: 'Services',
136
+ },
137
+ })
138
+ }
139
+ title="Select teams"
140
+ variant="outline"
141
+ iconNameLeft="general.search"
142
+ size="sm"
143
+ />
144
+ )}
145
+ </View>
146
+ <View>
147
+ {isServiceTypesFetching ? (
148
+ <DefaultLoading />
149
+ ) : hasServiceTypes ? (
150
+ <>
151
+ {visibleServiceTypes.map(serviceType => {
152
+ return (
153
+ <TeamRecipientRow
154
+ key={serviceType.id}
155
+ serviceType={serviceType}
156
+ onPress={handleTeamsNavigateToConversationNew}
157
+ />
158
+ )
159
+ })}
160
+ {hasMoreServiceTypes && (
161
+ <ViewMoreLinkRow
162
+ onPress={handleServiceTypesViewMore}
163
+ accessibilityHint="Navigate to a full list of teams you lead."
142
164
  />
143
- )
144
- })}
145
- {hasMoreServiceTypes && (
146
- <ViewMoreLinkRow
147
- onPress={handleServiceTypesViewMore}
148
- accessibilityHint="Navigate to a full list of teams you lead."
149
- />
150
- )}
151
- </>
152
- ) : (
153
- <BlankState subtitle="You don't lead any teams." style={styles.blankState} />
154
- )}
165
+ )}
166
+ </>
167
+ ) : (
168
+ <BlankState subtitle="You don't lead any teams." style={styles.blankState} />
169
+ )}
170
+ </View>
155
171
  </View>
156
- </View>
172
+ )}
157
173
  </ScrollView>
158
174
  )
159
175
  }