@planningcenter/chat-react-native 3.12.2 → 3.12.3-rc.1
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/conversation/message_form.js +10 -2
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.d.ts.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +24 -12
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- 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 +21 -16
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +4 -8
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +4 -0
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +13 -0
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +2 -3
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +2 -3
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +15 -10
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/reactions_screen.js +2 -1
- package/build/screens/reactions_screen.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/message_form.tsx +10 -2
- package/src/screens/conversation/message_read_receipts_screen.tsx +31 -14
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +31 -25
- package/src/screens/conversation_filters/components/conversation_filters.tsx +4 -8
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +18 -0
- package/src/screens/conversation_filters/group_filters.tsx +2 -3
- package/src/screens/conversation_filters/team_filters.tsx +3 -3
- package/src/screens/conversation_filters_screen.tsx +19 -10
- package/src/screens/reactions_screen.tsx +3 -1
|
@@ -2,15 +2,21 @@ import React from 'react'
|
|
|
2
2
|
import { createContext, PropsWithChildren, useState } from 'react'
|
|
3
3
|
import { ConversationFiltersParams, ConversationFiltersScreenProps } from '../screen_props'
|
|
4
4
|
import { RouteProp, StackActions, useNavigation, useRoute } from '@react-navigation/native'
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
6
|
+
import { Platform } from 'react-native'
|
|
7
|
+
|
|
8
|
+
const DEFAULT_LIST_PADDING_BOTTOM = 64
|
|
5
9
|
|
|
6
10
|
export const FilterContext = createContext<{
|
|
7
11
|
params: ConversationFiltersParams
|
|
8
12
|
scrollOffset: number
|
|
9
13
|
setScrollOffset: (offset: number) => void
|
|
14
|
+
setFormSheetHeaderHeight: (height: number) => void
|
|
10
15
|
resetFilter: () => void
|
|
11
16
|
setGroupFilter: (params: ConversationFiltersParams) => void
|
|
12
17
|
setAppFilter: (params: ConversationFiltersParams) => void
|
|
13
18
|
applyFilters: (params: ConversationFiltersParams) => void
|
|
19
|
+
platformListPaddingBottom: number | undefined
|
|
14
20
|
}>({
|
|
15
21
|
params: {
|
|
16
22
|
chat_group_graph_id: undefined,
|
|
@@ -18,20 +24,32 @@ export const FilterContext = createContext<{
|
|
|
18
24
|
},
|
|
19
25
|
scrollOffset: 0,
|
|
20
26
|
setScrollOffset: () => {},
|
|
27
|
+
setFormSheetHeaderHeight: () => {},
|
|
21
28
|
resetFilter: () => {},
|
|
22
29
|
setGroupFilter: () => {},
|
|
23
30
|
setAppFilter: () => {},
|
|
24
31
|
applyFilters: () => {},
|
|
32
|
+
platformListPaddingBottom: DEFAULT_LIST_PADDING_BOTTOM,
|
|
25
33
|
})
|
|
26
34
|
|
|
27
35
|
export const FilterProvider = ({ children }: PropsWithChildren) => {
|
|
28
36
|
const [scrollOffset, setScrollOffset] = useState(0)
|
|
37
|
+
const [formSheetHeaderHeight, setFormSheetHeaderHeight] = useState(56)
|
|
29
38
|
const navigation = useNavigation()
|
|
30
39
|
const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()
|
|
40
|
+
const { bottom } = useSafeAreaInsets()
|
|
41
|
+
|
|
42
|
+
const platformListPaddingBottom = Platform.select({
|
|
43
|
+
ios: bottom + formSheetHeaderHeight,
|
|
44
|
+
android: bottom + 12,
|
|
45
|
+
})
|
|
46
|
+
|
|
31
47
|
const filterContextValue = {
|
|
32
48
|
params: route.params,
|
|
33
49
|
scrollOffset,
|
|
34
50
|
setScrollOffset,
|
|
51
|
+
platformListPaddingBottom,
|
|
52
|
+
setFormSheetHeaderHeight,
|
|
35
53
|
resetFilter: () => {
|
|
36
54
|
navigation.dispatch(
|
|
37
55
|
StackActions.popTo('Conversations', {
|
|
@@ -7,7 +7,6 @@ import { StaticScreenProps } from '@react-navigation/native'
|
|
|
7
7
|
import { useGroupsToFilter } from './hooks/filters'
|
|
8
8
|
import { GroupRow } from './components/rows'
|
|
9
9
|
import { useFilterContext } from './context/conversation_filter_context'
|
|
10
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
11
10
|
|
|
12
11
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>
|
|
13
12
|
|
|
@@ -32,10 +31,10 @@ export const GroupFilters = () => {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
const useStyles = () => {
|
|
35
|
-
const {
|
|
34
|
+
const { platformListPaddingBottom } = useFilterContext()
|
|
36
35
|
return StyleSheet.create({
|
|
37
36
|
container: {
|
|
38
|
-
paddingBottom:
|
|
37
|
+
paddingBottom: platformListPaddingBottom,
|
|
39
38
|
},
|
|
40
39
|
})
|
|
41
40
|
}
|
|
@@ -7,7 +7,6 @@ import { TeamRow } from './components/rows'
|
|
|
7
7
|
import { useFilterContext } from './context/conversation_filter_context'
|
|
8
8
|
import { useTeamsToFilter } from './hooks/filters'
|
|
9
9
|
import { ConversationFiltersParams } from './screen_props'
|
|
10
|
-
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
11
10
|
|
|
12
11
|
export type GroupFiltersScreenProps = StaticScreenProps<ConversationFiltersParams>
|
|
13
12
|
|
|
@@ -32,10 +31,11 @@ export const TeamFilters = () => {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
const useStyles = () => {
|
|
35
|
-
const {
|
|
34
|
+
const { platformListPaddingBottom } = useFilterContext()
|
|
35
|
+
|
|
36
36
|
return StyleSheet.create({
|
|
37
37
|
container: {
|
|
38
|
-
paddingBottom:
|
|
38
|
+
paddingBottom: platformListPaddingBottom,
|
|
39
39
|
},
|
|
40
40
|
})
|
|
41
41
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useHeaderHeight } from '@react-navigation/elements'
|
|
2
2
|
import { createComponentForStaticNavigation, RouteProp, useRoute } from '@react-navigation/native'
|
|
3
3
|
import { createNativeStackNavigator } from '@react-navigation/native-stack'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
import { Platform, StyleSheet, useWindowDimensions } from 'react-native'
|
|
4
|
+
import React, { useCallback } from 'react'
|
|
5
|
+
import { LayoutChangeEvent, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
6
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
7
7
|
import {
|
|
8
8
|
FilterProvider,
|
|
@@ -74,18 +74,27 @@ export const ConversationFiltersScreen = (_props: ConversationFiltersScreenProps
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
const FormSheetHeaderWithContext = () => {
|
|
77
|
-
const { resetFilter, applyFilters } = useFilterContext()
|
|
77
|
+
const { resetFilter, applyFilters, setFormSheetHeaderHeight } = useFilterContext()
|
|
78
78
|
const route = useRoute<RouteProp<ConversationFiltersScreenProps['route']>>()
|
|
79
79
|
const styles = useStyles()
|
|
80
80
|
|
|
81
|
+
const handleFormSheetHeaderLayout = useCallback(
|
|
82
|
+
(event: LayoutChangeEvent) => {
|
|
83
|
+
setFormSheetHeaderHeight(event.nativeEvent.layout.height)
|
|
84
|
+
},
|
|
85
|
+
[setFormSheetHeaderHeight]
|
|
86
|
+
)
|
|
87
|
+
|
|
81
88
|
return (
|
|
82
|
-
<
|
|
83
|
-
<FormSheet.
|
|
84
|
-
|
|
85
|
-
<FormSheet.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
<View onLayout={handleFormSheetHeaderLayout}>
|
|
90
|
+
<FormSheet.Header style={styles.header}>
|
|
91
|
+
<FormSheet.HeaderTitle>Filters</FormSheet.HeaderTitle>
|
|
92
|
+
<FormSheet.HeaderActions>
|
|
93
|
+
<FormSheet.HeaderTextButton onPress={resetFilter}>Reset</FormSheet.HeaderTextButton>
|
|
94
|
+
<FormSheet.HeaderButton title="Apply" onPress={() => applyFilters(route.params)} />
|
|
95
|
+
</FormSheet.HeaderActions>
|
|
96
|
+
</FormSheet.Header>
|
|
97
|
+
</View>
|
|
89
98
|
)
|
|
90
99
|
}
|
|
91
100
|
|
|
@@ -120,6 +120,8 @@ const Author = memo(({ author }: { author: AuthorProps }) => {
|
|
|
120
120
|
)
|
|
121
121
|
})
|
|
122
122
|
|
|
123
|
+
const TABS_HEIGHT = 67
|
|
124
|
+
|
|
123
125
|
const useStyles = () => {
|
|
124
126
|
const { colors } = useTheme()
|
|
125
127
|
const { bottom } = useSafeAreaInsets()
|
|
@@ -131,7 +133,7 @@ const useStyles = () => {
|
|
|
131
133
|
},
|
|
132
134
|
contentContainer: {
|
|
133
135
|
paddingTop: 8,
|
|
134
|
-
paddingBottom: bottom + Platform.select({ android: 24, default:
|
|
136
|
+
paddingBottom: bottom + Platform.select({ android: 24, default: TABS_HEIGHT + 24 }),
|
|
135
137
|
},
|
|
136
138
|
authorRow: {
|
|
137
139
|
flexDirection: 'row',
|