@planningcenter/chat-react-native 3.7.1-rc.0 → 3.7.1-rc.2
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.
- package/build/components/primitive/form_sheet.d.ts +4 -2
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +3 -3
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/navigation/index.d.ts +2 -2
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +3 -2
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +1 -3
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +3 -2
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.js +1 -3
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts +2 -3
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +40 -39
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/types.d.ts +3 -0
- package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/types.js.map +1 -1
- package/build/screens/message_actions_screen.js +3 -2
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +1 -2
- package/build/screens/reactions_screen.d.ts.map +1 -1
- package/build/screens/reactions_screen.js +51 -37
- package/build/screens/reactions_screen.js.map +1 -1
- package/package.json +2 -2
- package/src/components/primitive/form_sheet.tsx +7 -3
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +8 -4
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +7 -4
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +97 -70
- package/src/screens/conversation_filter_recipients/types.tsx +2 -0
- package/src/screens/message_actions_screen.tsx +3 -2
- package/src/screens/reactions_screen.tsx +59 -41
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts +0 -5
- package/build/screens/conversation_filter_recipients/components/navigation_header.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/components/navigation_header.js +0 -46
- package/build/screens/conversation_filter_recipients/components/navigation_header.js.map +0 -1
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts +0 -17
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.d.ts.map +0 -1
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js +0 -37
- package/build/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.js.map +0 -1
- package/src/screens/conversation_filter_recipients/components/navigation_header.tsx +0 -68
- package/src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx +0 -53
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native'
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import React, { memo } from 'react'
|
|
3
|
+
import { Platform, StyleSheet, View } from 'react-native'
|
|
4
|
+
import { FlatList } from 'react-native-gesture-handler'
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
6
|
import { Avatar, Text } from '../components'
|
|
7
|
-
import { REACTION_EMOJIS
|
|
7
|
+
import { REACTION_EMOJIS } from '../components/conversation/message_reaction'
|
|
8
8
|
import { Tabs } from '../components/display/tabs'
|
|
9
9
|
import { useSuspenseGet, useTheme } from '../hooks'
|
|
10
10
|
import { useConversationMessages } from '../hooks/use_conversation_messages'
|
|
11
11
|
import { MemberResource } from '../types'
|
|
12
12
|
import { ReactionCountResource } from '../types/resources/reaction'
|
|
13
|
-
import {
|
|
13
|
+
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
14
|
+
import { platformFontWeightMedium } from '../utils'
|
|
15
|
+
import { useFontScale } from '../hooks/use_font_scale'
|
|
14
16
|
|
|
15
|
-
export const ReactionsScreenOptions
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
17
|
+
export const ReactionsScreenOptions = getFormSheetScreenOptions({
|
|
18
|
+
sheetAllowedDetents: Platform.select({
|
|
19
|
+
android: [0.5, 0.94], // Going straight to full 0.94 preserves height of screen on Android
|
|
20
|
+
default: [0.5, 1],
|
|
21
|
+
}),
|
|
22
|
+
headerTitle: 'Reactions',
|
|
23
|
+
})
|
|
22
24
|
|
|
23
25
|
export type ReactionScreenProps = StaticScreenProps<{
|
|
24
26
|
message_id: string
|
|
@@ -60,7 +62,7 @@ export function ReactionsScreen({ route }: ReactionScreenProps) {
|
|
|
60
62
|
const authors = members.filter(member => authorIds.includes(member.id))
|
|
61
63
|
|
|
62
64
|
return (
|
|
63
|
-
<
|
|
65
|
+
<FormSheet.Root contentStyle={styles.formSheetContent}>
|
|
64
66
|
<Tabs
|
|
65
67
|
data={reactionCounts}
|
|
66
68
|
activeTab={reactionCount}
|
|
@@ -76,17 +78,13 @@ export function ReactionsScreen({ route }: ReactionScreenProps) {
|
|
|
76
78
|
)}
|
|
77
79
|
style={styles.actions}
|
|
78
80
|
/>
|
|
79
|
-
<
|
|
81
|
+
<FlatList
|
|
80
82
|
data={authors}
|
|
83
|
+
contentContainerStyle={styles.contentContainer}
|
|
81
84
|
keyExtractor={item => item.id.toString()}
|
|
82
|
-
renderItem={({ item: author }) =>
|
|
83
|
-
<View style={styles.authorList}>
|
|
84
|
-
<Avatar size={'md'} sourceUri={author.avatar} />
|
|
85
|
-
<Text key={author.id}>{author.name}</Text>
|
|
86
|
-
</View>
|
|
87
|
-
)}
|
|
85
|
+
renderItem={({ item: author }) => <Author author={author} key={author.id} />}
|
|
88
86
|
/>
|
|
89
|
-
</
|
|
87
|
+
</FormSheet.Root>
|
|
90
88
|
)
|
|
91
89
|
}
|
|
92
90
|
|
|
@@ -98,47 +96,67 @@ const Reaction = ({
|
|
|
98
96
|
onPress: () => void
|
|
99
97
|
}) => {
|
|
100
98
|
const styles = useStyles()
|
|
101
|
-
const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })
|
|
102
99
|
|
|
103
100
|
return (
|
|
104
101
|
<View key={reaction.value} style={styles.reaction}>
|
|
105
|
-
<Text style={
|
|
106
|
-
<Text style={
|
|
102
|
+
<Text style={styles.reactionContent}>{REACTION_EMOJIS[reaction.value]}</Text>
|
|
103
|
+
<Text style={styles.reactionContent}>{reaction.count}</Text>
|
|
107
104
|
</View>
|
|
108
105
|
)
|
|
109
106
|
}
|
|
110
107
|
|
|
108
|
+
type AuthorProps = Pick<MemberResource, 'id' | 'name' | 'avatar'>
|
|
109
|
+
|
|
110
|
+
const Author = memo(({ author }: { author: AuthorProps }) => {
|
|
111
|
+
const styles = useStyles()
|
|
112
|
+
|
|
113
|
+
return (
|
|
114
|
+
<View style={styles.authorRow}>
|
|
115
|
+
<Avatar sourceUri={author.avatar} size="sm" />
|
|
116
|
+
<Text variant="tertiary" numberOfLines={2} style={styles.authorName}>
|
|
117
|
+
{author.name}
|
|
118
|
+
</Text>
|
|
119
|
+
</View>
|
|
120
|
+
)
|
|
121
|
+
})
|
|
122
|
+
|
|
111
123
|
const useStyles = () => {
|
|
112
|
-
const
|
|
113
|
-
const { height } = useWindowDimensions()
|
|
124
|
+
const { colors } = useTheme()
|
|
114
125
|
const { bottom } = useSafeAreaInsets()
|
|
126
|
+
const fontScale = useFontScale({ maxFontSizeMultiplier: 1.3 })
|
|
115
127
|
|
|
116
128
|
return StyleSheet.create({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
height,
|
|
124
|
-
gap: 8,
|
|
129
|
+
formSheetContent: {
|
|
130
|
+
paddingTop: Platform.select({ android: 4, default: 16 }),
|
|
131
|
+
},
|
|
132
|
+
contentContainer: {
|
|
133
|
+
paddingTop: 8,
|
|
134
|
+
paddingBottom: bottom + Platform.select({ android: 24, default: 16 }),
|
|
125
135
|
},
|
|
126
|
-
|
|
136
|
+
authorRow: {
|
|
127
137
|
flexDirection: 'row',
|
|
128
138
|
alignItems: 'center',
|
|
129
139
|
gap: 8,
|
|
130
|
-
|
|
131
|
-
|
|
140
|
+
paddingVertical: 8,
|
|
141
|
+
paddingHorizontal: 16,
|
|
142
|
+
flex: 1,
|
|
143
|
+
},
|
|
144
|
+
authorName: {
|
|
145
|
+
flex: 1,
|
|
132
146
|
},
|
|
133
147
|
reaction: {
|
|
134
|
-
|
|
135
|
-
|
|
148
|
+
paddingHorizontal: 8,
|
|
149
|
+
paddingVertical: 16,
|
|
136
150
|
flexDirection: 'row',
|
|
137
151
|
gap: 4,
|
|
138
152
|
},
|
|
153
|
+
reactionContent: {
|
|
154
|
+
fontSize: 18,
|
|
155
|
+
fontWeight: platformFontWeightMedium,
|
|
156
|
+
},
|
|
139
157
|
actions: {
|
|
140
|
-
minHeight:
|
|
141
|
-
borderBottomColor:
|
|
158
|
+
minHeight: 68 * fontScale,
|
|
159
|
+
borderBottomColor: colors.borderColorDefaultBase,
|
|
142
160
|
borderBottomWidth: 1,
|
|
143
161
|
},
|
|
144
162
|
errorContainer: {
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { HeaderTitleProps } from '@react-navigation/elements';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const FilterHeaderTitle: ({ tintColor }: HeaderTitleProps) => React.JSX.Element;
|
|
4
|
-
export declare const HeaderRightWithContext: () => React.JSX.Element;
|
|
5
|
-
//# sourceMappingURL=navigation_header.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation_header.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/navigation_header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAO,MAAM,iBAAiB,kBAAmB,gBAAgB,sBAIhE,CAAA;AA+BD,eAAO,MAAM,sBAAsB,yBAMlC,CAAA"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { HeaderTitle } from '@react-navigation/elements';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { StyleSheet, View } from 'react-native';
|
|
4
|
-
import { Button, TextButton } from '../../../components';
|
|
5
|
-
import { useRoute } from '@react-navigation/native';
|
|
6
|
-
import { tokens } from '../../../vendor/tapestry/tokens';
|
|
7
|
-
import { FilterRecipientsProvider, useFilterRecipientsContext, } from '../context/conversation_filter_recipients_context';
|
|
8
|
-
export const FilterHeaderTitle = ({ tintColor }) => {
|
|
9
|
-
const styles = useStyles();
|
|
10
|
-
return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Teams I lead</HeaderTitle>;
|
|
11
|
-
};
|
|
12
|
-
const HeaderRight = () => {
|
|
13
|
-
const styles = useStyles();
|
|
14
|
-
const route = useRoute();
|
|
15
|
-
const { resetTeamFilters, applyTeamFilters } = useFilterRecipientsContext();
|
|
16
|
-
const { team_ids } = route.params;
|
|
17
|
-
const noTeamsSelected = team_ids?.length === 0 || !team_ids;
|
|
18
|
-
const applyButtonAccessibilityHint = noTeamsSelected
|
|
19
|
-
? 'Select at least one team to navigate to the final step in creating your conversation.'
|
|
20
|
-
: 'Saves selected teams and navigates to the final step to create your conversation.';
|
|
21
|
-
return (<View style={styles.headerRight}>
|
|
22
|
-
<TextButton onPress={resetTeamFilters} accessibilityHint="Cancels any selected teams and closes this modal.">
|
|
23
|
-
Cancel
|
|
24
|
-
</TextButton>
|
|
25
|
-
<Button title="Apply" accessibilityHint={applyButtonAccessibilityHint} onPress={() => applyTeamFilters(route.params)} disabled={noTeamsSelected}/>
|
|
26
|
-
</View>);
|
|
27
|
-
};
|
|
28
|
-
export const HeaderRightWithContext = () => {
|
|
29
|
-
return (<FilterRecipientsProvider>
|
|
30
|
-
<HeaderRight />
|
|
31
|
-
</FilterRecipientsProvider>);
|
|
32
|
-
};
|
|
33
|
-
const useStyles = () => {
|
|
34
|
-
return StyleSheet.create({
|
|
35
|
-
headerTitle: {
|
|
36
|
-
fontSize: tokens.fontSizeLg,
|
|
37
|
-
flex: 1,
|
|
38
|
-
},
|
|
39
|
-
headerRight: {
|
|
40
|
-
flexDirection: 'row',
|
|
41
|
-
gap: 16,
|
|
42
|
-
alignItems: 'center',
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=navigation_header.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"navigation_header.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/components/navigation_header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,4BAA4B,CAAA;AAC1E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACxD,OAAO,EAAa,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,mDAAmD,CAAA;AAG1D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,SAAS,EAAoB,EAAE,EAAE;IACnE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;AACnG,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IACrF,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,0BAA0B,EAAE,CAAA;IAE3E,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IACjC,MAAM,eAAe,GAAG,QAAQ,EAAE,MAAM,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAA;IAC3D,MAAM,4BAA4B,GAAG,eAAe;QAClD,CAAC,CAAC,uFAAuF;QACzF,CAAC,CAAC,mFAAmF,CAAA;IAEvF,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAC9B;MAAA,CAAC,UAAU,CACT,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,iBAAiB,CAAC,mDAAmD,CAErE;;MACF,EAAE,UAAU,CACZ;MAAA,CAAC,MAAM,CACL,KAAK,CAAC,OAAO,CACb,iBAAiB,CAAC,CAAC,4BAA4B,CAAC,CAChD,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAC9C,QAAQ,CAAC,CAAC,eAAe,CAAC,EAE9B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE;IACzC,OAAO,CACL,CAAC,wBAAwB,CACvB;MAAA,CAAC,WAAW,CAAC,AAAD,EACd;IAAA,EAAE,wBAAwB,CAAC,CAC5B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE;YACX,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,IAAI,EAAE,CAAC;SACR;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps } from '@react-navigation/elements'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Button, TextButton } from '../../../components'\nimport { RouteProp, useRoute } from '@react-navigation/native'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport {\n FilterRecipientsProvider,\n useFilterRecipientsContext,\n} from '../context/conversation_filter_recipients_context'\nimport { ConversationFilterRecipientsScreenProps } from '../types'\n\nexport const FilterHeaderTitle = ({ tintColor }: HeaderTitleProps) => {\n const styles = useStyles()\n\n return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Teams I lead</HeaderTitle>\n}\n\nconst HeaderRight = () => {\n const styles = useStyles()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const { resetTeamFilters, applyTeamFilters } = useFilterRecipientsContext()\n\n const { team_ids } = route.params\n const noTeamsSelected = team_ids?.length === 0 || !team_ids\n const applyButtonAccessibilityHint = noTeamsSelected\n ? 'Select at least one team to navigate to the final step in creating your conversation.'\n : 'Saves selected teams and navigates to the final step to create your conversation.'\n\n return (\n <View style={styles.headerRight}>\n <TextButton\n onPress={resetTeamFilters}\n accessibilityHint=\"Cancels any selected teams and closes this modal.\"\n >\n Cancel\n </TextButton>\n <Button\n title=\"Apply\"\n accessibilityHint={applyButtonAccessibilityHint}\n onPress={() => applyTeamFilters(route.params)}\n disabled={noTeamsSelected}\n />\n </View>\n )\n}\n\nexport const HeaderRightWithContext = () => {\n return (\n <FilterRecipientsProvider>\n <HeaderRight />\n </FilterRecipientsProvider>\n )\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n headerTitle: {\n fontSize: tokens.fontSizeLg,\n flex: 1,\n },\n headerRight: {\n flexDirection: 'row',\n gap: 16,\n alignItems: 'center',\n },\n })\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PropsWithChildren } from 'react';
|
|
3
|
-
import { ConversationFilterRecipientsParams } from '../types';
|
|
4
|
-
export declare const FilterRecipientsContext: React.Context<{
|
|
5
|
-
params: ConversationFilterRecipientsParams;
|
|
6
|
-
resetTeamFilters: () => void;
|
|
7
|
-
setTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
8
|
-
applyTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
9
|
-
}>;
|
|
10
|
-
export declare const FilterRecipientsProvider: ({ children }: PropsWithChildren) => React.JSX.Element;
|
|
11
|
-
export declare const useFilterRecipientsContext: () => {
|
|
12
|
-
params: ConversationFilterRecipientsParams;
|
|
13
|
-
resetTeamFilters: () => void;
|
|
14
|
-
setTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
15
|
-
applyTeamFilters: (params: ConversationFilterRecipientsParams) => void;
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=conversation_filter_recipients_context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_recipients_context.d.ts","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAiB,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,EACL,kCAAkC,EAEnC,MAAM,UAAU,CAAA;AAGjB,eAAO,MAAM,uBAAuB;YAC1B,kCAAkC;sBACxB,MAAM,IAAI;oBACZ,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;sBAClD,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;EAStE,CAAA;AAEF,eAAO,MAAM,wBAAwB,iBAAkB,iBAAiB,sBAwBvE,CAAA;AAED,eAAO,MAAM,0BAA0B;YAxC7B,kCAAkC;sBACxB,MAAM,IAAI;oBACZ,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;sBAClD,CAAC,MAAM,EAAE,kCAAkC,KAAK,IAAI;CAuCvE,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createContext } from 'react';
|
|
3
|
-
import { StackActions, useNavigation, useRoute } from '@react-navigation/native';
|
|
4
|
-
export const FilterRecipientsContext = createContext({
|
|
5
|
-
params: {
|
|
6
|
-
source_app_name: undefined,
|
|
7
|
-
team_ids: [],
|
|
8
|
-
},
|
|
9
|
-
resetTeamFilters: () => { },
|
|
10
|
-
setTeamFilters: () => { },
|
|
11
|
-
applyTeamFilters: () => { },
|
|
12
|
-
});
|
|
13
|
-
export const FilterRecipientsProvider = ({ children }) => {
|
|
14
|
-
const navigation = useNavigation();
|
|
15
|
-
const route = useRoute();
|
|
16
|
-
const filterContextValue = {
|
|
17
|
-
params: route.params,
|
|
18
|
-
resetTeamFilters: () => {
|
|
19
|
-
navigation.goBack();
|
|
20
|
-
},
|
|
21
|
-
setTeamFilters: (params) => {
|
|
22
|
-
navigation.setParams({
|
|
23
|
-
team_ids: params.team_ids,
|
|
24
|
-
});
|
|
25
|
-
},
|
|
26
|
-
applyTeamFilters: (params) => {
|
|
27
|
-
navigation.dispatch(StackActions.popTo('ConversationNew', params));
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
return (<FilterRecipientsContext.Provider value={filterContextValue}>
|
|
31
|
-
{children}
|
|
32
|
-
</FilterRecipientsContext.Provider>);
|
|
33
|
-
};
|
|
34
|
-
export const useFilterRecipientsContext = () => {
|
|
35
|
-
return React.useContext(FilterRecipientsContext);
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=conversation_filter_recipients_context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_filter_recipients_context.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filter_recipients/context/conversation_filter_recipients_context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAA;AACxD,OAAO,EAAa,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAO3F,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAKjD;IACD,MAAM,EAAE;QACN,eAAe,EAAE,SAAS;QAC1B,QAAQ,EAAE,EAAE;KACb;IACD,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;IAC1B,cAAc,EAAE,GAAG,EAAE,GAAE,CAAC;IACxB,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC3B,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAC1E,MAAM,UAAU,GACd,aAAa,EAAsE,CAAA;IACrF,MAAM,KAAK,GAAG,QAAQ,EAA+D,CAAA;IACrF,MAAM,kBAAkB,GAAG;QACzB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,gBAAgB,EAAE,GAAG,EAAE;YACrB,UAAU,CAAC,MAAM,EAAE,CAAA;QACrB,CAAC;QACD,cAAc,EAAE,CAAC,MAAmE,EAAE,EAAE;YACtF,UAAU,CAAC,SAAS,CAAC;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B,CAAC,CAAA;QACJ,CAAC;QACD,gBAAgB,EAAE,CAAC,MAA0C,EAAE,EAAE;YAC/D,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC,CAAA;QACpE,CAAC;KACF,CAAA;IAED,OAAO,CACL,CAAC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAC1D;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAuB,CAAC,QAAQ,CAAC,CACpC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE;IAC7C,OAAO,KAAK,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAA;AAClD,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { createContext, PropsWithChildren } from 'react'\nimport { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'\nimport {\n ConversationFilterRecipientsParams,\n ConversationFilterRecipientsScreenProps,\n} from '../types'\nimport { NativeStackNavigationProp } from '@react-navigation/native-stack'\n\nexport const FilterRecipientsContext = createContext<{\n params: ConversationFilterRecipientsParams\n resetTeamFilters: () => void\n setTeamFilters: (params: ConversationFilterRecipientsParams) => void\n applyTeamFilters: (params: ConversationFilterRecipientsParams) => void\n}>({\n params: {\n source_app_name: undefined,\n team_ids: [],\n },\n resetTeamFilters: () => {},\n setTeamFilters: () => {},\n applyTeamFilters: () => {},\n})\n\nexport const FilterRecipientsProvider = ({ children }: PropsWithChildren) => {\n const navigation =\n useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()\n const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()\n const filterContextValue = {\n params: route.params,\n resetTeamFilters: () => {\n navigation.goBack()\n },\n setTeamFilters: (params: Omit<ConversationFilterRecipientsParams, 'source_app_name'>) => {\n navigation.setParams({\n team_ids: params.team_ids,\n })\n },\n applyTeamFilters: (params: ConversationFilterRecipientsParams) => {\n navigation.dispatch(StackActions.popTo('ConversationNew', params))\n },\n }\n\n return (\n <FilterRecipientsContext.Provider value={filterContextValue}>\n {children}\n </FilterRecipientsContext.Provider>\n )\n}\n\nexport const useFilterRecipientsContext = () => {\n return React.useContext(FilterRecipientsContext)\n}\n"]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { HeaderTitle, HeaderTitleProps } from '@react-navigation/elements'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { StyleSheet, View } from 'react-native'
|
|
4
|
-
import { Button, TextButton } from '../../../components'
|
|
5
|
-
import { RouteProp, useRoute } from '@react-navigation/native'
|
|
6
|
-
import { tokens } from '../../../vendor/tapestry/tokens'
|
|
7
|
-
import {
|
|
8
|
-
FilterRecipientsProvider,
|
|
9
|
-
useFilterRecipientsContext,
|
|
10
|
-
} from '../context/conversation_filter_recipients_context'
|
|
11
|
-
import { ConversationFilterRecipientsScreenProps } from '../types'
|
|
12
|
-
|
|
13
|
-
export const FilterHeaderTitle = ({ tintColor }: HeaderTitleProps) => {
|
|
14
|
-
const styles = useStyles()
|
|
15
|
-
|
|
16
|
-
return <HeaderTitle style={[styles.headerTitle, { color: tintColor }]}>Teams I lead</HeaderTitle>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const HeaderRight = () => {
|
|
20
|
-
const styles = useStyles()
|
|
21
|
-
const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()
|
|
22
|
-
const { resetTeamFilters, applyTeamFilters } = useFilterRecipientsContext()
|
|
23
|
-
|
|
24
|
-
const { team_ids } = route.params
|
|
25
|
-
const noTeamsSelected = team_ids?.length === 0 || !team_ids
|
|
26
|
-
const applyButtonAccessibilityHint = noTeamsSelected
|
|
27
|
-
? 'Select at least one team to navigate to the final step in creating your conversation.'
|
|
28
|
-
: 'Saves selected teams and navigates to the final step to create your conversation.'
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<View style={styles.headerRight}>
|
|
32
|
-
<TextButton
|
|
33
|
-
onPress={resetTeamFilters}
|
|
34
|
-
accessibilityHint="Cancels any selected teams and closes this modal."
|
|
35
|
-
>
|
|
36
|
-
Cancel
|
|
37
|
-
</TextButton>
|
|
38
|
-
<Button
|
|
39
|
-
title="Apply"
|
|
40
|
-
accessibilityHint={applyButtonAccessibilityHint}
|
|
41
|
-
onPress={() => applyTeamFilters(route.params)}
|
|
42
|
-
disabled={noTeamsSelected}
|
|
43
|
-
/>
|
|
44
|
-
</View>
|
|
45
|
-
)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const HeaderRightWithContext = () => {
|
|
49
|
-
return (
|
|
50
|
-
<FilterRecipientsProvider>
|
|
51
|
-
<HeaderRight />
|
|
52
|
-
</FilterRecipientsProvider>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
const useStyles = () => {
|
|
57
|
-
return StyleSheet.create({
|
|
58
|
-
headerTitle: {
|
|
59
|
-
fontSize: tokens.fontSizeLg,
|
|
60
|
-
flex: 1,
|
|
61
|
-
},
|
|
62
|
-
headerRight: {
|
|
63
|
-
flexDirection: 'row',
|
|
64
|
-
gap: 16,
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { createContext, PropsWithChildren } from 'react'
|
|
3
|
-
import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'
|
|
4
|
-
import {
|
|
5
|
-
ConversationFilterRecipientsParams,
|
|
6
|
-
ConversationFilterRecipientsScreenProps,
|
|
7
|
-
} from '../types'
|
|
8
|
-
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
|
|
9
|
-
|
|
10
|
-
export const FilterRecipientsContext = createContext<{
|
|
11
|
-
params: ConversationFilterRecipientsParams
|
|
12
|
-
resetTeamFilters: () => void
|
|
13
|
-
setTeamFilters: (params: ConversationFilterRecipientsParams) => void
|
|
14
|
-
applyTeamFilters: (params: ConversationFilterRecipientsParams) => void
|
|
15
|
-
}>({
|
|
16
|
-
params: {
|
|
17
|
-
source_app_name: undefined,
|
|
18
|
-
team_ids: [],
|
|
19
|
-
},
|
|
20
|
-
resetTeamFilters: () => {},
|
|
21
|
-
setTeamFilters: () => {},
|
|
22
|
-
applyTeamFilters: () => {},
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
export const FilterRecipientsProvider = ({ children }: PropsWithChildren) => {
|
|
26
|
-
const navigation =
|
|
27
|
-
useNavigation<NativeStackNavigationProp<ConversationFilterRecipientsScreenProps>>()
|
|
28
|
-
const route = useRoute<RouteProp<ConversationFilterRecipientsScreenProps['route']>>()
|
|
29
|
-
const filterContextValue = {
|
|
30
|
-
params: route.params,
|
|
31
|
-
resetTeamFilters: () => {
|
|
32
|
-
navigation.goBack()
|
|
33
|
-
},
|
|
34
|
-
setTeamFilters: (params: Omit<ConversationFilterRecipientsParams, 'source_app_name'>) => {
|
|
35
|
-
navigation.setParams({
|
|
36
|
-
team_ids: params.team_ids,
|
|
37
|
-
})
|
|
38
|
-
},
|
|
39
|
-
applyTeamFilters: (params: ConversationFilterRecipientsParams) => {
|
|
40
|
-
navigation.dispatch(StackActions.popTo('ConversationNew', params))
|
|
41
|
-
},
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<FilterRecipientsContext.Provider value={filterContextValue}>
|
|
46
|
-
{children}
|
|
47
|
-
</FilterRecipientsContext.Provider>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export const useFilterRecipientsContext = () => {
|
|
52
|
-
return React.useContext(FilterRecipientsContext)
|
|
53
|
-
}
|